uscensusbureau / citysdk

Convenient JavaScript utilities for working with Census APIs: Statistics, Cartographic GeoJSON, lat/lng -> FIPS, and other niceties (written in ClojureScript)
https://uscensusbureau.github.io/citysdk
MIT License
959 stars 184 forks source link

Make "within" container mode have some tolerance #141

Closed stevevance closed 9 years ago

stevevance commented 9 years ago

These two screenshots shows the result of when I send my containing geometry and ask for the container mode of "geometry" (intersects) and "within". The containing geometry is a Chicago community area called Avondale. The boundaries of Chicago community ares do not change and for the most part line up with Census tracts.

screenshot 2015-06-24 01 47 48 screenshot 2015-06-24 01 48 12

Is it possible to set a tolerance mode that will return the Census tracts that are "mostly" within the containing geometry? (This image shows how the borders are essentially the same but drawn with errors.)

screenshot 2015-06-24 01 52 01

afrasier commented 9 years ago

@stevevance, are the results any better if you use "geometry" instead of "geometry_within" - since your borders are so close to the Census boundaries it might play nicer. The algorithms for within/intersects are part of the ArcGIS server. It might be worth adding extra intersect modes directly selectable by users in the future. I went ahead and made an issue for that. (#142)

stevevance commented 9 years ago

@afrasier The screenshots show the difference in using the geometry & geometry_within parameters. Within is too explicit (restrictive) and excludes too many tracts or block groups to make it useful. Thanks for making the new issue!