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


> -----Original Message-----
> From: [email protected] [mailto:gdal-dev-
> [email protected]] On Behalf Of Opel Fahrer
> Sent: Wednesday, September 09, 2009 10:19 PM
> To: [email protected]
> 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
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to