Skip to content
Permalink
Browse files

Merge pull request #2302 from manisandro/geometry_plugins

Geometry Checker and Geometry Snapper plugins
  • Loading branch information
mhugent committed Sep 25, 2015
2 parents e655c26 + 2ea4ee9 commit 8cec2c935f5541a865d0bf91140ca5b2d25b17cb
Showing with 10,474 additions and 329 deletions.
  1. +1 −1 ci/travis/linux/before_install.sh
  2. +13 −1 cmake/FindGEOS.cmake
  3. +16 −2 python/core/geometry/qgsabstractgeometryv2.sip
  4. +1 −1 python/core/geometry/qgscircularstringv2.sip
  5. +1 −1 python/core/geometry/qgscompoundcurvev2.sip
  6. +7 −4 python/core/geometry/qgscurvepolygonv2.sip
  7. +5 −0 python/core/geometry/qgscurvev2.sip
  8. +1 −1 python/core/geometry/qgsgeometry.sip
  9. +7 −0 python/core/geometry/qgsgeometrycollectionv2.sip
  10. +27 −26 python/core/geometry/qgsgeometryengine.sip
  11. +1 −1 python/core/geometry/qgslinestringv2.sip
  12. +1 −1 python/core/geometry/qgsmulticurvev2.sip
  13. +1 −1 python/core/geometry/qgsmultilinestringv2.sip
  14. +1 −1 python/core/geometry/qgsmultipointv2.sip
  15. +1 −1 python/core/geometry/qgsmultipolygonv2.sip
  16. +1 −1 python/core/geometry/qgsmultisurfacev2.sip
  17. +7 −1 python/core/geometry/qgspointv2.sip
  18. +1 −1 python/core/geometry/qgspolygonv2.sip
  19. +0 −1 python/core/geometry/qgssurfacev2.sip
  20. +7 −0 python/core/qgsmapsettings.sip
  21. +4 −0 python/core/qgsrectangle.sip
  22. +1 −1 python/gui/qgisinterface.sip
  23. +4 −1 src/app/qgisappinterface.cpp
  24. +1 −1 src/app/qgisappinterface.h
  25. +9 −0 src/core/CMakeLists.txt
  26. +49 −22 src/core/geometry/qgsabstractgeometryv2.cpp
  27. +63 −37 src/core/geometry/qgsabstractgeometryv2.h
  28. +1 −1 src/core/geometry/qgscircularstringv2.cpp
  29. +1 −1 src/core/geometry/qgscircularstringv2.h
  30. +1 −1 src/core/geometry/qgscompoundcurvev2.cpp
  31. +1 −1 src/core/geometry/qgscompoundcurvev2.h
  32. +13 −8 src/core/geometry/qgscurvepolygonv2.cpp
  33. +8 −4 src/core/geometry/qgscurvepolygonv2.h
  34. +8 −0 src/core/geometry/qgscurvev2.cpp
  35. +5 −0 src/core/geometry/qgscurvev2.h
  36. +1 −1 src/core/geometry/qgsgeometry.cpp
  37. +5 −4 src/core/geometry/qgsgeometry.h
  38. +2 −1 src/core/geometry/qgsgeometrycollectionv2.cpp
  39. +7 −1 src/core/geometry/qgsgeometrycollectionv2.h
  40. +1 −6 src/core/geometry/qgsgeometryeditutils.cpp
  41. +30 −29 src/core/geometry/qgsgeometryengine.h
  42. +83 −0 src/core/geometry/qgsgeometryutils.cpp
  43. +56 −0 src/core/geometry/qgsgeometryutils.h
  44. +173 −104 src/core/geometry/qgsgeos.cpp
  45. +51 −37 src/core/geometry/qgsgeos.h
  46. +1 −1 src/core/geometry/qgslinestringv2.cpp
  47. +1 −1 src/core/geometry/qgslinestringv2.h
  48. +1 −1 src/core/geometry/qgsmulticurvev2.cpp
  49. +1 −1 src/core/geometry/qgsmulticurvev2.h
  50. +1 −1 src/core/geometry/qgsmultilinestringv2.cpp
  51. +1 −1 src/core/geometry/qgsmultilinestringv2.h
  52. +1 −1 src/core/geometry/qgsmultipointv2.cpp
  53. +1 −1 src/core/geometry/qgsmultipointv2.h
  54. +1 −1 src/core/geometry/qgsmultipolygonv2.cpp
  55. +1 −1 src/core/geometry/qgsmultipolygonv2.h
  56. +1 −1 src/core/geometry/qgsmultisurfacev2.cpp
  57. +1 −1 src/core/geometry/qgsmultisurfacev2.h
  58. +6 −1 src/core/geometry/qgspointv2.cpp
  59. +7 −1 src/core/geometry/qgspointv2.h
  60. +1 −1 src/core/geometry/qgspolygonv2.cpp
  61. +1 −1 src/core/geometry/qgspolygonv2.h
  62. +0 −1 src/core/geometry/qgssurfacev2.h
  63. +60 −0 src/core/geosextra/geos_c_extra.cpp
  64. +40 −0 src/core/geosextra/geos_c_extra.h
  65. +61 −0 src/core/geosextra/geos_extra/geos_c_extra.cpp
  66. +40 −0 src/core/geosextra/geos_extra/geos_c_extra.h
  67. +13 −0 src/core/qgsmapsettings.cpp
  68. +7 −0 src/core/qgsmapsettings.h
  69. +20 −0 src/core/qgsrectangle.cpp
  70. +4 −0 src/core/qgsrectangle.h
  71. +1 −1 src/gui/qgisinterface.h
  72. +2 −0 src/plugins/CMakeLists.txt
  73. +106 −0 src/plugins/geometry_checker/CMakeLists.txt
  74. +132 −0 src/plugins/geometry_checker/checks/qgsgeometryanglecheck.cpp
  75. +30 −0 src/plugins/geometry_checker/checks/qgsgeometryanglecheck.h
  76. +216 −0 src/plugins/geometry_checker/checks/qgsgeometryareacheck.cpp
  77. +37 −0 src/plugins/geometry_checker/checks/qgsgeometryareacheck.h
  78. +208 −0 src/plugins/geometry_checker/checks/qgsgeometrycheck.cpp
  79. +153 −0 src/plugins/geometry_checker/checks/qgsgeometrycheck.h
  80. +100 −0 src/plugins/geometry_checker/checks/qgsgeometrycontainedcheck.cpp
  81. +52 −0 src/plugins/geometry_checker/checks/qgsgeometrycontainedcheck.h
  82. +81 −0 src/plugins/geometry_checker/checks/qgsgeometrydegeneratepolygoncheck.cpp
  83. +30 −0 src/plugins/geometry_checker/checks/qgsgeometrydegeneratepolygoncheck.h
  84. +111 −0 src/plugins/geometry_checker/checks/qgsgeometryduplicatecheck.cpp
  85. +62 −0 src/plugins/geometry_checker/checks/qgsgeometryduplicatecheck.h
  86. +105 −0 src/plugins/geometry_checker/checks/qgsgeometryduplicatenodescheck.cpp
  87. +30 −0 src/plugins/geometry_checker/checks/qgsgeometryduplicatenodescheck.h
  88. +209 −0 src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp
  89. +96 −0 src/plugins/geometry_checker/checks/qgsgeometrygapcheck.h
  90. +73 −0 src/plugins/geometry_checker/checks/qgsgeometryholecheck.cpp
  91. +29 −0 src/plugins/geometry_checker/checks/qgsgeometryholecheck.h
  92. +80 −0 src/plugins/geometry_checker/checks/qgsgeometrymultipartcheck.cpp
  93. +29 −0 src/plugins/geometry_checker/checks/qgsgeometrymultipartcheck.h
  94. +192 −0 src/plugins/geometry_checker/checks/qgsgeometryoverlapcheck.cpp
  95. +63 −0 src/plugins/geometry_checker/checks/qgsgeometryoverlapcheck.h
  96. +95 −0 src/plugins/geometry_checker/checks/qgsgeometrysegmentlengthcheck.cpp
  97. +30 −0 src/plugins/geometry_checker/checks/qgsgeometrysegmentlengthcheck.h
  98. +315 −0 src/plugins/geometry_checker/checks/qgsgeometryselfintersectioncheck.cpp
  99. +54 −0 src/plugins/geometry_checker/checks/qgsgeometryselfintersectioncheck.h
  100. +41 −0 src/plugins/geometry_checker/checks/qgsgeometrysliverpolygoncheck.h
  101. +154 −0 src/plugins/geometry_checker/checks/qgsgeometrytypecheck.cpp
  102. +54 −0 src/plugins/geometry_checker/checks/qgsgeometrytypecheck.h
  103. BIN src/plugins/geometry_checker/icons/geometrychecker.png
  104. +115 −0 src/plugins/geometry_checker/icons/geometrychecker.svg
  105. BIN src/plugins/geometry_checker/icons/tooltip.png
  106. +6 −0 src/plugins/geometry_checker/pluginres.qrc
  107. +252 −0 src/plugins/geometry_checker/qgsgeometrychecker.cpp
  108. +76 −0 src/plugins/geometry_checker/qgsgeometrychecker.h
  109. +43 −0 src/plugins/geometry_checker/qgsgeometrycheckerplugin.cpp
  110. +113 −0 src/plugins/geometry_checker/qgsgeometrycheckerplugin.h
  111. +475 −0 src/plugins/geometry_checker/qgsgeometrycheckfactory.cpp
  112. +71 −0 src/plugins/geometry_checker/qgsgeometrycheckfactory.h
  113. +87 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerdialog.cpp
  114. +48 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerdialog.h
  115. +131 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerfixsummarydialog.cpp
  116. +61 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerfixsummarydialog.h
  117. +329 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerfixsummarydialog.ui
  118. +592 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.cpp
  119. +77 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.h
  120. +392 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.ui
  121. +322 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.cpp
  122. +58 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.h
  123. +703 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.ui
  124. +184 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckfixdialog.cpp
  125. +61 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckfixdialog.h
  126. +127 −0 src/plugins/geometry_checker/utils/qgsfeaturepool.cpp
  127. +66 −0 src/plugins/geometry_checker/utils/qgsfeaturepool.h
  128. +112 −0 src/plugins/geometry_checker/utils/qgsgeomutils.cpp
  129. +68 −0 src/plugins/geometry_checker/utils/qgsgeomutils.h
  130. +63 −0 src/plugins/geometry_snapper/CMakeLists.txt
  131. BIN src/plugins/geometry_snapper/icons/geometrysnapper.png
  132. +257 −0 src/plugins/geometry_snapper/icons/geometrysnapper.svg
  133. +5 −0 src/plugins/geometry_snapper/pluginres.qrc
  134. +250 −0 src/plugins/geometry_snapper/qgsgeometrysnapper.cpp
  135. +65 −0 src/plugins/geometry_snapper/qgsgeometrysnapper.h
  136. +309 −0 src/plugins/geometry_snapper/qgsgeometrysnapperdialog.cpp
  137. +53 −0 src/plugins/geometry_snapper/qgsgeometrysnapperdialog.h
  138. +41 −0 src/plugins/geometry_snapper/qgsgeometrysnapperplugin.cpp
  139. +112 −0 src/plugins/geometry_snapper/qgsgeometrysnapperplugin.h
  140. +423 −0 src/plugins/geometry_snapper/qgssnapindex.cpp
  141. +106 −0 src/plugins/geometry_snapper/qgssnapindex.h
  142. +299 −0 src/plugins/geometry_snapper/ui/qgsgeometrysnapperdialog.ui
  143. +2 −2 src/providers/CMakeLists.txt
  144. +0 −2 tests/src/core/testqgsexpression.cpp
