DFO-Ocean-Navigator / Ocean-Data-Map-Project

The Ocean Navigator is an online tool that is used to help visualise scientific research data. a users guide is available at https://dfo-ocean-navigator.github.io/Ocean-Navigator-Manual/ and the tool is live at
http://navigator.oceansdata.ca
GNU General Public License v3.0
49 stars 20 forks source link

GeoTiff not plotting correctly #114

Open VanessaSutton-Pande opened 6 years ago

VanessaSutton-Pande commented 6 years ago

GeoTiff but they don’t seem to be plotting correctly. Feedback from user: it may be because the coordinate reference system is not specified fully. Specifically, there is no datum specified, and that could be why everything is shifted over. (Usually at minimum there is a projection, ellipsoid, and datum specified in the spatial reference). Here is a screenshot. Not sure if this is an easy fix, thought I’d let you know. geotiff_plotting incorrectly

htmlboss commented 6 years ago

This could be a bit of nuisance to fix since there is no geotiff viewer for linux (AFAIK), so I won't be able to easily test a fix, but I'll poke around to see what's up.

Jeffreydaw commented 6 years ago

@htmlboss you can use google earth to open a geotiff file. selection_061

here is a quick guide on how to. but really you just need to import it.

Jeffreydaw commented 6 years ago

you can also use google earth to see the points that were plotted and change them to see what fits. selection_062

Jeffreydaw commented 6 years ago

The place to start looking at this issue is probably https://github.com/DFO-Ocean-Navigator/Ocean-Data-Map-Project/blob/92078e54079d2be5d85b4bc80e89550075701451/plotting/map.py#L450 that is the start of a section which defines the different aspects of the tiff file that is being generated.

htmlboss commented 6 years ago

So it IS a projection issue. The Navigator is sending out the image with a Lambert Conformal Conic (LCC) projection. Google Earth uses EPSG:3857 web mercator...so we need to talk about what format do we want to support.

Jeffreydaw commented 6 years ago

I think the format we have is fine but if we export a different projection that's probably fine.

htmlboss commented 6 years ago

Did some more investigating:

Jeffreydaw commented 6 years ago

dependent on #294

htmlboss commented 4 years ago

The issue occurs because the current GeoTIFF code uses EPSG:3857 which uses meters as the units for Lat/Lon. Our datasets are based on the WGS84 spheroid (specifically EPSG:4326) which uses degrees for Lat/Lon. Moving forward we simply need to create our GeoTIFFs with the EPSG:4326 projection.

Whoever ends up doing this: the GeoTIFF code should be re-written to use rioxarray instead of gdal. It results in a 3-4 line implementation instead of manually constructing the file.