vecnet / dl-discovery

Map based discovery interface for digital library records
Other
4 stars 3 forks source link

bounding boxes crossing the antimeridian are not rendered correctly #12

Closed dbrower closed 9 years ago

dbrower commented 9 years ago

Bounding boxes which cross the anti-meridian (i.e. international date line) do not show up correctly. Solr requires east and west values to be in the range -180 to 180. So, these straddling boxes have an east coordinate "to the left" their west coordinate. I don't know if it is solr or leaflet which then decides this is an error, and swaps the east and west values, giving a bounding box covering the exact longitudes which the original box did not cover.

I don't know what is causing this error. The record with uuid hd76s009b has such a bounding box, for example.

stevenvandervalk commented 9 years ago

God this is an annoying one. There are plenty of references on how to deal with it :

but all end up with bounding boxes that are not correct despite wrapping around 'west' or on un rendered map.

I would turn off the bounding boxes as map objects but then they still get searched as intersections... is there a way to turn that off in solr?

DanielBaird commented 9 years ago

Okay new solution: split bounding boxes if they cross the antimeridian, and make each one two boxes.

On 11 March 2015 at 15:53, Steve Vandervalk notifications@github.com wrote:

God this is an annoying one. There are plenty of references on how to deal with it :

but all end up with bounding boxes that correct despite wrapping around 'west' or on un rendered map.

I would turn off the bounding boxes as map objects but then they still get searched as intersections... is there a way that off?

Reply to this email directly or view it on GitHub https://github.com/vecnet/dl-discovery/issues/12#issuecomment-78209300.

Daniel Baird I've tried going to the XHTML a few times, but it's always closed.

dbrower commented 9 years ago

Does the geoblacklight data model allow an item to have two bounding boxes?

dbrower commented 9 years ago

I don't think solr supports more than one bounding box per record: see https://cwiki.apache.org/confluence/display/solr/Spatial+Search#SpatialSearch-BBoxField

So we could split a bounding box up, and then choose the one which encloses a greater area. (it will be the one with the greater side length). This will affect accuracy.

DanielBaird commented 9 years ago

No sorry I was unclear. Solr should just store one box and not be worried about the inadequacies of the map display. When the map system in the UI goes to display a box that spans the dateline, we can add it to the map as two boxes -- purely as a UI technique.

Steven and I worked out how to correctly draw boxes across the anti-meridian, but Leaflet still only wants to put markers on a map once. That sounds normal but it means if you are zoomed out enough to see two USAs on the left and right edges of your screen, you can end up with a box that covers the right-side USA while the points are all drawn on the left side USA.

If you scroll left enough, at some point Leaflet will switch all the markers from the disappearing left version of the world to the version scrolling in from the right, but it only does that a whole world at a time -- all the markers move at once. If we draw wrapping boxes as if they were two boxes, they will always be displayed on the same "world" as the markers, and everything will line up that you'd expect to line up.

However... what exactly is being represented by Solr's bbox, if there's only one per record? Is it just the bounding box of all geo-positioned metadata that is connected to the record, for the convenience of doing geo-searches quickly? If that's what it is, I think we should not display that particular bbox. You (or Natalie, or whoever) might decide to add additional rectangles (or points or polys) that represent areas relevant to the stored item (e.g. area from which samples were collected), and we should display those, but if it's just a giant rectangle with one corner on Chicago where the author's institution is, and the other corner in SE Asia where the actual study was performed, that giant box doesn't inform anyone of anything useful, and we should not display it in the UI.

On 12 March 2015 at 05:46, Don Brower notifications@github.com wrote:

I don't think solr supports more than one bounding box per record: see https://cwiki.apache.org/confluence/display/solr/Spatial+Search#SpatialSearch-BBoxField

So we could split a bounding box up, and then choose the one which encloses a greater area. (it will be the one with the greater side length). This will affect accuracy.

Reply to this email directly or view it on GitHub https://github.com/vecnet/dl-discovery/issues/12#issuecomment-78355083.

Daniel Baird I've tried going to the XHTML a few times, but it's always closed.

dbrower commented 9 years ago

Fair enough. If you would like a list of bounding boxes in some field, that can be provided.

The solr *_bbox field is used by solr to do its geospatial indexing. That is how, I believe, solr will only retrieve records which are relevant to a specific area on the map. By convention, we are only including the areas relevant to the content of the record, and not the author's home institutions or other third party locations, in this bounding box. Since solr only wants a single bounding box, I've been calculating the smallest bounding box for the given data. But if we have lists of bounding boxes, I can provide more boxes. (say, one for each city or place name). And don't forget the multiple points a record may have.