[gdal-dev] 3D Shapefiles

Craig Miller craig.miller at spatialminds.com
Thu Sep 10 02:11:33 EDT 2009


I think you want wkbPoint25D instead of wkbPoint in the CreateLayer call.



> -----Original Message-----
> From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-
> bounces at lists.osgeo.org] On Behalf Of Opel Fahrer
> Sent: Wednesday, September 09, 2009 10:19 PM
> To: gdal-dev at lists.osgeo.org
> Subject: [gdal-dev] 3D Shapefiles
> 
> Hi,
> 
> I stumbled across an unexpected problem when I tried to write my own shapefile
> following the tutorial found here:
> 
> http://www.gdal.org/ogr/ogr_apitut.html
> 
> 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.
> 
> Regards
> 
> 
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list