openaddresses/pyesridump

Query by geography

Opened this issue · 4 comments

Hi @iandees,

I have a project where I need to query a server by an area (I need to find all the blockgroups within a school attendance boundary). Is this something you would be interested in having in the library?

Best,

Forest

I'm inclined to say that this library should be used to dump the data and then other code should do the filtering by location or whatever.

But... What do you think the api would look like to do the geo query? Maybe expose a bounding box parameter that would replace the bounding box we get from he extent of the layer.

In some cases I think a geometry query would be useful. Sometimes I am trying to get a small section of a very large dataset. The query will run for a few hours and then time out and I cant actually download the data. I think a simple lat/lon bounding box would be very useful for querying these large datasets.

In at least some cases you can query by geometry if you pass esri2geojson some additional parameters using the -p flag. to query by a lat/lon bounding box I have used the following successfully:

esri2geojson -p geometryType=esriGeometryEnvelope -p geometry=-123.24,47.29,-122.50,48.01 -p spatialRel=esriSpatialRelIntersects -p inSR=4326 ...

I have only tried this on one server so far and I'm not sure what versions/server configurations it will work with.

I think if the README could have the -p documentation then this would solve the issue. @iandees would you accept a pull request of an updated README?

BTW, I used this command to get road jurisdiction from the Illinois Department of Transportation.

esri2geojson https://gis1.dot.illinois.gov/arcgis/rest/services/AdministrativeData/Jurisdiction/MapServer/0 -p geometry=-87.523328,41.469719,-88.263039,42.154472 -p inSR=4326 idot_roads.geojson

Sure, calling out the -p flag in the readme is probably a good idea.