@@ -8,7 +8,7 @@ sudo apt-get update -qq
sudo apt-get install --force-yes --no-install-recommends --no-install-suggests \
bison cmake cmake-data doxygen flex git graphviz \
grass-dev grass7-dev libexpat1-dev libfcgi-dev \
libgdal1-dev libgeos-dev libgsl0-dev libpq-dev \
libgdal1-dev libgeos-dev libgeos++-dev libgsl0-dev libpq-dev \
libproj-dev libqscintilla2-dev libqt4-dev \
libqt4-opengl-dev libqt4-sql-sqlite libqtwebkit-dev \
libqwt-dev libspatialindex-dev libspatialite-dev \
@@ -23,11 +23,16 @@ IF(WIN32)
IF (MINGW)
FIND_PATH(GEOS_INCLUDE_DIR geos_c.h /usr/local/include /usr/include c:/msys/local/include)
FIND_LIBRARY(GEOS_LIBRARY NAMES geos_c PATHS /usr/local/lib /usr/lib c:/msys/local/lib)
FIND_LIBRARY(GEOS_CPP_LIBRARY NAMES geos PATHS /usr/local/lib /usr/lib c:/msys/local/lib)
ENDIF (MINGW)

IF (MSVC)
FIND_PATH(GEOS_INCLUDE_DIR geos_c.h $ENV{LIB_DIR}/include $ENV{INCLUDE})
FIND_LIBRARY(GEOS_LIBRARY NAMES geos geos_c_i geos_c PATHS
FIND_LIBRARY(GEOS_LIBRARY NAMES geos_c_i geos_c PATHS
"$ENV{LIB_DIR}/lib"
$ENV{LIB}
)
FIND_LIBRARY(GEOS_CPP_LIBRARY NAMES geos PATHS
"$ENV{LIB_DIR}/lib"
$ENV{LIB}
)
@@ -67,6 +72,7 @@ ELSE(WIN32)

IF(CYGWIN)
FIND_LIBRARY(GEOS_LIBRARY NAMES geos_c PATHS /usr/lib /usr/local/lib)
FIND_LIBRARY(GEOS_CPP_LIBRARY NAMES geos PATHS /usr/lib /usr/local/lib)
ENDIF(CYGWIN)

IF (NOT GEOS_INCLUDE_DIR OR NOT GEOS_LIBRARY OR NOT GEOS_CONFIG)
@@ -132,12 +138,16 @@ ELSE(WIN32)
#MESSAGE("DBG GEOS_CONFIG_LIBS=${GEOS_CONFIG_LIBS}")
#MESSAGE("DBG GEOS_LIB_NAME_WITH_PREFIX=${GEOS_LIB_NAME_WITH_PREFIX}")
SET(GEOS_LIB_NAME_WITH_PREFIX -lgeos_c CACHE STRING INTERNAL)
SET(GEOS_CPP_LIB_NAME_WITH_PREFIX -lgeos CACHE STRING INTERNAL)

## remove prefix -l because we need the pure name

IF (GEOS_LIB_NAME_WITH_PREFIX)
STRING(REGEX REPLACE "[-][l]" "" GEOS_LIB_NAME ${GEOS_LIB_NAME_WITH_PREFIX} )
ENDIF (GEOS_LIB_NAME_WITH_PREFIX)
IF (GEOS_CPP_LIB_NAME_WITH_PREFIX)
STRING(REGEX REPLACE "[-][l]" "" GEOS_CPP_LIB_NAME ${GEOS_CPP_LIB_NAME_WITH_PREFIX} )
ENDIF (GEOS_CPP_LIB_NAME_WITH_PREFIX)
#MESSAGE("DBG GEOS_LIB_NAME=${GEOS_LIB_NAME}")

IF (APPLE)
@@ -146,9 +156,11 @@ ELSE(WIN32)
# while still preserving user setting if given
# ***FIXME*** need to improve framework check so below not needed
SET(GEOS_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.dylib CACHE STRING INTERNAL FORCE)
SET(GEOS_CPP_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_CPP_LIB_NAME}.dylib CACHE STRING INTERNAL FORCE)
ENDIF (NOT GEOS_LIBRARY)
ELSE (APPLE)
SET(GEOS_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.so CACHE STRING INTERNAL)
SET(GEOS_CPP_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_CPP_LIB_NAME}.so CACHE STRING INTERNAL)
ENDIF (APPLE)
#MESSAGE("DBG GEOS_LIBRARY=${GEOS_LIBRARY}")

