GeoEra-GIP / Project-Support-WP8

Science Project Data provider support
https://geoera-gip.github.io/support/
7 stars 2 forks source link

Uploading GeoTIFF in dev platform results in error #456

Closed nmtoken closed 3 years ago

nmtoken commented 3 years ago

Attempting to upload a GeoTIFF file supplied by the HOVER project in the development EGDI platform results in error:

Exception: The following projections (epsgs) are not supported: 9001

Detailed log
java.lang.Exception: The following projections (epsgs) are not supported: 9001 at org.apache.jsp.geopack2_jsp._jspService(geopack2_jsp.java:669) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCapturer.invoke(OpenEJBSecurityListener.java:97) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
nmtoken commented 3 years ago

hoverNTT.zip

File is _NTTETRS-LCC.tif in above zip.

mh-geus-dk commented 3 years ago

I'm not sure why it dosn't work but both QGIS and the Adm. module gets confused by this GeoTIFF. I have tried to open it in QGIS and telling QGIS it is in EPSG:3034 and the save. After that all works smoothly. I have asked one of our GIS specialist if he tell why the original doesn't work as expected. You can see the layer here: https://egditest01.geus.dk/egdi/?mapname=gip_p_preview#baslay=baseMapGEUS&extent=-109460,1293070,6887510,4419370&layers=nttmh

nmtoken commented 3 years ago

As the same issue has occurred with two independent TIFFs could the review also focus on the expectations of the upload tool.

mh-geus-dk commented 3 years ago

We are and have currently received nearly 90 GeoTIFF's from HOVER, GARAH and MUSE through the Administration module.

nmtoken commented 3 years ago

On live and dev, or just on live?

mh-geus-dk commented 3 years ago

Most of them on production but also some on test.

nmtoken commented 3 years ago

Leave you to debug the issues, and report

mh-geus-dk commented 3 years ago

I have added a description on how to overcome this problem in the FAQ in the EGDI User Guide: http://egdi-public.gitlabpages.geus.dk/egdi-documentation/#/other/faq?id=i-have-problems-with-upload-of-geotiff-files

nmtoken commented 3 years ago

GeoTIFF does not include a strictly defined format for the projection and in some cases the administration module cannot decifer the projection.

So the underlying issue is that module can't parse the coordinate system information in the WKT (gdalinfo name-of-geotiff gives response in OGC WKT, by default WKT2) but relies instead on the WKT response including only a PROJCRS block which includes an ID with a known EPSG identifier.

nmtoken commented 3 years ago

Note, an alternate method to get GeoTIFF with CRS metadata in format usable by EGDI is to use GDAL for example:

gdalwarp -t_srs EPSG:3034 HL_10_thickness.tif HL_10_thicknessforEGDI_3034.tif

Where original data (HL_10_thickness) has following metadata:

c:\Testing\GeoERA\hotlime\Thickness_EGDI_missing>gdalinfo HL_10_thickness.tif
Driver: GTiff/GeoTIFF
Files: HL_10_thickness.tif
       HL_10_thickness.tif.aux.xml
Size is 580, 292
Coordinate System is:
PROJCRS["ETRS89_ETRS_LCC",
    BASEGEOGCRS["ETRS89",
        DATUM["European Terrestrial Reference System 1989",
            ELLIPSOID["GRS 1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]],
            ID["EPSG",6258]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433,
                ID["EPSG",9122]]]],
    CONVERSION["Lambert Conic Conformal (2SP)",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",52,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",10,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",35,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",65,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",4000000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",2800000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2
Origin = (4155253.569578334689140,1812153.100074623711407)
Pixel Size = (27.308218223690698,-27.308218223691043)
Metadata:
  AREA_OR_POINT=Area
  DataType=Generic
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 4155253.570, 1812153.100) ( 11d56'51.15"E, 42d48'17.25"N)
Lower Left  ( 4155253.570, 1804179.100) ( 11d56'41.68"E, 42d43'52.24"N)
Upper Right ( 4171092.336, 1812153.100) ( 12d 8'46.04"E, 42d48' 2.67"N)
Lower Right ( 4171092.336, 1804179.100) ( 12d 8'35.60"E, 42d43'37.68"N)
Center      ( 4163172.953, 1808166.100) ( 12d 2'43.63"E, 42d45'57.63"N)
Band 1 Block=128x128 Type=Float32, ColorInterp=Gray
  Min=1502.928 Max=6167.892
  Minimum=1502.928, Maximum=6167.892, Mean=3727.397, StdDev=1049.127
  NoData Value=-3.40282299999999995e+38
  Metadata:
    STATISTICS_MAXIMUM=6167.8920898438
    STATISTICS_MEAN=3727.3970099713
    STATISTICS_MINIMUM=1502.9279785156
    STATISTICS_STDDEV=1049.1273234874
    STATISTICS_VALID_PERCENT=24.66

and new GeoTIFF (HL_10_thicknessforEGDI_3034.tif) has

c:\Testing\GeoERA\hotlime\Thickness_EGDI_missing>gdalinfo HL_10_thicknessforEGDI_3034.tif
Driver: GTiff/GeoTIFF
Files: HL_10_thicknessforEGDI_3034.tif
Size is 580, 292
Coordinate System is:
PROJCRS["ETRS89 / LCC Europe",
    BASEGEOGCRS["ETRS89",
        DATUM["European Terrestrial Reference System 1989",
            ELLIPSOID["GRS 1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4258]],
    CONVERSION["Europe Conformal 2001",
        METHOD["Lambert Conic Conformal (2SP)",
            ID["EPSG",9802]],
        PARAMETER["Latitude of false origin",52,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8821]],
        PARAMETER["Longitude of false origin",10,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8822]],
        PARAMETER["Latitude of 1st standard parallel",35,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8823]],
        PARAMETER["Latitude of 2nd standard parallel",65,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8824]],
        PARAMETER["Easting at false origin",4000000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8826]],
        PARAMETER["Northing at false origin",2800000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8827]]],
    CS[Cartesian,2],
        AXIS["northing (N)",north,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["easting (E)",east,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["unknown"],
        AREA["Europe - ETRS89"],
        BBOX[32.88,-16.1,84.17,40.18]],
    ID["EPSG",3034]]
Data axis to CRS axis mapping: 2,1
Origin = (4155253.569578334689140,1812153.100074623711407)
Pixel Size = (27.308218223690766,-27.308218223690766)
Metadata:
  AREA_OR_POINT=Area
  DataType=Generic
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 4155253.570, 1812153.100) ( 11d56'51.15"E, 42d48'17.25"N)
Lower Left  ( 4155253.570, 1804179.100) ( 11d56'41.68"E, 42d43'52.24"N)
Upper Right ( 4171092.336, 1812153.100) ( 12d 8'46.04"E, 42d48' 2.67"N)
Lower Right ( 4171092.336, 1804179.100) ( 12d 8'35.60"E, 42d43'37.68"N)
Center      ( 4163172.953, 1808166.100) ( 12d 2'43.63"E, 42d45'57.63"N)
Band 1 Block=580x3 Type=Float32, ColorInterp=Gray
  NoData Value=-3.40282299999999995e+38