86 QStringList coordinates = parts.second.split(
" ", QString::SkipEmptyParts );
94 mX = coordinates[idx++].toDouble();
95 mY = coordinates[idx++].toDouble();
97 mZ = coordinates[idx++].toDouble();
99 mM = coordinates[idx++].toDouble();
106 int size =
sizeof( char ) +
sizeof( quint32 );
114 unsigned char* geomPtr =
new unsigned char[binarySize];
117 wkb << static_cast<quint32>(
wkbType() );
168 return "{\"type\": \"Point\", \"coordinates\": ["
181 mX = mY = mZ = mM = 0.;
194 coord.append( featureCoord );
199 Q_UNUSED( position );
216 Q_UNUSED( segmentPt ); Q_UNUSED( vertexAfter ); Q_UNUSED( leftOf ); Q_UNUSED( leftOf ); Q_UNUSED( epsilon );
246 t.
map( mX, mY, &x, &y );
249 t.
map( mX, mY, &mX, &mY );
QgsWKBTypes::Type wkbType() const
Returns the WKB type of the geometry.
A rectangle specified with double values.
static QPair< QgsWKBTypes::Type, QString > wktReadBlock(const QString &wkt)
Parses a WKT block of the format "TYPE( contents )" and returns a pair of geometry type to contents (...
QDomElement asGML3(QDomDocument &doc, int precision=17, const QString &ns="gml") const override
Returns a GML3 representation of the geometry.
QDomNode appendChild(const QDomNode &newChild)
Abstract base class for all geometries.
void draw(QPainter &p) const override
Draws the geometry using the specified QPainter.
bool operator==(const QgsPointV2 &pt) const
QDomElement createElementNS(const QString &nsURI, const QString &qName)
bool operator!=(const QgsPointV2 &pt) const
static endian_t endian()
Returns whether this machine uses big or little endian.
QString wktTypeStr() const
Returns the WKT type string of the geometry.
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
bool nextVertex(QgsVertexId &id, QgsPointV2 &vertex) const override
Returns next vertex id and coordinates.
QgsWKBTypes::Type readHeader() const
void drawRect(const QRectF &rectangle)
static Type flatType(Type type)
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.
virtual QString geometryType() const override
Returns a unique string representing the geometry type.
void append(const T &value)
QgsPointV2(double x=0.0, double y=0.0)
static double sqrDistance2D(const QgsPointV2 &pt1, const QgsPointV2 &pt2)
Returns the squared 2D distance between two points.
Utility class for identifying a unique vertex within a geometry.
bool isMeasure() const
Returns true if the geometry contains m values.
virtual QgsAbstractGeometryV2 * clone() const override
Clones the geometry by performing a deep copy.
void setAttribute(const QString &name, const QString &value)
void clear() override
Clears the geometry, ie reset it to a null geometry.
QgsWKBTypes::Type mWkbType
virtual void coordinateSequence(QList< QList< QList< QgsPointV2 > > > &coord) const override
Retrieves the sequence of geometries, rings and nodes.
QDomElement asGML2(QDomDocument &doc, int precision=17, const QString &ns="gml") const override
Returns a GML2 representation of the geometry.
virtual bool fromWkt(const QString &wkt) override
Sets the geometry from a WKT string.
QDomText createTextNode(const QString &value)
QString qgsDoubleToString(const double &a, const int &precision=17)
double closestSegment(const QgsPointV2 &pt, QgsPointV2 &segmentPt, QgsVertexId &vertexAfter, bool *leftOf, double epsilon) const override
Searches for the closest segment of the geometry to a given point.
QString asWkt(int precision=17) const override
Returns a WKT representation of the geometry.
unsigned char * asWkb(int &binarySize) const override
Returns a WKB representation of the geometry.
QString asJSON(int precision=17) const override
Returns a GeoJSON representation of the geometry.
virtual bool fromWkb(const unsigned char *wkb) override
Sets the geometry from a WKB string.
QgsRectangle mBoundingBox
static Type parseType(const QString &wktStr)
double ANALYSIS_EXPORT leftOf(Point3D *thepoint, Point3D *p1, Point3D *p2)
Returns whether 'thepoint' is left or right of the line from 'p1' to 'p2'.
void transform(const QgsCoordinateTransform &ct) override
Transforms the geometry using a coordinate transform.
virtual bool moveVertex(const QgsVertexId &position, const QgsPointV2 &newPos) override
Moves a vertex within the geometry.
int wkbSize() const override
Returns the size of the WKB representation of the geometry.