@@ -11,9 +11,16 @@ struct QgsVertexId
};

QgsVertexId();
QgsVertexId( int _part, int _ring, int _vertex, VertexType _type );
QgsVertexId( int _part, int _ring, int _vertex, VertexType _type);

bool isValid() const;
bool operator==( const QgsVertexId& other ) const;
bool operator!=( const QgsVertexId& other ) const;
bool partEqual( const QgsVertexId& o ) const;
bool ringEqual( const QgsVertexId& o ) const;
bool vertexEqual( const QgsVertexId& o ) const;
bool isValid(const QgsAbstractGeometryV2* geom) const;

int part;
int ring;
int vertex;
@@ -101,7 +108,7 @@ class QgsAbstractGeometryV2

virtual void coordinateSequence( QList< QList< QList< QgsPointV2 > > >& coord /Out/ ) const = 0;
int nCoordinates() const;
QgsPointV2 vertexAt( const QgsVertexId& id ) const;
virtual QgsPointV2 vertexAt( const QgsVertexId& id ) const = 0;
virtual double closestSegment( const QgsPointV2& pt, QgsPointV2& segmentPt, QgsVertexId& vertexAfter, bool* leftOf, double epsilon ) const = 0;

//low-level editing
@@ -113,11 +120,18 @@ class QgsAbstractGeometryV2
virtual double length() const;
virtual double area() const;

