CartoDB / observatory-extension

BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

feature request: have boundary functions return place names if they exist #321

Open andy-esch opened 6 years ago

andy-esch commented 6 years ago

Currently OBS_GetBoundariesByGeometry returns the_geom and geom_refs. It would also be extremely valuable if it returned the geometry name (e.g., county name), as well as the admin levels that it is embedded within.

For example, if I was interested in getting boundaries that are just counties in Texas and I don't have the specific geometry of Texas, it would be really useful to do a WHERE filter on the name (e.g., WHERE place_name ilike '%texas%' instead of knowing the structure of the geom_ref. In a lot of cases the geom_ref isn't the useful identifier, it's the geography names.

To me, the most obvious way to pull this off is to give back two new columns: geom_name and admin_hierarchy (for all the admin levels this geom is embedded within -- so State, then Country for if US counties are requested).

Thinking through this a little more, perhaps the admin_hierarchy could be an ETL task?

cc @hannahblue @antoniocarlon