how do I get all the records in a service layer to show up in the table or export to shapefile. Right now I'm only getting the first 1,000 and there are 3,080 records.
Normally services are configured by default to return only the first 1000 records. You can change the configuration of the service to return more features or if you don't have access to this configuration you can use for instance the REST interface to query records based on for instance the ObjectID:
objectid > the highest objectid from the previous query.
The query below queries the features starting from a certain objectid:
Query Features (Earthquakes from last 7 days - Earthquakes/EarthquakesFromLastSevenDays)
Using some Python code you can translate the url query to a featureclass:
fcout = r'path to your output featureclass'
url = 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/FeatureServer/0/query?objectIds=&where=objectid+%3E+224354126&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&outSR=&returnIdsOnly=false&f=pjson'
fs = arcpy.FeatureSet()
You should start with querying the entire service, store the result as featureclass, determine the highest objectid, and use that objectid in the next query. At the end merge the featureclasses...
Kind regards, Xander
I'm trying to use the a url that is an ArcGISDynamicMapServiceLayer and not a FeatureService. Is it possible to create a FeatureSet from that type of url? I've tried but I get this error "RecordSetObject: Cannot open table for Load". If so, would you be able to provide an example? Or perhaps you have another suggestion on how to use that type of service as a parameter to be used in a Geoprocessing Task on ArcGIS Server?
My layer url looks like this: https://localhost:6443/arcgis/rest/services/TEST_SERVICES/JKC/MapServer/1
You can change the Max Record count in the REST endpoint following this workflow:
How to update the Max Record Count of a Feature Service in REST
This is a very good suggestion (+1 for that), if you are the "owner" of the data and have administrative right on the service...
Depending on your workflow and needs, you can also set this parameter when publishing the feature service. You must have Feature Access enabled to adjust this number.
Retrieving data ...