0

I would like to know if there is a way to serve feature class stored in ArcSDE into json format other thant publishing a map service and using queries with the REST API.

For instance, is it possible to publish a geoData service and serve the full features class in json format?

Is there any other way to serve json data from feature class stored in ArcSDE?

  • You can do virtually anything in a GP service, and the same goes for an SOE, but it does represent significant work to re-invent the wheel. – Vince Apr 8 '16 at 16:24
  • @Vince ok, so I presume you suggest to use queries with REST API – Below the Radar Apr 8 '16 at 18:08
  • You'd have to explain why you don't want to use existing functionality before I could make any recommendation. – Vince Apr 8 '16 at 19:20
  • I am a bit reluctant using a mapService because the datasets are not predefined. If I dont have to update my mapService when a new feature class is available, that will be a step avoided. – Below the Radar Apr 8 '16 at 19:29
  • In most use cases this is a complete non-issue, either because the services are fixed, or because new services are created for new data. – Vince Apr 8 '16 at 19:53
2

Even if you you could go with geodata services and doing crazy thing with replicas (extracting certain feature classes etc), you would still need to write own web service that would work with the data.

I strongly suggest using a geoprocessing service instead. You can write simple arcpy code that can read the feature class with arcpy.da.SearchCursor and mapping rows with fields (to a dict first and then using Python json module for dumping into JSON) and then create a list of features (as JSON objects). Alternatively, running the Features to JSON GP tool would do that for you.

  • Good idea. Do you think such geoprocessing would be faster, similar or slower then the REST queries in a mapService? – Below the Radar Apr 8 '16 at 16:59
  • Using a GP service for that will be slower than REST queries to map service or a map service with feature access enabled (aka feature service), but the question is how much slower can you accept it to be (comparing to the time you will spend developing an own web service that will serve the features). – Alex Tereshenkov Apr 8 '16 at 17:22
  • I am not sure to understand what you mean by having to develop a web service. My goal is to load json data from arcgis server into a javascript map API using REST request made with Ajax simplely – Below the Radar Apr 8 '16 at 17:27
  • @BelowtheRadar, the geodata service cannot return you the JSON. This is why I said that you would need an own web service that would read the contents of the data saved (perhaps in form of replicas). Go with the GP services; author a script tool that will return a JSON object back and make this the output parameter. In the JS API, you will be able to get back the JSON object to work with then. – Alex Tereshenkov Apr 11 '16 at 5:21
  • I am new to ArcGIS Server but I though that ArcGIS server would be able to return data from GP service over http. What python library would you use to serve the JSON ? Can you guide me to a documentation on this subject? – Below the Radar Apr 11 '16 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.