[Gdal-dev] Problems retrieving z-values
tjansson
tommy.jansson at kongsberg.com
Thu Sep 27 03:28:23 EDT 2007
> Could you provide some snippet of your code + ideally a piece of data?
> As I see, we don't have any tests of 25D geometries for S-57 so I'm
> interested in updating the test suite accordingly.
A part of the code traverses thourgh all layers and extract each feature...
while((poFeature = poLayer->GetNextFeature()) != NULL)
...with appurtenant feature definition...
poFDefn = poLayer->GetLayerDefn()
...and geometry...
poGeometry = poFeature->GetGeometryRef()
These properties - feature, feature definition and geometry - are passed as
parameters to a parser function...
parseGeometry(..., poGeometry, poFDefn, poFeature, ...);
In the parserGeometry function there the geometry type is retieved...
OGRwkbGeometryType geometryType = poFDefn->GetGeomType();
...and a switch is used to check what type is it...
switch(geometryType)
{
...
case wkbPoint:
poPoint = (OGRPoint *) poGeometry;
double dX = poPoint->getX();
double dY = poPoint->getY();
...
case wkbPoint25D:
poPoint = (OGRPoint *) poGeometry;
double dX = poPoint->getX();
double dY = poPoint->getY();
double dY = poPoint->getZ();
...
}
I the switch have cases for all the different geometry types - wkbUnknown,
wkbPoint, wkbLineString, wkbPolygon, wkbMultiPoint, wkbMultiLineString,
wkbMultiPolygon, wkbGeometryCollection, wkbNone, wkbLinearRing, wkbPoint25D,
wkbLineString25D, wkbPolygon25D, wkbMultiPoint25D, wkbMultiLineString25D,
wkbMultiPolygon25D, wkbGeometryCollection25D - but, as stated before, the
code never hits on any of the 2.5D types cases.
The maps I am user are downloaded from NOAA (
http://chartmaker.ncd.noaa.gov/mcd/enc/download.htm
http://chartmaker.ncd.noaa.gov/mcd/enc/download.htm). One map I have used
is one called http://www.nabble.com/file/p12916176/US2AK91M.000
US2AK91M.000 . This is converter into a simple dat-file (
http://www.nabble.com/file/p12916176/s57output.dat s57output.dat )
containing XYZ-data. The Z-data has until now, always been 0 (zero), but the
XY-data are ok as far as I can tell.
http://www.nabble.com/file/p12916176/US2AK91M_000_pic.jpg
Above is an image drawn with GNUPlot from dat-file generated by the code.
Don't know if this helps in identifying the problem.
--
View this message in context: http://www.nabble.com/Problems-retrieving-z-values-tf4522698.html#a12916176
Sent from the GDAL - Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070927/0b1cbe79/attachment.html
More information about the Gdal-dev
mailing list