ckan / ckan/ckanext-spatial

Issues for bbox covering 180° longitude

Open
#90 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
XSLT
Stars
136
Forks
207
PR merge metrics
No merged PRs in 30d

Description

For a given bbox, when it covers 180° longitude line, as shown in the attached image, I can see there might be two issues in map displaying and spatial solr querying.

Map display:
If a spatial data contains polygon as [[[170, 60], [-170, 60], [-170, 70], [170, 70], [170, 60]]], instead of mapping it as it should be in the attached image with 20° wide longitude, it actually maps it the other way around the global with a 340° wide longitude box, equivalent to this map http://demo.ckan.org/dataset?ext_bbox=170,60,-170,70

Spatial query:
When plotting the bbox covering 180° longitude line on the map and send spatial query to solr, the mapping code is actually converting the one of the longitude to value larger than 180 or less then -180, depending on where the line is drawn on the map. So the bbox is displayed correctly on the map, but the actual spatial query is asking for wrong data. For example, for bbox in the attached image, the actual bbox values used is -190(instead of 170), 60, -170, 70. For the part of -190 to -180, solr is not going to return any meaningful data. In this case, a combined query of 170, 60, 180, 70 and -180, 60, -170, 70 will make more sense, and get correct data from solr.

![screenshot 2014-12-05 11 35 49](https://cloud.githubusercontent.com/assets/1392461/5318964/edf2cf98-7c72-11e4-9384-3f68ccdfe646.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.