/** Returns the centroid of the geometry*/
virtual QgsPointV2 centroid() const;

virtual bool hasCurvedSegments() const;
/** Returns a geometry without curves. Caller takes ownership*/
virtual QgsAbstractGeometryV2* segmentize() const /Factory/;

/** Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
@return rotation in radians, clockwise from north*/
virtual double vertexAngle( const QgsVertexId& vertex ) const = 0;

virtual int vertexCount(int part = 0, int ring = 0) const = 0;
virtual int ringCount(int part = 0) const = 0;
virtual int partCount() const = 0;
};
@@ -10,7 +10,7 @@ class QgsCircularStringV2: public QgsCurveV2

virtual QString geometryType() const;
virtual int dimension() const;
virtual QgsAbstractGeometryV2* clone() const;
virtual QgsCircularStringV2* clone() const;
virtual void clear();

virtual QgsRectangle calculateBoundingBox() const;
@@ -12,7 +12,7 @@ class QgsCompoundCurveV2: public QgsCurveV2

virtual QString geometryType() const;
virtual int dimension() const;
virtual QgsAbstractGeometryV2* clone() const;
virtual QgsCompoundCurveV2* clone() const;
virtual void clear();

virtual QgsRectangle calculateBoundingBox() const;
@@ -12,7 +12,7 @@ class QgsCurvePolygonV2: public QgsSurfaceV2

