elliott.plack

How to reproject an ArcGIS Online-hosted feature layer with attachments using ArcGIS Pro

Blog Post created by elliott.plack on Mar 2, 2018

I recently encountered a business need to reproject a hosted web feature layer from an obscure projection to Web Mercator. This layer was inadvertently published by a user that had previously used said projection and forgot to change it when publishing. Working with Esri Solutions Engineer Matthew Viverito, I was able to reproject a web feature layer that included attachments and point web apps to the new service using ago-assistant. In the process, I also preserved the last editor value in a new field.

 

What you need

  • Editor access to layer in ArcGIS Online (AGO)
  • ArcGIS Pro
  • Editor access to any maps or apps using layer in AGO

 

How To

Optional: Preserving editor tracking

The following steps are optional and pertain preserving editor tracking. If this is a requirement, do it before the reprojection

  1. Open the feature layer in AGO
  2. On the settings tab, disable editor tracking
  3. For good measure, export a backup to File GDB
  4. Open ArcGIS Pro and open an project for the work
  5. Open the Portal section of catalog and find the web feature layer
  6. Add fields for preservation, e.g., editor_old
  7. Use the field calculate geoprocessing tool to copy the values into the new fields
  8. Turn the editor tracking back on in AGO

 

Reprojecting the feature layer and publishing

  1. Open ArcGIS Pro and open an project for the work
  2. Create a new file geodatabase
  3. Create a new feature dataset in whatever projection you want for the new feature layer, i.e., the reprojection

    The feature dataset enforces the chosen projection of all data inside it.

  4. Find the old layer in Catalog pane under Portal content
  5. Add to a new map
  6. Export that layer to the that new geodatabase inside the feature dataset (attachments are enabled by default)
  7. Once the export finishes, add that feature class to a new map

    Make sure to use a new map so the old map's projection is not carried over when publishing

  8. Adjust any symbology you want to update before publishing
  9. Share as web layer to your AGO content
  10. Check the editor preferences in the parameters area
  11. Analyze and fix any issues
  12. Publish
  13. Find the layer in AGO content (on the web)
  14. Make any necessary sharing, metadata, layer, or group updates
  15. Copy the service URL
  16. Open the AGO Assistant
  17. Choose Update the URL of Services in a Web Map from the I want to... menu
  18. Select any maps or apps that reference the old layer and update them with the new URL

    The structure of the URL must be identical, including the layer number if applicable

  19. Test all affected maps and apps for functionality

The reprojected layer should now be visible throughout AGO

There is a bug with the attribute table widget in Web App Builder. It is necessary to recreate any web apps where the attribute table is configured to look at a layer in the web map.

Outcomes