This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Name: Export ArcGIS Server Map Service Layer to Shapefile with Iterate | |
#Author: Bryan McIntosh | |
#Description: Python script that connects to an ArcGIS Server Map Service and downloads a single vector layer | |
# to shapefiles. If there are more features than AGS max allowed, it will iterate to extract all features. | |
import urllib2,json,os,arcpy,itertools | |
ws = os.getcwd() + os.sep | |
#Set connection to ArcGIS Server, map service, layer ID, and server max requests (1000 is AGS default if not known). | |
serviceURL = "https://www.geoservicos1.segeth.df.gov.br/arcgis/rest/services" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Name: Export ArcGIS Server Map Service Layer to Shapefile | |
#Author: Bryan McIntosh | |
import urllib2, os, arcpy | |
# Variables | |
myUrl = "https://www.geoservicos1.segeth.df.gov.br/arcgis/rest/services" | |
myService = "/Luos/LUOS_PLC/MapServer" | |
myParams = "/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=true&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentsOnly=false&datumTransformation=¶meterValues=&rangeValues=&f=pjson" | |
# Query ArcGIS Server Map Service |