40 if ( dynamic_cast<const QgsPolygonV2*>( geom ) )
48 return elemMultiPolygon;
56 if ( dynamic_cast<const QgsPolygonV2*>( geom ) )
64 return elemMultiSurface;
70 QString json =
"{\"type\": \"MultiPolygon\", \"coordinates\": [";
73 if ( dynamic_cast<const QgsPolygonV2*>( geom ) )
81 exteriorLineString->
points( exteriorPts );
83 delete exteriorLineString;
89 interiorLineString->
points( interiorPts );
91 delete interiorLineString;
111 if ( !dynamic_cast<QgsCurvePolygonV2*>( g ) )
const QgsCurveV2 * exteriorRing() const
QgsAbstractGeometryV2 * clone() const override
Clones the geometry by performing a deep copy.
QString asJSON(int precision=17) const override
Returns a GeoJSON representation of the geometry.
QDomNode appendChild(const QDomNode &newChild)
void points(QList< QgsPointV2 > &pt) const override
Returns a list of points within the curve.
bool fromWkt(const QString &wkt) override
Sets the geometry from a WKT string.
static QString pointsToJSON(const QList< QgsPointV2 > &points, int precision)
Returns a geoJSON coordinates string.
Abstract base class for all geometries.
QDomElement asGML2(QDomDocument &doc, int precision=17, const QString &ns="gml") const override
Returns a GML2 representation of the geometry.
QDomElement createElementNS(const QString &nsURI, const QString &qName)
virtual bool addGeometry(QgsAbstractGeometryV2 *g) override
Adds a geometry and takes ownership.
QDomElement asGML3(QDomDocument &doc, int precision=17, const QString &ns="gml") const override
Returns a GML3 representation of the geometry.
Line string geometry type.
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
void setZMTypeFromSubGeometry(const QgsAbstractGeometryV2 *subggeom, QgsWKBTypes::Type baseGeomType)
Updates the geometry type based on whether sub geometries contain z or m values.
virtual QDomElement asGML3(QDomDocument &doc, int precision=17, const QString &ns="gml") const =0
Returns a GML3 representation of the geometry.
bool fromCollectionWkt(const QString &wkt, const QList< QgsAbstractGeometryV2 * > &subtypes, const QString &defaultChildWkbType=QString())
Reads a collection from a WKT string.
const QgsCurveV2 * interiorRing(int i) const
QVector< QgsAbstractGeometryV2 * > mGeometries
virtual QgsLineStringV2 * curveToLine() const =0
Returns a new line string geometry corresponding to a segmentized approximation of the curve...
virtual bool addGeometry(QgsAbstractGeometryV2 *g)
Adds a geometry and takes ownership.
Multi polygon geometry collection.
virtual QDomElement asGML2(QDomDocument &doc, int precision=17, const QString &ns="gml") const =0
Returns a GML2 representation of the geometry.
int numInteriorRings() const