virtual QString geometryType() const;
virtual int dimension() const;
virtual QgsAbstractGeometryV2* clone() const;
virtual QgsCurvePolygonV2* clone() const;
void clear();


@@ -30,14 +30,13 @@ class QgsCurvePolygonV2: public QgsSurfaceV2
//surface interface
virtual double area() const;
virtual double length() const;
QgsPointV2 centroid() const;
QgsPointV2 pointOnSurface() const;
QgsPolygonV2* surfaceToPolygon() const;

//curve polygon interface
int numInteriorRings() const;
const QgsCurveV2* exteriorRing() const;
const QgsCurveV2* interiorRing( int i ) const;
QgsCurveV2* exteriorRing() const;
QgsCurveV2* interiorRing( int i ) const;
virtual QgsPolygonV2* toPolygon() const;

/** Sets exterior ring (takes ownership)*/
@@ -67,4 +66,8 @@ class QgsCurvePolygonV2: public QgsSurfaceV2
@param vertex the vertex id
@return rotation in radians, clockwise from north*/
double vertexAngle( const QgsVertexId& vertex ) const;

virtual int vertexCount(int part = 0, int ring = 0) const;
virtual int ringCount(int part = 0) const;
virtual int partCount() const;
};
@@ -26,4 +26,9 @@ class QgsCurveV2: public QgsAbstractGeometryV2

/** Returns a geometry without curves. Caller takes ownership*/
QgsAbstractGeometryV2* segmentize() const /Factory/;

virtual int vertexCount(int part = 0, int ring = 0) const;
virtual int ringCount(int part = 0) const;
virtual int partCount() const;
virtual QgsPointV2 vertexAt( const QgsVertexId& id ) const;
};
@@ -56,7 +56,7 @@ class QgsGeometry
* @note added in QGIS 2.10
* @see setGeometry
*/
const QgsAbstractGeometryV2* geometry() const;
QgsAbstractGeometryV2* geometry() const;

