Re: [gdal-dev] What's so wrong with this nc file ...

2021-10-30 Thread Jan Heckman
Hi list,
I am working with the LVBAG driver, for which I am truly grateful, by the
way, in C++.
I have a problem with OFTStringList and the corresponding
function GetAsStringList() and/or the cast operator(s) to
std::vector
In my code they produce an empty result.
switch (oField.GetType())
{
...
break;
case OFTStringList:
{
const std::string asString{ oField.GetAsString() };
cout << "Field type: " << oField.GetType() << ", string representation of
StringList: " << asString << endl;
const std::vector asList{ oField };
cout << "Vector length string list: " << asList.size() << endl;
}
break;
...
}
produces
(single item list)
Field type: 5, string representation of StringList:
(1:NL.IMBAG.Pand.051810310601)
Vector length string list: 0
(2 item list)
Field type: 5, string representation of StringList:
(2:woonfunctie,kantoorfunctie)
Vector length string list: 0
and similar when I use oField.GetAsStringList() or any other variant using
reference etc.
The library I use is gdal-303-1928-x64-core.msi obtained from gisinternals
supportsite.

I can parse the stringlist type, the strings will in this case not contain
comma's, but I appreciate a pointer
to achieving this without additional bother.
Thanks in advance,
Jan
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] What's so wrong with this nc file ...

2021-10-20 Thread Even Rouault

See https://github.com/OSGeo/gdal/issues/4581

Le 20/10/2021 à 02:01, Joaquim Manuel Freire Luís a écrit :


That the geotransform is not detected

gdalinfo xxx.grd

Warning 1: dimension #1 (x) is not a Longitude___/X dimension.

Warning 1: dimension #0 (y) is not a Latitude/Y dimension.

Driver: netCDF/Network Common Data Format

…

Corner Coordinates:

Upper Left  (    0.0, 0.0)

Lower Left  (    0.0, 59.0)

Upper Right (   37.0, 0.0)

Lower Right (   37.0, 59.0)

Center  (   18.5, 29.5)

I can’t get why it’s complaining on “dimension #1 (x) is not a 
Longitude/X dimension.”


Tried to check the full docs (netcdfdataset.cpp) but not even with a 
debugger I can understand the why.


Due to it the x,y coordinates are not fished from file, either from 
Julia or from GMT


NOTE: this works but does not use GDAL

grdinfo xxx.grd

xxx.grd: Title: z

xxx.grd: Command:

xxx.grd: Remark:

xxx.grd: Gridline node registration used [Cartesian grid]

xxx.grd: Grid file format: nf = GMT netCDF format (32-bit float), CF-1.7

xxx.grd: x_min: 580155 x_max: 581235 x_inc: 30 name: x n_columns: 37

xxx.grd: y_min: 4416795 y_max: 4418535 y_inc: 30 name: y n_rows: 59

xxx.grd: v_min: 0.205308780074 v_max: 0.56782335043 name: z

…

This DOES NOT WORK (it uses GDAL)

grdinfo xxx.grd=gd

Warning 1: dimension #1 (x) is not a Longitude___/X dimension.

Warning 1: dimension #0 (y) is not a Latitude/Y dimension.

xxx.grd: Title: Grid imported via GDAL

xxx.grd: Command:

xxx.grd: Remark:

xxx.grd: Gridline node registration used [Cartesian grid]

xxx.grd: Grid file format: gd = Import/export through GDAL

xxx.grd: x_min: 0.5 x_max: 36.5 x_inc: 1 name: x n_columns: 37

xxx.grd: y_min: 0.5 y_max: 58.5 y_inc: 1 name: y n_rows: 59

xxx.grd: v_min: 0.205308780074 v_max: 0.56782335043 name: z

xxx.grd: scale_factor: 1 add_offset: 0

+proj=utm +zone=10 +ellps=WGS84 +units=m +no_defs

What’s so wrong with this nc file? I have others that look similar in 
terms of attributes and things work fine, but for some other cases I 
get the terrible


Warning 1: dimension #1 (x) is not a Longitude/X dimension.

Warning 1: dimension #0 (y) is not a Latitude/Y dimension.

and I’m screwed.


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--
http://www.spatialys.com
My software is free, but my time generally not.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] What's so wrong with this nc file ...

2021-10-19 Thread Joaquim Manuel Freire Luís
That the geotransform is not detected

gdalinfo xxx.grd
Warning 1: dimension #1 (x) is not a Longitude___/X dimension.
Warning 1: dimension #0 (y) is not a Latitude/Y dimension.
Driver: netCDF/Network Common Data Format
...
Corner Coordinates:
Upper Left  (0.0,0.0)
Lower Left  (0.0,   59.0)
Upper Right (   37.0,0.0)
Lower Right (   37.0,   59.0)
Center  (   18.5,   29.5)

I can't get why it's complaining on "dimension #1 (x) is not a Longitude/X 
dimension."
Tried to check the full docs (netcdfdataset.cpp) but not even with a debugger I 
can understand the why.

Due to it the x,y coordinates are not fished from file, either from Julia or 
from GMT

NOTE: this works but does not use GDAL

grdinfo xxx.grd
xxx.grd: Title: z
xxx.grd: Command:
xxx.grd: Remark:
xxx.grd: Gridline node registration used [Cartesian grid]
xxx.grd: Grid file format: nf = GMT netCDF format (32-bit float), CF-1.7
xxx.grd: x_min: 580155 x_max: 581235 x_inc: 30 name: x n_columns: 37
xxx.grd: y_min: 4416795 y_max: 4418535 y_inc: 30 name: y n_rows: 59
xxx.grd: v_min: 0.205308780074 v_max: 0.56782335043 name: z
...

This DOES NOT WORK (it uses GDAL)

grdinfo xxx.grd=gd
Warning 1: dimension #1 (x) is not a Longitude___/X dimension.
Warning 1: dimension #0 (y) is not a Latitude/Y dimension.
xxx.grd: Title: Grid imported via GDAL
xxx.grd: Command:
xxx.grd: Remark:
xxx.grd: Gridline node registration used [Cartesian grid]
xxx.grd: Grid file format: gd = Import/export through GDAL
xxx.grd: x_min: 0.5 x_max: 36.5 x_inc: 1 name: x n_columns: 37
xxx.grd: y_min: 0.5 y_max: 58.5 y_inc: 1 name: y n_rows: 59
xxx.grd: v_min: 0.205308780074 v_max: 0.56782335043 name: z
xxx.grd: scale_factor: 1 add_offset: 0
+proj=utm +zone=10 +ellps=WGS84 +units=m +no_defs

What's so wrong with this nc file? I have others that look similar in terms of 
attributes and things work fine, but for some other cases I get the terrible

Warning 1: dimension #1 (x) is not a Longitude/X dimension.
Warning 1: dimension #0 (y) is not a Latitude/Y dimension.

and I'm screwed.




xxx.grd
Description: xxx.grd
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev