I'm trying to download hurricane data from ArcGIS. There are two things I can do.
I can go to their web interface at https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/Active_Hurricanes_v1/FeatureServer/1/query Set a few values ('Where' field I set to 1=1, 'Out Fields' I set to *) Then scroll to the bottom and click the "Query(GET)" button. Some values come up on the screen. All Good, but no shape data.
I can use Python (this is my real goal). I have a script to do this.
import urllib.request, urllib.error, urllib.parse
import json
url_json= 'https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/Active_Hurricanes_v1/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token='
response = urllib.request.urlopen(url_json)
webContent = response.read() # byte string of the JSON result
jsonContent = json.loads(webContent) # create a JSON object from the byte string
for object in jsonContent['features']:
rec = {} # create an empty dictionary for each feature
for k in object['attributes'].keys():
rec[k] = object['attributes'][k]
To get the url I used in the python program, I just pressed the button on (1) and then used the info in the url bar. Only difference is I selected json instead of html for output.
Problem: I can't figure out how to get it to return the blob for the shape info.
Does his API permit that?
If so, what do I do to in the query window and in the url to get it?
returnGeometry=false