/** Sets the underlying geometry store. Ownership of geometry is transferred.
* @note added in QGIS 2.10
@@ -10,6 +10,8 @@ class QgsGeometryCollectionV2: public QgsAbstractGeometryV2
//QgsGeometryCollectionV2& operator=( const QgsGeometryCollectionV2& c );
virtual ~QgsGeometryCollectionV2();

virtual QgsGeometryCollectionV2* clone() const;

int numGeometries() const;
//const QgsAbstractGeometryV2* geometryN( int n ) const;
QgsAbstractGeometryV2* geometryN( int n );
@@ -63,4 +65,9 @@ class QgsGeometryCollectionV2: public QgsAbstractGeometryV2
@param vertex the vertex id
@return rotation in radians, clockwise from north*/
double vertexAngle( const QgsVertexId& vertex ) const;

virtual int vertexCount(int part = 0, int ring = 0) const;
virtual int ringCount(int part = 0) const;
virtual int partCount() const;
virtual QgsPointV2 vertexAt( const QgsVertexId& id ) const;
};
@@ -11,31 +11,32 @@ class QgsGeometryEngine
virtual void geometryChanged() = 0;
virtual void prepareGeometry() = 0;

virtual QgsAbstractGeometryV2* intersection( const QgsAbstractGeometryV2& geom ) const = 0;
virtual QgsAbstractGeometryV2* difference( const QgsAbstractGeometryV2& geom ) const = 0;
virtual QgsAbstractGeometryV2* combine( const QgsAbstractGeometryV2& geom ) const = 0;
virtual QgsAbstractGeometryV2* combine( const QList< const QgsAbstractGeometryV2* > ) const = 0;
virtual QgsAbstractGeometryV2* symDifference( const QgsAbstractGeometryV2& geom ) const = 0;
virtual QgsAbstractGeometryV2* buffer( double distance, int segments ) const = 0;
virtual QgsAbstractGeometryV2* buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit ) const = 0;
virtual QgsAbstractGeometryV2* simplify( double tolerance ) const = 0;
virtual QgsAbstractGeometryV2* interpolate( double distance ) const = 0;
virtual bool centroid( QgsPointV2& pt ) const = 0;
virtual bool pointOnSurface( QgsPointV2& pt ) const = 0;
virtual QgsAbstractGeometryV2* convexHull() const = 0;
virtual double distance( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool intersects( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool touches( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool crosses( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool within( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool overlaps( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool contains( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool disjoint( const QgsAbstractGeometryV2& geom ) const = 0;
virtual double area() const = 0;
virtual double length() const = 0;
virtual bool isValid() const = 0;
virtual bool isEqual( const QgsAbstractGeometryV2& geom ) const = 0;
virtual bool isEmpty() const = 0;
virtual QgsAbstractGeometryV2* intersection( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* difference( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* combine( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* combine( const QList< const QgsAbstractGeometryV2* >, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* symDifference( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* buffer( double distance, int segments, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* simplify( double tolerance, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* interpolate( double distance, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* envelope( QString* errorMsg = 0 ) const = 0;
virtual bool centroid( QgsPointV2& pt, QString* errorMsg = 0 ) const = 0;
virtual bool pointOnSurface( QgsPointV2& pt, QString* errorMsg = 0 ) const = 0;
virtual QgsAbstractGeometryV2* convexHull( QString* errorMsg = 0 ) const = 0;
virtual double distance( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool intersects( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool touches( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool crosses( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool within( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool overlaps( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool contains( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool disjoint( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual double area( QString* errorMsg = 0 ) const = 0;
virtual double length( QString* errorMsg = 0 ) const = 0;
virtual bool isValid( QString* errorMsg = 0 ) const = 0;
virtual bool isEqual( const QgsAbstractGeometryV2& geom, QString* errorMsg = 0 ) const = 0;
virtual bool isEmpty( QString* errorMsg = 0 ) const = 0;

virtual QgsAbstractGeometryV2* offsetCurve( double distance, int segments, int joinStyle, double mitreLimit ) const = 0;
virtual QgsAbstractGeometryV2* offsetCurve( double distance, int segments, int joinStyle, double mitreLimit, QString* errorMsg = 0 ) const = 0;
};
@@ -10,7 +10,7 @@ class QgsLineStringV2: public QgsCurveV2

virtual QString geometryType() const;
virtual int dimension() const;
virtual QgsAbstractGeometryV2* clone() const;
virtual QgsLineStringV2* clone() const;
virtual void clear();

virtual bool fromWkb( const unsigned char* wkb );
@@ -6,7 +6,7 @@ class QgsMultiCurveV2: public QgsGeometryCollectionV2

public:
virtual QString geometryType() const;
QgsAbstractGeometryV2* clone() const;
virtual QgsMultiCurveV2* clone() const;

bool fromWkt( const QString& wkt );

@@ -6,7 +6,7 @@ class QgsMultiLineStringV2: public QgsMultiCurveV2

public:
virtual QString geometryType() const;
QgsAbstractGeometryV2* clone() const;
virtual QgsMultiLineStringV2* clone() const;

bool fromWkt( const QString& wkt );

@@ -5,7 +5,7 @@ class QgsMultiPointV2: public QgsGeometryCollectionV2
%End
public:
virtual QString geometryType() const;
QgsAbstractGeometryV2* clone() const;
virtual QgsMultiPointV2* clone() const;

bool fromWkt( const QString& wkt );

@@ -5,7 +5,7 @@ class QgsMultiPolygonV2: public QgsMultiSurfaceV2
%End
public:
virtual QString geometryType() const;
QgsAbstractGeometryV2* clone() const;
virtual QgsMultiPolygonV2* clone() const;

bool fromWkt( const QString& wkt );

@@ -5,7 +5,7 @@ class QgsMultiSurfaceV2: public QgsGeometryCollectionV2
%End
public:
virtual QString geometryType() const;
QgsAbstractGeometryV2* clone() const;
virtual QgsMultiSurfaceV2* clone() const;

bool fromWkt( const QString& wkt );

@@ -6,12 +6,13 @@ class QgsPointV2: public QgsAbstractGeometryV2

public:
QgsPointV2( double x = 0.0, double y = 0.0 );
QgsPointV2( const QgsPoint& p );
QgsPointV2( QgsWKBTypes::Type type, double x = 0.0, double y = 0.0, double z = 0.0, double m = 0.0 );

bool operator==( const QgsPointV2& pt ) const;
bool operator!=( const QgsPointV2& pt ) const;

virtual QgsAbstractGeometryV2* clone() const;
virtual QgsPointV2* clone() const;
void clear();

double x() const;
@@ -60,4 +61,9 @@ class QgsPointV2: public QgsAbstractGeometryV2
@param vertex the vertex id
@return 0.0*/
double vertexAngle( const QgsVertexId& vertex ) const;

virtual int vertexCount(int part = 0, int ring = 0) const;
virtual int ringCount(int part = 0) const;
virtual int partCount() const;
virtual QgsPointV2 vertexAt( const QgsVertexId& id ) const;
};
@@ -6,7 +6,7 @@ class QgsPolygonV2: public QgsCurvePolygonV2

public:
virtual QString geometryType() const;
virtual QgsAbstractGeometryV2* clone() const;
virtual QgsPolygonV2* clone() const;

virtual bool fromWkb( const unsigned char* wkb );
// inherited: bool fromWkt( const QString &wkt );
@@ -5,7 +5,6 @@ class QgsSurfaceV2: public QgsAbstractGeometryV2
%End

public:
virtual QgsPointV2 centroid() const = 0;
virtual QgsPointV2 pointOnSurface() const = 0;
virtual QgsPolygonV2* surfaceToPolygon() const = 0;
};
@@ -139,6 +139,13 @@ class QgsMapSettings

const QgsMapToPixel& mapToPixel() const;

/** Computes an *estimated* conversion factor between layer and map units: layerUnits * layerToMapUnits = mapUnits
* @param theLayer The layer
* @param referenceExtent A reference extent based on which to perform the computation. If not specified, the layer extent is used
* @note added in QGIS 2.12
*/
double layerToMapUnits( QgsMapLayer* theLayer, const QgsRectangle& referenceExtent = QgsRectangle() ) const;

/**
* @brief transform bounding box from layer's CRS to output CRS
* @see layerToMapCoordinates( QgsMapLayer* theLayer, QgsRectangle rect ) if you want to transform a rectangle
@@ -58,6 +58,10 @@ class QgsRectangle
//! Scale the rectangle around its center point
void scale( double scaleFactor, const QgsPoint *c = 0 );
void scale( double scaleFactor, double centerX, double centerY );
//! Grow the rectangle by the specified amount
void grow( double delta );
/** Updates the rectangle to include the specified point */
void include( const QgsPoint& p );
/** Get rectangle enlarged by buffer.
* @note added in 2.1 */
QgsRectangle buffer( double width );
@@ -252,7 +252,7 @@ class QgisInterface : QObject
virtual void showLayerProperties( QgsMapLayer *l ) = 0;

/** Open attribute table dialog */
virtual void showAttributeTable( QgsVectorLayer *l ) = 0;
virtual QDialog* showAttributeTable( QgsVectorLayer *l, const QString& filterExpression = QString() ) = 0;

/** Add window to Window menu. The action title is the window title
* and the action should raise, unminimize and activate the window. */

11 comments on commit 8cec2c9

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Sep 25, 2015

@mhugent the INSTALL file should be updated to add the new dependency, namely libgeos++-dev.

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Sep 25, 2015

Build process errors out:

CMakeFiles/qgis_core.dir/geosextra/geos_c_extra.cpp.o: In function GEOSPrecisionModel_create': geos_c_extra.cpp:(.text+0x24): undefined reference togeos::geom::PrecisionModel::PrecisionModel(geos::geom::PrecisionModel::Type)'
CMakeFiles/qgis_core.dir/geosextra/geos_c_extra.cpp.o: In function GEOSPrecisionModel_createFixed': geos_c_extra.cpp:(.text+0x7a): undefined reference togeos::geom::PrecisionModel::PrecisionModel(double)'
CMakeFiles/qgis_core.dir/geosextra/geos_c_extra.cpp.o: In function GEOSPrecisionModel_destroy': geos_c_extra.cpp:(.text+0xbc): undefined reference togeos::geom::PrecisionModel::~PrecisionModel()'
CMakeFiles/qgis_core.dir/geosextra/geos_c_extra.cpp.o: In function GEOSGeometryPrecisionReducer_reduce': geos_c_extra.cpp:(.text+0x136): undefined reference togeos::precision::GeometryPrecisionReducer::reduce(geos::geom::Geometry const&)'
collect2: error: ld returned 1 exit status

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Sep 25, 2015

@manisandro I'm seeing the same build error - Ubuntu 15.04, GEOS 3.4.2

@tudorbarascu

This comment has been minimized.

Copy link
Member

@tudorbarascu tudorbarascu replied Sep 25, 2015

also in debian 8, geos 3.4.2

@manisandro

This comment has been minimized.

Copy link
Member

@manisandro manisandro replied Sep 25, 2015

If you run ccmake, what do you get for GEOS_CPP_LIBRARY? Does that library appear on the command line when building with make VERBOSE=1?

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Sep 25, 2015

@manisandro I don't see GEOS_CPP_LIBRARY listed in ccmake or in CMakeCache.txt

@manisandro

This comment has been minimized.

Copy link
Member

@manisandro manisandro replied Sep 25, 2015

Did you re-configure the project after the PR got merged?

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Sep 25, 2015

@manisandro yes, also installed the new dependancy too

@tudorbarascu

This comment has been minimized.

Copy link
Member

@tudorbarascu tudorbarascu replied Sep 25, 2015

I did reconfigure but it didn't work. However, what works is deleting everything in the build directory.. and recreate from scratch. Now I see the GEOS_CPP_LIBRARY listed.

@manisandro

This comment has been minimized.

Copy link
Member

@manisandro manisandro replied Sep 25, 2015

Perhaps cmake did not realize that FindGEOS.cmake changed and hence did not re-run it again? Or maybe because the value of GEOS_FOUND did not change it did not re-generate the makefiles? My knowledge of cmake does not go that deep, perhaps I ought to have introduced a separate FindGEOSCPP.cmake instead of just extending the FindGEOS.cmake.

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Sep 25, 2015

Same here, the GEOS_CPP_LIBRARY variable (only) appears after flushing my build directory.

Please sign in to comment.
You can’t perform that action at this time.