AnsweredAssumed Answered

ArcGIS Server Rest API Query  - Multipoint

Question asked by Jaguar3310 on Oct 27, 2015
Latest reply on Mar 15, 2016 by Jaguar3310

Hello,

This is my first post to the ESRI forums but I am hoping there is someone out there that can assist me. I am a developer/database administrator, not a GIS professional so please be patient with my lack of GIS knowledge.

 

I am working on a project where I need to geocode around 20 million addresses and then take the latitude/longitude and query additional information for these addresses like Senate and Congressional districts, county and school district. After these addresses are complete, several times a year I need to process an addition 7-8 million addresses. Since this is an ongoing job with a fairly large amount of data I want this to be an automated process. I am writing C# code to interact with the ArcGIS Server Rest API to complete this task.

 

The geocoding was fairly easy, I’m sending batches of addresses to the geocode server that was made available by our GIS guys and when
the results come back I get a resultID back which is my unique identifier for each record. Here is a sample of the JSON string I send in to my code:

 

{records:[{attributes:{OBJECTID:1134,Address:123 Test St,City:Testville,Region:PA,Postal:12345}};{attributes:{OBJECTID:294302,Address:12 Fake Rd,City:Some
Town,Region:PA,Postal:54321}};]}

 

GeocodingCode.png

 

The problem I am running in to is when I try and query additional information (like school district in this example) for the returned
latitudes and longitudes. I can get it to work if I send the latitude/longitude one at a time using esriGeometryPoint for the Geometry Type. But this would require me to make 20 million calls to the ArcGIS server and I really want to avoid that. It would be much faster if I could send batches of lat/long points to the server like I did for the geocoding. I had some success changing the Geometry Type to esriGeometryMultipoint and I do get multiple records back but I cannot find a way to pass in and return a unique identifier for me to know which returned school district goes with which latitude/longitude. Also, if I happen to pass in an invalid lat/long it skips this record so my return count is different than the number of records I sent in.

 

Even if there was no unique identifier available, I could work with the original lat/long that was sent in. Unfortunately, this is not returned either. Here is my code and a sample string of lat/longs for the strLatLongCollection variable:

 

[-77.1111236737177,40.3156937711517],[-75.8130555653613,40.1077510928398]

 

QueryCode.png


Here is a sample of my returned data when I ask for all columns to be returned. Neither the “ID”, “OBJECTID” or “IU_NUM” are helpful.
They all relate to the returned school district, and not the lat/long I sent to the server.

 

FeatureResults.png

I also tried returning the geometry with the results. I’m not sure what “rings” are but none of the values are associated to the lat/long I sent to the server.

GeometryResults.png

I just need a way to associate the results with the records I sent to the Rest API query. Am I going about this wrong or perhaps missing something? I would so appreciate some help.

Outcomes