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;
227 QgsPoint closestVertex(
const QgsPoint& point,
int& atVertex,
int& beforeVertex,
int& afterVertex,
double& sqrDist )
const;
235 double distanceToVertex(
int vertex )
const;
244 double angleAtVertex(
int vertex )
const;
258 void adjacentVertices(
int atVertex,
int& beforeVertex,
int& afterVertex )
const;
271 bool insertVertex(
double x,
double y,
int beforeVertex );
279 bool moveVertex(
double x,
double y,
int atVertex );
287 bool moveVertex(
const QgsPointV2& p,
int atVertex );
299 bool deleteVertex(
int atVertex );
306 QgsPoint vertexAt(
int atVertex )
const;
313 double sqrDistToVertexAt(
QgsPoint& point,
int atVertex )
const;
333 double closestVertexWithContext(
const QgsPoint& point,
int& atVertex )
const;
393 int addPart( GEOSGeometry *newPart );
405 int translate(
double dx,
double dy );
421 int rotate(
double rotation,
const QgsPoint& center );
463 bool intersects(
const QgsGeometry* geometry )
const;
466 bool contains(
const QgsPoint* p )
const;
470 bool contains(
const QgsGeometry* geometry )
const;
474 bool disjoint(
const QgsGeometry* geometry )
const;
486 bool overlaps(
const QgsGeometry* geometry )
const;
498 QgsGeometry* buffer(
double distance,
int segments )
const;
509 QgsGeometry* buffer(
double distance,
int segments,
int endCapStyle,
int joinStyle,
double mitreLimit )
const;
516 QgsGeometry* offsetCurve(
double distance,
int segments,
int joinStyle,
double mitreLimit )
const;
550 double lineLocatePoint(
const QgsGeometry& point )
const;
560 double interpolateAngle(
double distance )
const;
593 QString exportToWkt(
int precision = 17 )
const;
601 QString exportToGeoJSON(
int precision = 17 )
const;
661 bool deleteRing(
int ringNum,
int partNum = 0 );
666 bool deletePart(
int partNum );
676 bool convertToMultiType();
687 bool convertToSingleType();
707 Error() : message(
"none" ), hasLocation( false ) {}
708 explicit Error(
const QString& m ) : message( m ), hasLocation( false ) {}
732 void convertToStraightSegment();
739 bool requiresConversionToStraightSegments()
const;
767 bool vertexIdFromVertexNr(
int nr,
QgsVertexId&
id )
const;
781 static GEOSContextHandle_t getGEOSHandler();
819 static bool compare(
const QgsPolyline& p1,
const QgsPolyline& p2,
double epsilon = 4 * std::numeric_limits<double>::epsilon() );
829 static bool compare(
const QgsPolygon& p1,
const QgsPolygon& p2,
double epsilon = 4 * std::numeric_limits<double>::epsilon() );
851 QgsGeometry* smooth(
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
854 QgsPolygon smoothPolygon(
const QgsPolygon &polygon,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
856 QgsPolyline smoothLine(
const QgsPolyline &polyline,
const unsigned int iterations = 1,
const double offset = 0.25 )
const;
884 void detach(
bool cloneGeom =
true );
885 void removeWkbGeos();
891 QgsGeometry* convertToPoint(
bool destMultipart )
const;
893 QgsGeometry* convertToLine(
bool destMultipart )
const;
895 QgsGeometry* convertToPolygon(
bool destMultipart )
const;
A rectangle specified with double values.
QVector< QgsPoint > QgsPolyline
Polyline is represented as a vector of points.
Q_DECLARE_METATYPE(QgsMimeDataUtils::UriList)
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.
QVariant fromValue(const T &value)
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)