Bolton-and-Menk-GIS / restapi

Python API designed to work externally with ArcGIS REST Services to query and extract data, and view service properties. Uses arcpy for some functions if available, otherwise uses open source alternatives to interact with the ArcGIS REST API. Also includes a subpackage for administering ArcGIS Server Sites.
GNU General Public License v2.0
93 stars 31 forks source link

Can’t pass outSR to query #39

Closed ghost closed 3 years ago

ghost commented 3 years ago

I'm interested in passing outSR to query. Is it possible via kwargs? Tried several ways (escaped string, raw string) but it doesn't seem to work. Wrote my own url_builder, and it is working fine. However I would like to do it with restapi. Please advise.

philnagel commented 3 years ago

Can you show some example of how you are passing the spatial reference? You are correct, passing a kwarg of outSR should work. The value should be either the WKID (integer, not string), or you can pass a dict formatted like spatialReference JSON object.

So for example to request the result in WGS1984, you could pass outSR=4326 or outSR={"wkid" = 4326}

ghost commented 3 years ago

Great! That solves the problem. I was passing WKTEXT instead. Thanks for prompt response!