[gdal-dev] 3D Shapefiles

Opel Fahrer opelfahrer79 at yahoo.de
Thu Sep 10 01:19:18 EDT 2009


I stumbled across an unexpected problem when I tried to write my own shapefile following the tutorial found here:


I want to store 3D coordinates, which should be possible I guess. However, it seems that doing something like

OGRLayer *poLayer = poDS->CreateLayer( "points", NULL, wkbPoint, NULL );
OGRFeature *poFeature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() );

OGRPoint pt(1, 2, 3);
poFeature->SetGeometry( &pt );
poLayer->CreateFeature( poFeature );

does NOT create a 3D feature, but flattens to 2D. Whatever I tried, I could not figure out how to get around this. 

Any help is appreciated. I built my gdal libraries from the latest stable sources 1.6.2.



More information about the gdal-dev mailing list