Skip to content

Instantly share code, notes, and snippets.

@maptastik
Created April 25, 2016 13:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save maptastik/3b7f5d74a302265351af3f385b6c5932 to your computer and use it in GitHub Desktop.
Querying ArcGIS services with shapefile-ags

The basic syntax for downloading a service as a shapefile using shapefile-ags is:

shapefile-ags <map_service_layer_url>

The default output .zip is named shapefile.zip. There is an option to rename the output:

shapefile-ags <map_service_layer_url> --file-name='some_name.zip'

You can also query the service to return a subset of the data. For instance, say we only want to return Graves Rd in Scott County from the transportation service. We could write a query like this:

shapefil-ags http://gis.gscplanning.com/arcgis/rest/services/Transportation/MapServer/0 --where="FULLNAME='GRAVES RD'"

You can query and rename in the same command!

shapefil-ags http://gis.gscplanning.com/arcgis/rest/services/Transportation/MapServer/0 --where="FULLNAME='GRAVES RD'" --file-name=graves_rd.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment