Ocean-Data-Map-Project icon indicating copy to clipboard operation
Ocean-Data-Map-Project copied to clipboard

GeoTiff not plotting correctly

Open VanessaSutton-Pande opened this issue 8 years ago • 9 comments
trafficstars

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

VanessaSutton-Pande avatar Oct 16 '17 19:10 VanessaSutton-Pande

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.

htmlboss avatar Oct 17 '17 12:10 htmlboss

@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 avatar Oct 17 '17 16:10 Jeffreydaw

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

Jeffreydaw avatar Oct 17 '17 16:10 Jeffreydaw

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.

Jeffreydaw avatar Oct 17 '17 18:10 Jeffreydaw

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.

htmlboss avatar Jan 17 '18 14:01 htmlboss

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

Jeffreydaw avatar Feb 07 '18 13:02 Jeffreydaw

Did some more investigating:

  • We derive the geotiff projection from the constructed basemap object (wtf to that but anyways).
  • Even after manually changing projection results were still slightly skewed -> might have to do with source grid of datasets (native vs. lat/lon).
  • Before fixing this, map.py needs to be refactored, and cartopy integrated (or check if xArray can do the same job).

htmlboss avatar Jul 10 '18 12:07 htmlboss

dependent on #294

Jeffreydaw avatar Jul 20 '18 16:07 Jeffreydaw

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.

htmlboss avatar Apr 02 '20 13:04 htmlboss