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 );
146 void fromWkb(
unsigned char *wkb,
int length );
153 const unsigned char* asWkb()
const;
166 const GEOSGeometry* asGeos(
double precision = 0 )
const;
179 bool isMultipart()
const;
189 bool isGeosValid()
const;
194 bool isGeosEmpty()
const;
204 double length()
const;
218 QgsPoint closestVertex(
const QgsPoint& point,
int& atVertex,
int& beforeVertex,
int& afterVertex,
double& sqrDist )
const;
232 void adjacentVertices(
int atVertex,
int& beforeVertex,
int& afterVertex )
const;
245 bool insertVertex(
double x,
double y,
int beforeVertex );
253 bool moveVertex(
double x,
double y,
int atVertex );
261 bool moveVertex(
const QgsPointV2& p,
int atVertex );
273 bool deleteVertex(
int atVertex );
280 QgsPoint vertexAt(
int atVertex )
const;
287 double sqrDistToVertexAt(
QgsPoint& point,
int atVertex )
const;
307 double closestVertexWithContext(
const QgsPoint& point,
int& atVertex )
const;
367 int addPart( GEOSGeometry *newPart );
379 int translate(
double dx,
double dy );
395 int rotate(
double rotation,
const QgsPoint& center );
428 bool intersects(
const QgsGeometry* geometry )
const;
431 bool contains(
const QgsPoint* p )
const;
435 bool contains(
const QgsGeometry* geometry )
const;
439 bool disjoint(
const QgsGeometry* geometry )
const;
451 bool overlaps(
const QgsGeometry* geometry )
const;
463 QgsGeometry* buffer(
double distance,
int segments )
const;
474 QgsGeometry* buffer(
double distance,
int segments,
int endCapStyle,
int joinStyle,
double mitreLimit )
const;
481 QgsGeometry* offsetCurve(
double distance,
int segments,
int joinStyle,
double mitreLimit )
const;
526 QString exportToWkt(
int precision = 17 )
const;
534 QString exportToGeoJSON(
int precision = 17 )
const;
594 bool deleteRing(
int ringNum,
int partNum = 0 );
599 bool deletePart(
int partNum );
609 bool convertToMultiType();
620 bool convertToSingleType();
638 Error() : message(
"none" ), hasLocation( false ) {}
639 explicit Error(
const QString& m ) : message( m ), hasLocation( false ) {}
663 void convertToStraightSegment();
670 bool requiresConversionToStraightSegments()
const;
698 bool vertexIdFromVertexNr(
int nr,
QgsVertexId&
id )
const;
712 static GEOSContextHandle_t getGEOSHandler();
750 static bool compare(
const QgsPolyline& p1,
const QgsPolyline& p2,
double epsilon = 4 * std::numeric_limits<double>::epsilon() );
760 static bool compare(
const QgsPolygon& p1,
const QgsPolygon& p2,
double epsilon = 4 * std::numeric_limits<double>::epsilon() );
782 QgsGeometry* smooth(
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
785 QgsPolygon smoothPolygon(
const QgsPolygon &polygon,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
787 QgsPolyline smoothLine(
const QgsPolyline &polyline,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
809 void detach(
bool cloneGeom =
true );
810 void removeWkbGeos();
816 QgsGeometry* convertToPoint(
bool destMultipart )
const;
818 QgsGeometry* convertToLine(
bool destMultipart )
const;
820 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.
Point geometry type, with support for z-dimension and m-values.
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.
Error(const QString &m, const QgsPoint &p)