netcdf in non latlon grid

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

netcdf in non latlon grid

Richard Duivenvoorde
Hi List,

I've succesfully created a simple minimal netcdf file (using Python)
with time-range-based data in a latlon grid:
like: float fakedata(time=3, z=3, lat=3, lon=4)

I can load the file (with several layers) both in QGIS (as mesh) and in
Geoserver (2.14.1 with netcdf extension) (with both time and elevation
dimensions): NICE!

BUT: we also want to project the data to our national grid: epsg:28992

If I understand docs correct, this should be possible (so: a known epsg,
no custom crs)?

Using gdal somebody provided me with a simple example in which instead
of lat lon the coordinates are x and y, and a CRS definition is defined:
"oblique_stereographic" and used as 'grid_mapping'.
But this is only 2D: (y=3, x=4)

With my python-netcdf-creation script I'm able to do that, and Geoserver
loads the data as one layer.
But trying to add time and/or z I fail:

Caused by: org.geotools.feature.IllegalAttributeException:Unknown
attribute time:null value:null
        at
org.geotools.feature.simple.SimpleFeatureImpl.setAttribute(SimpleFeatureImpl.java:238)
        at
org.geotools.imageio.netcdf.VariableAdapter.setFeatureTime(VariableAdapter.java:1327)
        at
org.geotools.imageio.netcdf.VariableAdapter.createFeature(VariableAdapter.java:1280)
        at
org.geotools.imageio.netcdf.VariableAdapter.getFeatures(VariableAdapter.java:1232)
        at
org.geotools.imageio.netcdf.NetCDFImageReader.initIndex(NetCDFImageReader.java:363)

or other silent issues.

I tried to google and look into the code to find the magic combination
of attributes/variables needed to be defined, but after hours of
fiddling, I tend to give up and ask for help :-)

So Question: should Geoserver be able to serve
fakedata(time=3, z=3, y=3, x=4)
with given crs, just as it is able to serve:
fakedata(time=3, z=3, lat=3, lon=4) ?

If anybody has a working example of such a grid I'm also happy, as that
proves that my feeling is right that it should be possible and I miss
something...

The python code and working latlon and not-working epsg28992 output
netcdf's are here http://duif.net/ncgeoserver.zip if somebody is willing
to have a look.

Regards,

Richard Duivenvoorde




_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: netcdf in non latlon grid

geowolf
Hi Richard,
I know we are serving plenty of projected datasets with multiple dimensions in GeoServer,
but I don't know what the specific issue is.
Could it be that your dataset is not CF convention compliant? 
I had a very quick look and I seem to remember the projection information should be in a "grid_mapping" variable
(e.g., the CF convention requires specific names to be used)

Also check the documentation:

Cheers
Andrea


On Wed, Jan 9, 2019 at 6:38 PM Richard Duivenvoorde <[hidden email]> wrote:
Hi List,

I've succesfully created a simple minimal netcdf file (using Python)
with time-range-based data in a latlon grid:
like: float fakedata(time=3, z=3, lat=3, lon=4)

I can load the file (with several layers) both in QGIS (as mesh) and in
Geoserver (2.14.1 with netcdf extension) (with both time and elevation
dimensions): NICE!

BUT: we also want to project the data to our national grid: epsg:28992

If I understand docs correct, this should be possible (so: a known epsg,
no custom crs)?

Using gdal somebody provided me with a simple example in which instead
of lat lon the coordinates are x and y, and a CRS definition is defined:
"oblique_stereographic" and used as 'grid_mapping'.
But this is only 2D: (y=3, x=4)

With my python-netcdf-creation script I'm able to do that, and Geoserver
loads the data as one layer.
But trying to add time and/or z I fail:

Caused by: org.geotools.feature.IllegalAttributeException:Unknown
attribute time:null value:null
        at
org.geotools.feature.simple.SimpleFeatureImpl.setAttribute(SimpleFeatureImpl.java:238)
        at
org.geotools.imageio.netcdf.VariableAdapter.setFeatureTime(VariableAdapter.java:1327)
        at
org.geotools.imageio.netcdf.VariableAdapter.createFeature(VariableAdapter.java:1280)
        at
org.geotools.imageio.netcdf.VariableAdapter.getFeatures(VariableAdapter.java:1232)
        at
org.geotools.imageio.netcdf.NetCDFImageReader.initIndex(NetCDFImageReader.java:363)

or other silent issues.

I tried to google and look into the code to find the magic combination
of attributes/variables needed to be defined, but after hours of
fiddling, I tend to give up and ask for help :-)

So Question: should Geoserver be able to serve
fakedata(time=3, z=3, y=3, x=4)
with given crs, just as it is able to serve:
fakedata(time=3, z=3, lat=3, lon=4) ?

If anybody has a working example of such a grid I'm also happy, as that
proves that my feeling is right that it should be possible and I miss
something...

The python code and working latlon and not-working epsg28992 output
netcdf's are here http://duif.net/ncgeoserver.zip if somebody is willing
to have a look.

Regards,

Richard Duivenvoorde




_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


--

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.



_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users