Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with geopackages using QGIS for GeoERA TACTIC project #278

Closed
nmtoken opened this issue Jun 23, 2020 · 17 comments
Closed

Help with geopackages using QGIS for GeoERA TACTIC project #278

nmtoken opened this issue Jun 23, 2020 · 17 comments
Assignees

Comments

@nmtoken
Copy link

nmtoken commented Jun 23, 2020

-----Original Message----- From: Mansour, Majdi

I am working on TACTIC GeoERA project with GEUS and other partners. GEUS were trying to create a geopackage out of a simple ascii file using QGIS and were failing. I just wonder if you know how to create these geopackages and if you can offer any guidance.

@nmtoken
Copy link
Author

nmtoken commented Jun 23, 2020

Some information on creating GeoPackages can be found at:

https://geoera-gip.github.io/documentation/data.html#create-geopackage

@bgsmase
Copy link
Contributor

bgsmase commented Jun 23, 2020

Waiting for project to send example ASCII file so we know exactly what the data structure is.

@nmtoken
Copy link
Author

nmtoken commented Jun 25, 2020

Files are ASCII grid as per below example.
TACTIC.zip

@nmtoken
Copy link
Author

nmtoken commented Jun 25, 2020

Related issue: #282

@nmtoken
Copy link
Author

nmtoken commented Jul 2, 2020

Still awaiting confirmation on #282 as to whether GeoPackage is the correct way of supplying this grid data.

@nmtoken
Copy link
Author

nmtoken commented Jul 7, 2020

The following command line instruction will convert the ESRI ASCII grid to a GeoPackage RASTER:

gdal_translate -of GPKG dk_wet_phreaticsurface_2071-2100.asc dk_wet_phreaticsurface_2071-2100.gpkg -co QUALITY=100 -co TILE_FORMAT=TIFF -co QUANTITY_DEFINITION=levels -co RASTER_IDENTIFIER=dk_wet_phreaticsurface_2071-2100

Input file details (QGIS):

Name	dk_wet_phreaticsurface_2071-2100
Path	C:\DOWNLOADS\Op\TACTIC\dk_wet_phreaticsurface_2071-2100.asc
CRS	EPSG:4326 - WGS 84 - Geographic
Extent	439000.0001220700214617,6035000.0001221001148224 : 750000.0001220700796694,6405500.0001221001148224
Unit	degrees
Width	622
Height	741
Data type	Float64 - Sixty four bit floating point
GDAL Driver Description	AAIGrid
GDAL Driver Metadata	Arc/Info ASCII Grid
Dataset Description	C:/DOWNLOADS/Op/TACTIC/dk_wet_phreaticsurface_2071-2100.asc
Compression	
Band 1	
STATISTICS_MAXIMUM=28.0744
STATISTICS_MEAN=-1.8633706301214
STATISTICS_MINIMUM=-88.8128
STATISTICS_STDDEV=3.9842230661638
STATISTICS_VALID_PERCENT=46.68
More information	
Dimensions	X: 622 Y: 741 Bands: 1
Origin	439000,6.4055e+06
Pixel Size	500,-500

Output file details:

Name	dk_wet_phreaticsurface_2071-2100
Path	C:\DOWNLOADS\Op\TACTIC\dk_wet_phreaticsurface_2071-2100.gpkg
Source	GPKG:C:/DOWNLOADS/Op/TACTIC/dk_wet_phreaticsurface_2071-2100.gpkg:dk_wet_phreaticsurface_2071-2100
CRS	EPSG:4326 - WGS 84 - Geographic
Extent	439000.0001220700214617,6035000.0001221001148224 : 750000.0001220700796694,6405500.0001221001148224
Unit	degrees
Width	622
Height	741
Data type	Float32 - Thirty two bit floating point
GDAL Driver Description	GPKG
GDAL Driver Metadata	GeoPackage
Dataset Description	GPKG:C:/DOWNLOADS/Op/TACTIC/dk_wet_phreaticsurface_2071-2100.gpkg:dk_wet_phreaticsurface_2071-2100
Compression	
Band 1	
STATISTICS_MAXIMUM=28.07439994812
STATISTICS_MEAN=-1.8633706298333
STATISTICS_MINIMUM=-88.812797546387
STATISTICS_STDDEV=3.9842230628398
STATISTICS_VALID_PERCENT=46.68
More information	
AREA_OR_POINT=Point
IDENTIFIER=dk_wet_phreaticsurface_2071-2100
ZOOM_LEVEL=2
Dimensions	X: 622 Y: 741 Bands: 1
Origin	439000,6.4055e+06
Pixel Size	500,-500

TACTIC_in-and-out.zip

@fscgeus
Copy link

fscgeus commented Jul 8, 2020 via email

@nmtoken
Copy link
Author

nmtoken commented Jul 8, 2020

The ASCII file is as supplied by TACTIC and the 'proj' file shows only:

Projection    GEOGRAPHIC
Datum         WGS84
Spheroid      WGS84
Units         DD
Zunits        NO
Parameters   

So that's not UTM zone 32N (EPSG::32632).

@fscgeus
Copy link

fscgeus commented Jul 8, 2020 via email

@nmtoken
Copy link
Author

nmtoken commented Jul 8, 2020

So it's an issue in the input ASCII file (and proj file) that needs to be fixed, agreed. The issue here (278) is how to create a GeoPackage from an ASCII file.

@nmtoken
Copy link
Author

nmtoken commented Jul 8, 2020

Assuming data is epsg:32632

I deleted the supplied .prj file and ran:

gdal_translate -of GPKG dk_wet_phreaticsurface_2071-2100.asc TACTIC_Test.gpkg -co QUALITY=100 -co TILE_FORMAT=TIFF -co RASTER_IDENTIFIER=mungedExample -co RASTER_DESCRIPTION=Test -a_srs epsg:32632

gdalinfo (gdalinfo TACTIC_Test.gpkg) for the created file gives:

Driver: GPKG/GeoPackage
Files: TACTIC_Test.gpkg
Size is 622, 741
Coordinate System is:
PROJCRS["WGS 84 / UTM zone 32N",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["UTM zone 32N",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",9,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    ID["EPSG",32632]]
Data axis to CRS axis mapping: 1,2
Origin = (439000.000122070021462,6405500.000122100114822)
Pixel Size = (500.000000000000000,-500.000000000000000)
Metadata:
  AREA_OR_POINT=Point
  DESCRIPTION=Test
  IDENTIFIER=mungedExample
  ZOOM_LEVEL=2
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  439000.000, 6405500.000) (  7d58'26.62"E, 57d47'14.54"N)
Lower Left  (  439000.000, 6035000.000) (  8d 3'32.44"E, 54d27'32.41"N)
Upper Right (  750000.000, 6405500.000) ( 13d11'54.91"E, 57d43'18.87"N)
Lower Right (  750000.000, 6035000.000) ( 12d51' 7.09"E, 54d24' 4.37"N)
Center      (  594500.000, 6220250.000) ( 10d31'11.66"E, 56d 7' 4.69"N)
Band 1 Block=256x256 Type=Float32, ColorInterp=Undefined
  Description = Height
  Min=-88.813 Max=28.074
  NoData Value=-9999
  Metadata:
    STATISTICS_MAXIMUM=28.07439994812
    STATISTICS_MINIMUM=-88.812797546387

Inputs and outputs are:

munged.zip

@nmtoken
Copy link
Author

nmtoken commented Jul 8, 2020

@majdiman Can you check that the converted data is as expected (it will load into QGIS, and looks similar to the ASCII data, but you should double check...)

Note that @mh-geus-dk reports in #282 that you should probably be using GeoTIFF or NetCDF (rather than GeoPackage) so, if you can output either of those directly, that would be better.

@nmtoken
Copy link
Author

nmtoken commented Jul 24, 2020

You can get a netCDF by using:

gdal_translate -of netCDF dk_wet_phreaticsurface_2071-2100.asc dk_wet_phreaticsurface_2071-2100.nc -a_srs epsg:32632

and GeoTIFF with:

gdal_translate -of GTiff dk_wet_phreaticsurface_2071-2100.asc dk_wet_phreaticsurface_2071-2100.tiff -a_srs epsg:32632

tacticFileTest.zip

@mh-geus-dk can you test to see whether you can load any/all of these outputs to EGDI platform?

@nmtoken
Copy link
Author

nmtoken commented Sep 17, 2020

@mh-geus-dk Similarly to #297 we understand there is no upload facility for GeoTIFF or NetCDF or any non-model grid format, Should science projects just wait until such functionality is available, or is it possible to do some manual upload to test the data is as it should be.

@bgsmase
Copy link
Contributor

bgsmase commented Nov 5, 2020

As EGDI platform does not have upload facility perhaps files should be sent directly to @mh-geus-dk to assess wehther he can load them into the platform? The data files are attached to this issue, can Martin try to ingest them?

@bgsmase
Copy link
Contributor

bgsmase commented Mar 10, 2021

Have had email saying this issue can be closed; test data has been sent directly by project.

@bgsmase bgsmase closed this as completed Mar 10, 2021
@bgsmase
Copy link
Contributor

bgsmase commented Mar 10, 2021

There is an upload facility for GeoTIFF files on the production EGDI platform now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants