137 QStringList coordinates = parts.second.split(
' ', QString::SkipEmptyParts );
138 if ( coordinates.
size() < 2 )
158 mX = coordinates[idx++].toDouble();
159 mY = coordinates[idx++].toDouble();
161 mZ = coordinates[idx++].toDouble();
163 mM = coordinates[idx++].toDouble();
170 int size =
sizeof( char ) +
sizeof( quint32 );
184 unsigned char* geomPtr =
new unsigned char[binarySize];
187 wkb << static_cast<quint32>(
wkbType() );
253 return "{\"type\": \"Point\", \"coordinates\": [" 265 mX = mY = mZ = mM = 0.;
306 Q_UNUSED( position );
324 Q_UNUSED( segmentPt );
325 Q_UNUSED( vertexAfter );
385 t.
map( mX, mY, &x, &y );
QString wktTypeStr() const
Returns the WKT type string of the geometry.
virtual bool fromWkb(QgsConstWkbPtr wkb) override
Sets the geometry from a WKB string.
bool operator==(const QgsPointV2 &pt) const
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)
static Type addZ(Type type)
Adds the z dimension to a WKB type and returns the new type.
static bool hasM(Type type)
Tests whether a WKB type contains m values.
Abstract base class for all geometries.
void draw(QPainter &p) const override
Draws the geometry using the specified QPainter.
QDomElement createElementNS(const QString &nsURI, const QString &qName)
double z() const
Returns the point's z-coordinate.
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
double y() const
Returns the point's y-coordinate.
static endian_t endian()
Returns whether this machine uses big or little endian.
virtual void clearCache() const
Clears any cached parameters associated with the geometry, eg bounding boxes.
virtual bool moveVertex(QgsVertexId position, const QgsPointV2 &newPos) override
Moves a vertex within the geometry.
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
bool nextVertex(QgsVertexId &id, QgsPointV2 &vertex) const override
Returns next vertex id and coordinates.
void drawRect(const QRectF &rectangle)
void append(const T &value)
static Type dropZ(Type type)
Drops the z dimension (if present) for a WKB type and returns the new type.
static Type addM(Type type)
Adds the m dimension to a WKB type and returns the new type.
QgsPointV2(double x=0.0, double y=0.0)
Construct a 2 dimensional point with an initial x and y coordinate.
Utility class for identifying a unique vertex within a geometry.
void setAttribute(const QString &name, const QString &value)
bool isMeasure() const
Returns true if the geometry contains m values.
void clear() override
Clears the geometry, ie reset it to a null geometry.
Point geometry type, with support for z-dimension and m-values.
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
virtual QgsAbstractGeometryV2 * boundary() const override
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
QgsWKBTypes::Type mWkbType
double x() const
Returns the point's x-coordinate.
virtual QgsPointV2 * clone() const override
Clones the geometry by performing a deep copy.
QPointF toQPointF() const
Returns the point as a QPointF.
virtual bool dropMValue() override
Drops any measure values which exist in the geometry.
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.
bool convertTo(QgsWKBTypes::Type type) override
Converts the geometry to a specified type.
A class to represent a point.
QList< QgsPointSequenceV2 > QgsRingSequenceV2
void transform(const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d=QgsCoordinateTransform::ForwardTransform, bool transformZ=false) override
Transforms the geometry using a coordinate transform.
QDomText createTextNode(const QString &value)
virtual bool addMValue(double mValue=0) override
Adds a measure to the geometry, initialized to a preset value.
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.
static Type dropM(Type type)
Drops the m dimension (if present) for a WKB type and returns the new type.
virtual bool addZValue(double zValue=0) override
Adds a z-dimension to the geometry, initialized to a preset value.
QString asWkt(int precision=17) const override
Returns a WKT representation of the geometry.
QgsWKBTypes::Type wkbType() const
Returns the WKB type 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.
static Type flatType(Type type)
Returns the flat type for a WKB type.
double ANALYSIS_EXPORT leftOf(Point3D *thepoint, Point3D *p1, Point3D *p2)
Returns whether 'thepoint' is left or right of the line from 'p1' to 'p2'.
QgsWKBTypes::Type readHeader() const
bool operator!=(const QgsPointV2 &pt) const
virtual bool dropZValue() override
Drops any z-dimensions which exist in the geometry.
virtual QgsCoordinateSequenceV2 coordinateSequence() const override
Retrieves the sequence of geometries, rings and nodes.
double m() const
Returns the point's m value.
int wkbSize() const override
Returns the size of the WKB representation of the geometry.
bool is3D() const
Returns true if the geometry is 3D and contains a z-value.
QList< QgsPointV2 > QgsPointSequenceV2