Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
CUBE
  • Product Communities
  • Mobility Simulation
  • CUBE
  • Cancel
CUBE
CUBE Wiki How to Upload Your Maps to Arcgis Online Within the Application Manager Process Using Python?
    • Sign In
    • Wiki
    • -CUBE
      • +Announcements
      • +CUBE CONNECT Edition
      • -Cube 6
        • +Installation
        • +Licensing for CUBE 6.1.1
        • +Licensing for CUBE 6.4.x
        • -Base
          • How to fix ESRI Basemaps not loading anymore
          • +How to build a network from shape while there is NO A&B node information and get directions from the shape file?
          • How to export a Public Transport Line File (.lin) into a Shape File and DBF files
          • How to Load Raster Layer in Cube
          • Applying the power of GIS mapping capabilities inside CUBE
          • How to Add a New Centroid and Centroid Connector to a Network Which Already Has Existing Centroids/Centroid Connectors
          • How to Control the Model Applier's Accessibility to Applications and Catalog Keys?
          • How to fix 'Control ‘ScenAppPanel’ has no parent window'
          • Aligning underlying background images with CUBE Network (.net)
          • How to add ArcGIS online background maps to a highway network layer inside GIS window?
          • How to Add Branch Control?
          • How to Add Centroids and Centroid Connectors in CUBE Networks
          • How to compare networks and create difference network bandwidths?
          • How to Create a Network from Shapefile?
          • How to Create and Run Modification Log Files
          • How to create and use catalog keys?
          • How to create Bandwidth maps
          • How to Create Node / Point Charts
          • How to Delete Catalog Keys in Text Editor?
          • How to fix the issue with empty tools ribbon in Cube Base?
          • How to import a Line Shape File (.shp) into a CUBE Voyager PT Line File (.lin)
          • How to Import/Export Network Data
          • How to Include Python in Your Cube Application Manager Workflow?
          • How to perform link attributes calculation for a polygon-based selection of links in the NET Window
          • How to Upload Your Maps to Arcgis Online Within the Application Manager Process Using Python?
          • +How to use a polygon to extract subarea networks in CUBE GIS
          • How to Use True Shape Display?
        • +Voyager
        • +Avenue
        • +Analyst
        • +Analyst Drive
        • +Land
        • +Cargo
        • +Cluster
      • CUBE Access (formerly Sugar Access)
      • +Learning CUBE

     
     Questions about this article, topic, or product? Click here. 

    How to Upload Your Maps to Arcgis Online Within the Application Manager Process Using Python?

    Product(s): Cube
    Version(s): 6.1 to 6.5
    Area: Application Manager


    When you work with ArcGIS, you save your work through a map template called an MXD file. A valid MXD file should be created with ArcMap, using the Cube dataset or shape files providing with the data to be visualized and the mapping layout. Here we saw how to include Python in your Application Manager work-flow. Using Python, it is also possible to directly publish to ArcGIS online your output (or input) MXD storing your results visualizations or mappings. An attached ZIP is provided for the solution example.

    Solution

    To be able to make this “dynamic” in the process, it is necessary to:

    • keep the same .mdb/.gdb name for all the different scenarios, e.g.
      Scenario.mdb / or Shape Files
    • create the .mxd templates through ArcMAP and store these in an input folder within the catalog folder
    • copy the .mxd “templates” over, in the different Scenario specific folders. This can be easily done with a Pilot script as in the example below (e.g. for Loaded_Network.mxd)

    A Python User Program needs to be included in the Application Manager work-flow, as explained at the link above.

    The input “sys.argv” for this Python script can be included through Catalog Keys, as below:

    The process within this script is the following (as reported at the above source link):

    • Turn a map document into a Service Definition Draft (HostedMS.sddraft) using the arcpy.mapping.CreateMapSDDraft function.
    • Modify the XML inside the .sddraft with the appropriate settings using the xml.dom.minidom module.
    • Analyze the modified draft (HostedMSNew.sddraft) for errors using arcpy.mapping.AnalyzeForSD.
    • Stage the sddraft into a Service Definition file (.sd) using arcpy.StageService_server.
    • Upload the service to ArcGIS Online (ArcGIS.com) using arcpy.UploadServiceDefinition_server.

    Any error or message is written to the output Report.prn text file.

    The {AGOL_Username} and the {AGOL_Password} Catalog Keys are used in conjunction with the arcpy.SignInToPortal_server function. Nevertheless, for ArcGIS 10.2 (and later) users, it could be necessary to comment out this part of the script as below:


    And sign in / connect from ArcGIS for Desktop “File > Sign In” prior to run the Python program.


    Publishing_To_AGOL.zip

    • Share
    • History
    • More
    • Cancel
    • Angela Jose Created by Bentley Colleague Angela Jose
    • When: Tue, Feb 14 2023 2:24 AM
    • Vu Dang Last revision by Bentley Colleague Vu Dang
    • When: Wed, Feb 15 2023 12:49 PM
    • Revisions: 2
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies