Skip to content

Commit

Permalink
fix spit plugin
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9168 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 25, 2008
1 parent cbf8dbd commit c05bfb5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/spit/qgsshapefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <QApplication>
#include <ogr_api.h>
#include <cpl_conv.h>
#include <string>
#include <fstream>
#include <cstdio>
Expand Down Expand Up @@ -406,14 +407,14 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_
.arg( QgsPgUtil::quotedIdentifier( table_name ) )
.arg( m );

int num = OGR_G_WkbSize( geom );
char * geo_temp = new char[num*3];
char *geo_temp;
// 'GeometryFromText' supports only 2D coordinates
// TODO for proper 2.5D support we would need to use 'GeomFromEWKT'
if ( hasMoreDimensions )
OGR_G_SetCoordinateDimension( geom, 2 );
OGR_G_ExportToWkt( geom, &geo_temp );
QString geometry( geo_temp );
CPLFree(geo_temp);

for ( uint n = 0; n < column_types.size(); n++ )
{
Expand Down Expand Up @@ -462,7 +463,6 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_

pro.setValue( pro.value() + 1 );
qApp->processEvents();
delete[] geo_temp;
}
OGR_F_Destroy( feat );
}
Expand Down

0 comments on commit c05bfb5

Please sign in to comment.