diff --git a/src/core/qgsdataprovider.h b/src/core/qgsdataprovider.h index 6c7b593704c..780724114bf 100644 --- a/src/core/qgsdataprovider.h +++ b/src/core/qgsdataprovider.h @@ -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; } diff --git a/src/core/qgsgeometry.cpp b/src/core/qgsgeometry.cpp index 0f9668a5d4d..1d27ebb0354 100644 --- a/src/core/qgsgeometry.cpp +++ b/src/core/qgsgeometry.cpp @@ -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);