21 #include <QDomDocument>
27 #if defined(GEOS_VERSION_MAJOR) && (GEOS_VERSION_MAJOR<3)
28 #define GEOSGeometry struct GEOSGeom_t
29 #define GEOSCoordSequence struct GEOSCoordSeq_t
115 bool isEmpty()
const;
139 void fromGeos( GEOSGeometry* geos );
144 void fromWkb(
unsigned char * wkb,
size_t length );
151 const unsigned char* asWkb()
const;
157 size_t wkbSize()
const;
163 const GEOSGeometry* asGeos()
const;
176 bool isMultipart()
const;
186 bool isGeosValid()
const;
191 bool isGeosEmpty()
const;
201 double length()
const;
212 QgsPoint closestVertex(
const QgsPoint& point,
int& atVertex,
int& beforeVertex,
int& afterVertex,
double& sqrDist )
const;
226 void adjacentVertices(
int atVertex,
int& beforeVertex,
int& afterVertex )
const;
239 bool insertVertex(
double x,
double y,
int beforeVertex );
247 bool moveVertex(
double x,
double y,
int atVertex );
255 bool moveVertex(
const QgsPointV2& p,
int atVertex );
267 bool deleteVertex(
int atVertex );
274 QgsPoint vertexAt(
int atVertex )
const;
281 double sqrDistToVertexAt(
QgsPoint& point,
int atVertex )
const;
289 double closestVertexWithContext(
const QgsPoint& point,
int& atVertex )
const;
328 int addPart( GEOSGeometry *newPart );
339 int translate(
double dx,
double dy );
355 int rotate(
double rotation,
const QgsPoint& center );
385 bool intersects(
const QgsGeometry* geometry )
const;
388 bool contains(
const QgsPoint* p )
const;
392 bool contains(
const QgsGeometry* geometry )
const;
396 bool disjoint(
const QgsGeometry* geometry )
const;
408 bool overlaps(
const QgsGeometry* geometry )
const;
420 QgsGeometry* buffer(
double distance,
int segments )
const;
431 QgsGeometry* buffer(
double distance,
int segments,
int endCapStyle,
int joinStyle,
double mitreLimit )
const;
438 QgsGeometry* offsetCurve(
double distance,
int segments,
int joinStyle,
double mitreLimit )
const;
477 QString exportToWkt(
const int &precision = 17 )
const;
485 QString exportToGeoJSON(
const int &precision = 17 )
const;
542 bool deleteRing(
int ringNum,
int partNum = 0 );
547 bool deletePart(
int partNum );
557 bool convertToMultiType();
575 Error() : message(
"none" ), hasLocation( false ) {}
600 void convertToStraightSegment();
607 bool requiresConversionToStraightSegments()
const;
635 bool vertexIdFromVertexNr(
int nr,
QgsVertexId&
id )
const;
643 int vertexNrFromVertexId(
const QgsVertexId& i )
const;
649 static GEOSContextHandle_t getGEOSHandler();
697 static bool compare(
const QgsPolygon& p1,
const QgsPolygon& p2,
double epsilon = 4 * DBL_EPSILON );
719 QgsGeometry* smooth(
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
722 QgsPolygon smoothPolygon(
const QgsPolygon &polygon,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
724 QgsPolyline smoothLine(
const QgsPolyline &polyline,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
734 void detach(
bool cloneGeom =
true );
735 void removeWkbGeos();
744 QgsGeometry* convertToPoint(
bool destMultipart )
const;
746 QgsGeometry* convertToLine(
bool destMultipart )
const;
748 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'.
int convexHull(int *id, const double *const x, const double *const y, int n)
Abstract base class for curved geometry type.
Represents a vector layer which manages a vector based data sets.
Q_DECLARE_METATYPE(QgsGeometry)
Error(QString m, QgsPoint p)