whosonfirst / whosonfirst-www-spelunker

A simple Flask-based spelunker for poking around Who's On First data
BSD 3-Clause "New" or "Revised" License
7 stars 9 forks source link

Display lbl:bbox property when available #59

Open stepps00 opened 7 years ago

stepps00 commented 7 years ago

As outlined in this Pelias issue, the Spelunker should prefer loading the "lbl:bbox" shape over the "geom:bbox" shape when available.

As an example, the bounding box for France currently stretches to include outlying islands of Reunion and Martinique. Though a bounding box that only includes the main areas of France was added in a "lbl:bbox" property field and should be the preferred default bounding box for France.

(This property is currently in the records of France, the US, and Tokyo.)

thisisaaronland commented 7 years ago

"Should prefer" <-- where and when?

stepps00 commented 7 years ago

The "lbl:bbox" should be used instead of the "geom:bbox" any time it is available. This property is only in region and country records now, but this logic should probably be implemented across all placetypes.

The bounding box is loaded in the www/templates/id.html file here, which will need updating.

thisisaaronland commented 7 years ago

Is there an example of when and where we are doing anything with bounding boxes, besides dumping them at the bottom of the page?

The Spelunker is a general purpose tool designed to show all the details, not to prefer one property over another.

I'm not opposed to adding logic to give precedence to one bounding box over another given a specific use-case but I am not sure what that is.

stepps00 commented 7 years ago

Ah, the "geom:bbox" feeds the Leaflet map in the Spelunker, which in turn causes France to appear as:

screen shot 2016-12-02 at 2 49 20 pm
thisisaaronland commented 7 years ago

I see. The thing is that is not incorrect.

stepps00 commented 7 years ago

See also: the United States.

screen shot 2016-12-02 at 2 56 22 pm
thisisaaronland commented 7 years ago

Well, that just makes my point even more. The US in not simply the 48 continental states.

We can add hooks to draw a lbl:bbox in addition to geom:bbox when present.