21 #include <QDomDocument>
28 #if defined(GEOS_VERSION_MAJOR) && (GEOS_VERSION_MAJOR<3)
29 #define GEOSGeometry struct GEOSGeom_t
30 #define GEOSCoordSequence struct GEOSCoordSeq_t
116 bool isEmpty()
const;
140 void fromGeos( GEOSGeometry* geos );
145 void fromWkb(
unsigned char * wkb,
size_t length );
152 const unsigned char* asWkb()
const;
158 size_t wkbSize()
const;
165 const GEOSGeometry* asGeos(
double precision = 0 )
const;
178 bool isMultipart()
const;
188 bool isGeosValid()
const;
193 bool isGeosEmpty()
const;
203 double length()
const;
214 QgsPoint closestVertex(
const QgsPoint& point,
int& atVertex,
int& beforeVertex,
int& afterVertex,
double& sqrDist )
const;
228 void adjacentVertices(
int atVertex,
int& beforeVertex,
int& afterVertex )
const;
241 bool insertVertex(
double x,
double y,
int beforeVertex );
249 bool moveVertex(
double x,
double y,
int atVertex );
257 bool moveVertex(
const QgsPointV2& p,
int atVertex );
269 bool deleteVertex(
int atVertex );
276 QgsPoint vertexAt(
int atVertex )
const;
283 double sqrDistToVertexAt(
QgsPoint& point,
int atVertex )
const;
291 double closestVertexWithContext(
const QgsPoint& point,
int& atVertex )
const;
337 int addPart( GEOSGeometry *newPart );
348 int translate(
double dx,
double dy );
364 int rotate(
double rotation,
const QgsPoint& center );
394 bool intersects(
const QgsGeometry* geometry )
const;
397 bool contains(
const QgsPoint* p )
const;
401 bool contains(
const QgsGeometry* geometry )
const;
405 bool disjoint(
const QgsGeometry* geometry )
const;
417 bool overlaps(
const QgsGeometry* geometry )
const;
429 QgsGeometry* buffer(
double distance,
int segments )
const;
440 QgsGeometry* buffer(
double distance,
int segments,
int endCapStyle,
int joinStyle,
double mitreLimit )
const;
447 QgsGeometry* offsetCurve(
double distance,
int segments,
int joinStyle,
double mitreLimit )
const;
486 QString exportToWkt(
const int &precision = 17 )
const;
494 QString exportToGeoJSON(
const int &precision = 17 )
const;
551 bool deleteRing(
int ringNum,
int partNum = 0 );
556 bool deletePart(
int partNum );
566 bool convertToMultiType();
577 bool convertToSingleType();
595 Error() : message(
"none" ), hasLocation( false ) {}
596 explicit Error(
const QString& m ) : message( m ), hasLocation( false ) {}
620 void convertToStraightSegment();
627 bool requiresConversionToStraightSegments()
const;
655 bool vertexIdFromVertexNr(
int nr,
QgsVertexId&
id )
const;
663 int vertexNrFromVertexId(
const QgsVertexId& i )
const;
669 static GEOSContextHandle_t getGEOSHandler();
707 static bool compare(
const QgsPolyline& p1,
const QgsPolyline& p2,
double epsilon = 4 * std::numeric_limits<double>::epsilon() );
717 static bool compare(
const QgsPolygon& p1,
const QgsPolygon& p2,
double epsilon = 4 * std::numeric_limits<double>::epsilon() );
739 QgsGeometry* smooth(
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
742 QgsPolygon smoothPolygon(
const QgsPolygon &polygon,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
744 QgsPolyline smoothLine(
const QgsPolyline &polyline,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
766 void detach(
bool cloneGeom =
true );
767 void removeWkbGeos();
773 QgsGeometry* convertToPoint(
bool destMultipart )
const;
775 QgsGeometry* convertToLine(
bool destMultipart )
const;
777 QgsGeometry* convertToPolygon(
bool destMultipart )
const;
A rectangle specified with double values.
QVector< QgsPoint > QgsPolyline
Polyline is represented as a vector of points.
Abstract base class for all geometries.
A geometry is the spatial representation of a feature.
WkbType
Used for symbology operations.
CORE_EXPORT QDataStream & operator<<(QDataStream &out, const QgsGeometry &geometry)
Writes the geometry to stream out.
Perform transforms between map coordinates and device coordinates.
Utility class for identifying a unique vertex within a geometry.
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
QVector< QgsPolygon > QgsMultiPolygon
A collection of QgsPolygons that share a common collection of attributes.
QVector< QgsPoint > QgsMultiPoint
A collection of QgsPoints that share a common collection of attributes.
QVector< QgsPolyline > QgsPolygon
Polygon: first item of the list is outer ring, inner rings (if any) start from second item...
A class to represent a point.
CORE_EXPORT QDataStream & operator>>(QDataStream &in, QgsGeometry &geometry)
Reads a geometry from stream in into geometry.
QVector< QgsPolyline > QgsMultiPolyline
A collection of QgsPolylines that share a common collection of attributes.
Contains geometry relation and modification algorithms.
double ANALYSIS_EXPORT leftOf(Point3D *thepoint, Point3D *p1, Point3D *p2)
Returns whether 'thepoint' is left or right of the line from 'p1' to 'p2'.
Abstract base class for curved geometry type.
Represents a vector layer which manages a vector based data sets.
Q_DECLARE_METATYPE(QgsGeometry)
Error(const QString &m, const QgsPoint &p)