Issue 18193

Visualize coordinate uncertainty

18193
Reporter: mdoering
Assignee: hoefft
Type: Feedback
Summary: Visualize coordinate uncertainty
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2016-02-01 10:25:00.993
Updated: 2016-08-08 16:30:23.773
Resolved: 2016-08-08 16:30:23.721
        
Description: We should visualize the location of a single occurrence better.
In case of a simple lat/lon the interpreted coordinateAccurracy should be shown as a radius

In addition a location can be given as any arbitrary WellKnownText, mostly polygons, which would be great to see on a map, even though there are not many records using that feature (yet)]]>
    


Author: hoefft
Created: 2016-02-01 12:52:34.145
Updated: 2016-02-01 12:52:34.145
        
the maps already support this feature. but since it is in an iframe it is a but cumbersome.
But you can send the information to the iframe in two ways.

1) In javascript script (which would be prefered if it wasn't in an iframe)
{code}GBIF.basicMap.addGeoJson({"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[0,56],[36,56],[36,72],[0,72],[0,56]]]}}]});{code}

2) In the url: {code}http://cdn.gbif.org/v1/map/index.html?geojson={%22type%22:%22FeatureCollection%22,%22features%22:[{%22type%22:%22Feature%22,%22geometry%22:{%22type%22:%22Polygon%22,%22coordinates%22:[[[0,16],[36,26],[46,72],[0,72],[0,16]]]}}]}{code}

3) As an iFrame post - this is what we currently do for the dataset bounding boxes.
{code}
//iFrameParent
mapframe.onload = function() {
  var cw = mapframe.contentWindow;
  cw.postMessage({geojson: getGeoJsonFromBoxes(bboxes)}, "*");
};{code}
And then in the iframe this method listens for the messagr from the parent
{code}
function delayed_wrap_for_evil_and_terrible_iframe_communication(evt){
    setTimeout(function(){
        if (evt.data.geojson) {
            GBIF.basicMap.addGeoJson(evt.data.geojson);
        }
    }, 1500);
}
if (window.addEventListener) {
    // For standards-compliant web browsers
    window.addEventListener("message", delayed_wrap_for_evil_and_terrible_iframe_communication, false);
} else {
    window.attachEvent("onmessage", delayed_wrap_for_evil_and_terrible_iframe_communication);
}
{code}

The zoom to extent currently doesn't work well for multiple geometries though. polygons and markers are different and it will zoom to the marker and not the polygon if both a present.There is of course always the option to set the zoom level manually by adding the param {code}zoom=n{code}.

We could use this functionality to display both uncertainties and perhaps sample based data. This will only work for single occurrences of course, but it is a start.
    


Author: dagendresen
Created: 2016-04-07 15:09:57.33
Updated: 2016-04-07 15:09:57.33
        
Here is an example from the Norwegian GBIF node. Zoom in to see the WKT polygon as a box (here in this example, inferred from the verbatim MGRS coordinate), and the coordinate uncertainty presented as a circle:
http://data.gbif.no/datasets/e45c7d91-81c6-4455-86e3-2965a5739b1f/occurrences/325
http://www.gbif.org/occurrence/20570670 (same record in the GBIF portal)
    


Author: hoefft
Comment: Coordinate uncertainty is displayed in the new portal and won't be added to the existing. As for arbitrary geometries see issue: http://dev.gbif.org/issues/browse/POR-3110
Created: 2016-08-08 16:30:23.747
Updated: 2016-08-08 16:30:23.747