Hi Steve,
I will open a JIRA to add default values for unspecified datum .
(as far as I can see, NetCDF uses a Default sphere with radius = 6371229 if
nothing is specified).

In the meantime, you could add a "earth_radius" double attribute = 6371229
to the Lambert_Conformal variable of your NetCDF.
Finally, as reported in the NetCDF GeoServer documentation
<http://docs.geoserver.org/latest/en/user/community/netcdf/netcdf.html#supporting-custom-netcdf-coordinate-reference-systems>,
please, make sure to add a proper entry to the netCDF custom epsgs.

Something like this on a single line (see documentation):
PROJCS["lambert_conformal_conic_2SP",
  GEOGCS["unknown",
    DATUM["unknown",
      SPHEROID["unknown", 6371229.0, 0.0]],
    PRIMEM["Greenwich", 0.0],
    UNIT["degree", 0.017453292519943295],
    AXIS["Geodetic longitude", EAST],
    AXIS["Geodetic latitude", NORTH]],
  PROJECTION["Lambert_Conformal_Conic_2SP"],
  PARAMETER["central_meridian", -98.0],
  PARAMETER["latitude_of_origin", 89.9999],
  PARAMETER["standard_parallel_1", 60.0],
  PARAMETER["false_easting", 0.0],
  PARAMETER["false_northing", 0.0],
  PARAMETER["scale_factor", 1.0],
  PARAMETER["standard_parallel_2", 30.0],
  UNIT["m", 1.0],
  AXIS["Easting", EAST],
  AXIS["Northing", NORTH]]

This will allow GeoServer to recognize the projection exposed in the NetCDF
dataset.

Hope this helps.
Cheers,
Daniele



On Fri, Sep 18, 2015 at 3:46 PM, Ferguson, Steve -FS <sfergu...@fs.fed.us>
wrote:

> I am attempting to load a netcdf file in geoserver-2.8-RC1 (
> http://mtnweather.info/download/wrf_works.nc). With the same file loaded
> into netcdf-toolsUI I am able to view grids, so I would think the netcdf
> file might also be valid in geoserver. Upon attempting to add the store, I
> receive the error : Could not list layers for this store, an error occurred
> retrieving them.  Any help in understanding and resolving this error would
> be greatly appreciated.
>
>
>
> The detailed error message reported on the console is :
>
>
>
>
>
> WARN [netcdf.NetCDFGeoreferenceManager] - Unsupported axis: double
> lat(y=449, x=599);
>
>   :axis = "Y";
>
>   :units = "degrees_north";
>
>   :long_name = "latitude";
>
>   :standard_name = "latitude";
>
>   :_CoordinateAxisType = "Lat";
>
> in input: C:/projects/firewx/wrf_works.nc has been found
>
> WARN [netcdf.NetCDFGeoreferenceManager] - Unsupported axis: double
> lon(y=449, x=599);
>
>   :axis = "X";
>
>   :units = "degrees_east";
>
>   :long_name = "longitude";
>
>   :standard_name = "longitude";
>
>   :_CoordinateAxisType = "Lon";
>
> in input: C:/projects/firewx/wrf_works.nc has been found
>
> 18 Sep 06:08:17 WARN [netcdf.NetCDFFormat] - Unable to connect
>
> org.geotools.data.DataSourceException: Unable to connect
>
>         at
> org.geotools.coverage.io.netcdf.NetCDFReader.<init>(NetCDFReader.java:158)
>
>         at
> org.geotools.coverage.io.netcdf.NetCDFFormat.getReader(NetCDFFormat.java:95)
>
>         at
> org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1441)
>
>         at
> org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1369)
>
>
>
> ….
>
>
>
> Caused by: java.lang.NullPointerException
>
>             at
> org.geotools.coverage.io.netcdf.crs.ProjectionBuilder.createEllipsoid(ProjectionBuilder.java:255)
>
>             at
> org.geotools.coverage.io.netcdf.crs.NetCDFProjection.buildEllipsoid(NetCDFProjection.java:453)
>
>             at
> org.geotools.coverage.io.netcdf.crs.NetCDFProjection.parseProjection(NetCDFProjection.java:323)
>
>             at
> org.geotools.coverage.io.netcdf.crs.NetCDFProjection.lookForVariableCRS(NetCDFProjection.java:532)
>
>             at
> org.geotools.imageio.netcdf.NetCDFGeoreferenceManager.extractBBOX(NetCDFGeoreferenceManager.java:261)
>
>             at
> org.geotools.imageio.netcdf.NetCDFGeoreferenceManager.<init>(NetCDFGeoreferenceManager.java:155)
>
>             at
> org.geotools.imageio.netcdf.NetCDFImageReader.init(NetCDFImageReader.java:443)
>
>             at
> org.geotools.imageio.netcdf.NetCDFImageReader.setInput(NetCDFImageReader.java:258)
>
>
>
>
>
> When I look at the code for this error in geotools, it looks like this :
>
>
>
> public static Ellipsoid createEllipsoid(String name, Map<String, Number>
> ellipsoidParams) {
>
>         Number semiMajor = null;
>
>         Number semiMinor = null;
>
>         Number inverseFlattening = Double.NEGATIVE_INFINITY;
>
>         if (ellipsoidParams.containsKey(NetCDFUtilities.SEMI_MAJOR)) {
>
>             semiMajor = ellipsoidParams.get(NetCDFUtilities.SEMI_MAJOR);
>
>         }
>
>         if (ellipsoidParams.containsKey(NetCDFUtilities.SEMI_MINOR)) {
>
>             semiMinor = ellipsoidParams.get(NetCDFUtilities.SEMI_MINOR);
>
>         }
>
>         if
> (ellipsoidParams.containsKey(NetCDFUtilities.INVERSE_FLATTENING)) {
>
>             inverseFlattening =
> ellipsoidParams.get(NetCDFUtilities.INVERSE_FLATTENING);
>
>         }
>
>         if (semiMinor != null) {
>
>             return DefaultEllipsoid.createEllipsoid(name,
> semiMajor.doubleValue(),
>
>                     semiMinor.doubleValue(), SI.METER);
>
>         } else {
>
>             return DefaultEllipsoid.createFlattenedSphere(name,
> semiMajor.doubleValue(), /// --- *NPE HERE semiMajor remains null.*
>
>                     inverseFlattening.doubleValue(), SI.METER);
>
>         }
>
>     }
>
>
>
> Thanks!
>
>
>
>
>
>
>
> *Steve Ferguson*
> Application Developer
>
> This electronic message contains information generated by the USDA solely
> for the intended recipients. Any unauthorized interception of this message
> or the use or disclosure of the information it contains may violate the law
> and subject the violator to civil or criminal penalties. If you believe you
> have received this message in error, please notify the sender and delete
> the email immediately.
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to