I'm trying to use this MapServer, but I'm having a very difficult time with the attribute table of a specific layer. I need the coordinates of each hydrant in franklin county in kentucky.

When connecting to the server through ArcGIS and opening the hydrant layer all I see are the hydrants. I need the coordinates of each hydrant. I know the data is there, because when I click on one of the points using the identify tool the information that should be in an attribute shows.

Map Server: http://agis21.frankfort.ky.gov/ArcGIS/rest/services/Hydrants/MapServer/0

I've tried using the Metadata toolset with no luck.

1 Answer 1

import arcpy
fcout = r'C:\Hydrants_test01.shp'
url = 'http://agis21.frankfort.ky.gov/ArcGIS/rest/services/Hydrants/MapServer/0/query?text=&geometry=&geometryType=esriGeometryPoint&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&objectIds=&where=1%3D1&time=&returnCountOnly=false&returnIdsOnly=false&returnGeometry=true&maxAllowableOffset=&outSR=&outFields=&f=pjson'

fs = arcpy.FeatureSet()
arcpy.CopyFeatures_management(fs, fcout)

this should result in a shapefile C:\Hydrants_test01.shp that contains the information you are interested in. There might be some limites with regards til the number of features you can download at one time.

  • Python is definitely not a strong suit of mine. Could you show me how to implement this?
    – user50739
    Apr 21, 2015 at 2:53
  • Wait until my edit on answer will be reviewed (there is a mistake in code), save the code in file C:\GetMyHydrants.py and double click that file :) Apr 23, 2015 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.