[gdal-dev] vector representation in netcdf 4

Even Rouault even.rouault at spatialys.com
Wed Jan 16 00:32:07 PST 2019


David,

> 
> Thanks for sharing the updated sample product with srs info included.
> 
> I was able to mimic you polygon formatting in the attached TEST.nc file.
> Unfortunately I was not able to get the srs info captured in my shape file
> when applying ogr2ogr.
> I am using the same crs I used successful used for
> 2D rasters in nc4 (longitude latitude). When I turn the debug mode on it
> states it looks for a geoTransform when generating the shapefile. I
> therefore added a dummy geoTransform to my crs but that did not make a
> difference. I am unsure why this would be needed for a polygon, but saw
> your sample has one in there too. 
> Any idea what I might be doing incorrectly or should modify in my crs?
> Below I include the commandline outputs.

Several remarks:
- for the vector side, use ogrinfo for inspection. gdalinfo doesn't work for 
me with the file you provided, which is expected since it is a vector one and 
not a raster one, with 2.3.0 or above, so I suspect you might use a too old 
version
- it appears the code require the crs variable to have a 'spatial_ref' 
attribute with the WKT string and not 'crs_wkt'. Deducing the SRS from only CF 
attributes (grid_mapping_name, longitude_of_prime_meridian, semi_major_axis, 
inverse_flattening) isn't supported currently in the vector case, since the 
code also expects x and y variables to be present.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list