Question

Creating an ESRI Feature Layer using Python

  • 26 October 2016
  • 2 replies
  • 15 views

Badge

I wonder if anyone has used the Python Caller transformer to create an ESRI feature layer using ArcPY or ArcRest to publish the feature layer in AGOL, Portal or ArcGIS server. I'd be interested to work together with anyone who has a use case for this. With Portal or AGOL writer I could create a feature service but I want my service to be rendered with the appropriate layer properties so all the user need to do is add the feature layer on a web map in Portal or AGOL. An appropriate SD file created from an MXD or lyr file would be necessary to store the layer properties.

Per FME documentation: AGOL writer layer creation is not supported.


2 replies

Just to clarify, do you want to create a new feature service, or just add a layer onto an existing service? The FME AGOL writer can do the former, but not the latter.

Either way, after your data has been written to ArcGIS Online, it *should* be possible to alter the layer properties through the REST API:

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Update_Definition_Feature_Layer/02r30000022p000000/

I don't have a working example, however. Would love to see a workspace that does this, if anyone has managed it.

Badge

Just to clarify, do you want to create a new feature service, or just add a layer onto an existing service? The FME AGOL writer can do the former, but not the latter.

Either way, after your data has been written to ArcGIS Online, it *should* be possible to alter the layer properties through the REST API:

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Update_Definition_Feature_Layer/02r30000022p000000/

I don't have a working example, however. Would love to see a workspace that does this, if anyone has managed it.

I found python code in Github that could do this: https://github.com/ecaldwell/portal-admin-examples. This code uses the ArcGIS Rest API. Next challenge is to implement this using our infrastructure. Code is a bit too complex for me but I'll try to make it work first.

 

 

Reply