Skip to content
Permalink
Browse files
fixed a bug in QgsGeometry wkt export and made QgsDataProvider::endia…
…n() const

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5732 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Aug 24, 2006
1 parent dedc298 commit fc430d4c8ec8187b5ea504c420a1637da53f4191
Showing with 11 additions and 4 deletions.
  1. +1 −1 src/core/qgsdataprovider.h
  2. +10 −3 src/core/qgsgeometry.cpp
@@ -153,7 +153,7 @@ class QgsDataProvider : public QObject
data as stored persistently instead of local hardware architecture
endian-ness.
*/
virtual endian_t endian()
virtual endian_t endian() const
{
return (htonl(1) == 1) ? XDR : NDR;
}
@@ -18,6 +18,7 @@ email : morb at ozemail dot com dot au

#include "qgis.h"
#include "qgsgeometry.h"
#include "qgslogger.h"


// Set up static GEOS geometry factory
@@ -2106,9 +2107,7 @@ bool QgsGeometry::contains(QgsPoint* p) const

bool QgsGeometry::exportToWkt(unsigned char * geom) const
{
#ifdef QGISDEBUG
std::cout << "QgsGeometry::exportToWkt: entered." << std::endl;
#endif
QgsDebugMsg("QgsGeometry::exportToWkt: entered");

if(geom)
{
@@ -2133,6 +2132,7 @@ bool QgsGeometry::exportToWkt(unsigned char * geom) const
}
case QGis::WKBLineString:
{
QgsDebugMsg("QgsGeometry::exportToWkt: LINESTRING found");
unsigned char *ptr;
int *nPoints;
int idx;
@@ -2161,6 +2161,7 @@ bool QgsGeometry::exportToWkt(unsigned char * geom) const
}
case QGis::WKBPolygon:
{
QgsDebugMsg("QgsGeometry::exportToWkt: POLYGON found");
unsigned char *ptr;
int idx, jdx;
int *numRings, *nPoints;
@@ -2240,6 +2241,7 @@ bool QgsGeometry::exportToWkt(unsigned char * geom) const

case QGis::WKBMultiLineString:
{
QgsDebugMsg("QgsGeometry::exportToWkt: MULTILINESTRING found");
unsigned char *ptr;
int idx, jdx, numLineStrings;
int *nPoints;
@@ -2279,6 +2281,7 @@ bool QgsGeometry::exportToWkt(unsigned char * geom) const

case QGis::WKBMultiPolygon:
{
QgsDebugMsg("QgsGeometry::exportToWkt: MULTIPOLYGON found");
unsigned char *ptr;
int idx, jdx, kdx;
int *numPolygons, *numRings, *nPoints;
@@ -2308,6 +2311,10 @@ bool QgsGeometry::exportToWkt(unsigned char * geom) const
ptr += 4;
for (jdx = 0; jdx < *nPoints; jdx++)
{
if(jdx!=0)
{
mWkt+=",";
}
x = (double *) ptr;
mWkt+=QString::number(*x,'f',6);
ptr += sizeof(double);

0 comments on commit fc430d4

Please sign in to comment.