Select to view content in your preferred language

How to update Hosted Feature Service spatialReference with update_definition

461
1
07-24-2019 02:54 PM
KeithLarson1
MVP Alum

Hello,

I am trying to update the definition of an existing Hosted Feature Service. I created a FeatureLayerCollection object from the item in ArcGIS Online and I am able to update some parts of the definition such as serviceDescription. However, when I try to update the spatialReference property, it returns {'success': True} without actually changing it. My guess is that it doesn't like that I'm passing it an object with another object in it, but I don't know any way around that. Here's a screenshot as an example.  

Does anyone know if I can update this, or am I out of luck?

Thanks,

Keith

1 Reply
jfisher
Occasional Contributor

I ran into the same problem. The documentation for GIS.content.create_service says that a blank feature service will take the spatial reference of the first added layer, but I found this not to be true when is_view=True. A work around is to create the feature service with a specified wkid. Of course this means deleting the old feature service, creating a new one, and updating any reference to it.

0 Kudos