26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H 27 #define __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H 30 #include "../sam/rtree.h" 54 class MultiLineString;
188 TEGEOMEXPORT std::unique_ptr<te::gm::Geometry>
GetGeometryUnion(
const std::vector<te::gm::Geometry*>& geomVec,
double tolerance = 0.000000001);
342 bool& wasChanged,
double tolerance = 0.000000001);
355 bool& wasChanged,
double tolerance = 0.000000001);
369 bool& wasChanged,
double tolerance = 0.000000001);
383 std::vector<te::gm::LineString>& vecRtreeSegments,
bool& wasChanged,
double tolerance = 0.000000001);
397 std::vector<te::gm::LineString>& vecRtreeSegments,
bool& wasChanged,
double tolerance = 0.000000001);
412 const std::vector<te::gm::LineString>& referenceSegments,
413 const std::set<std::size_t>& setIndexesIgnored,
415 double tolerance = 0.000000001);
431 const std::vector<te::gm::LineString>& candidateSegments,
432 const std::set<std::size_t>& setIndexesIgnored,
434 const bool& usePerpendicularDistance =
false,
435 double tolerance = 0.000000001);
659 #endif // __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H std::vector< te::gm::Geometry * > GeometryVector
TEGEOMEXPORT te::gm::GeomType GetMultiLineStringType(const te::gm::Geometry &geometry)
Get the LineStrings that compose the Geometry.
TEGEOMEXPORT te::gm::Geometry * CascadedUnion(const std::vector< te::gm::Geometry *> &vecGeometries)
Provides an efficient method of unioning a collection of geometries. This algorithm is faster and lik...
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
A Line is LineString with 2 points.
TEGEOMEXPORT void AddPolygon(te::gm::Polygon *polygon, te::gm::GeometryVector &pAdd)
Add all line strings from the polygon given to the vector given.
TEGEOMEXPORT te::gm::Geometry * CascadedPolygonUnion(const std::vector< te::gm::Polygon *> &polygonVector)
Provides an efficient method of unioning a collection of Polygonal geometries. This algorithm is fast...
TEGEOMEXPORT void ClosestPoints(te::gm::Geometry *geomA, te::gm::Geometry *geomB, te::gm::Coord2D &coordA, te::gm::Coord2D &coordB)
Compute the the closest points of two geometries.
TEGEOMEXPORT bool IsNullOrEmpty(const te::gm::GeometryPtr &geometry)
Checks if the geometry is null or empty.
TEGEOMEXPORT te::gm::Geometry * NormalizeGeometryByType(const te::gm::Geometry *geometry, te::gm::GeomType singleGeometryType)
Normalizes and filters the given geometry based on the given simple type. If the given geometry if a...
Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of co...
TEGEOMEXPORT bool Rotate(te::gm::Coord2D pr, te::gm::LineString *l, double angle, te::gm::LineString *lOut)
TEGEOMEXPORT te::gm::Envelope CreateEnvelope(double x1, double y1, double x2, double y2)
Creates an envelope that fits the given coordinates. It makes all the adjustments needed to return a ...
TEGEOMEXPORT double GetArea(const te::gm::Geometry *geometry)
Calculates the area of the given geometry. If the geometry is from dimension 0 or 1...
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
TEGEOMEXPORT bool RelationMatches(const std::string &relation, const std::string &relationPattern)
Tests if the given relation matrix matches with the given relation pattern. This pattern is based on ...
SpatialRelation
Spatial relations between geometric objects.
TEGEOMEXPORT LineString * AddIntersectionPoints(const te::sam::rtree::Index< std::size_t, 8 > &rtree, const std::vector< te::gm::LineString > &candidateSegments, const std::set< std::size_t > &setIndexesIgnored, const te::gm::LineString &lr_Reference, const bool &usePerpendicularDistance=false, double tolerance=0.000000001)
Add intersection points in a LinearRing based on a Vector of LineString as reference.
An utility struct for representing 2D coordinates.
TEGEOMEXPORT te::gm::Geometry * ClipGeometry(const te::gm::Geometry *geometry, const te::gm::Envelope &clipArea)
Clips the given geometry to the given clipArea.
TEGEOMEXPORT std::vector< te::gm::Point > GetIntersectionPointsByPerpendicularDistance(const te::gm::LineString &lsReference, const std::vector< te::gm::LineString > &candidates, double tolerance=0.000000001)
Gets a vector of LineString reference points including intersection points using perpendicular distan...
TEGEOMEXPORT te::gm::Polygon CreatePolygon(const te::gm::Envelope &box, const int &srid, const int &numberOfIntermediateCoords)
Creates a Polygon from the given envelope and with the given number of intermediate coordinates in ea...
TEGEOMEXPORT te::gm::GeomType GetSimpleType(te::gm::GeomType geomType)
Get the simple type of GeomType.
int GetCoordDimension(GeomType t)
It returns the number of measurements or axes needed to describe a position in a coordinate system...
TEGEOMEXPORT bool IsMultiType(te::gm::GeomType geomType)
Verifies if the geomType is a collection type.
TEGEOMEXPORT te::gm::GeomType GetMultiType(te::gm::GeomType geomType)
Get the collection type of GeomType.
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
TEGEOMEXPORT te::gm::Geometry * MultiLineToDefinedType(const std::vector< te::gm::MultiLineString *> &multiLineStringVector, te::gm::GeomType geometryType)
A geometry is built based on a Vector of MultiLineString and the origin geometry type.
TEGEOMEXPORT Envelope AdjustToCut(const Envelope &env, double bWidth, double bHeight)
Finds the correspondent smallest box that allows a box to be cut in blocks of a given size...
A LinearRing is a LineString that is both closed and simple.
Enumerations related to Geometry module.
LineString is a curve with linear interpolation between points.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
TEGEOMEXPORT void Polygonizer(te::gm::Geometry *g, std::vector< te::gm::Polygon *> &pols)
It will get a list of polygons formed by the polygonization.
TEGEOMEXPORT te::gm::GeometryPtr CreateCollectionFromGeometryVector(const te::gm::GeometryVector &geometryVector)
Creates a geometry collection based on the given geometryVector.
TEGEOMEXPORT te::gm::Geometry * UnaryUnion(te::gm::Geometry *geom)
It will get the union of the input geometries.
TEGEOMEXPORT bool SatisfySpatialRelation(const Geometry *g1, const Geometry *g2, SpatialRelation relation)
It returns if two geometries satisfy a given spatial relation.
TEGEOMEXPORT std::vector< te::gm::Point > GetIntersectionPointsByOperators(const te::gm::LineString &lsReference, const std::vector< te::gm::LineString > &candidates, double tolerance=0.000000001)
Gets a vector of LineString reference points including intersection points using GEOS operators...
TEGEOMEXPORT bool isCCW(const te::gm::LinearRing *ring)
Checks if a LinearRing is in Counter-clockwise orientation.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
TEGEOMEXPORT te::gm::Geometry * PrepareGeometriesToIntersection(const te::gm::Geometry *geom_A, te::gm::Geometry *geomB, bool &wasChanged, double tolerance=0.000000001)
Prepares the geometry A with intersection points in geometry B.
MultiLineString is a MultiCurve whose elements are LineStrings.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
TEGEOMEXPORT void Multi2Single(const te::gm::Geometry *g, std::vector< te::gm::Geometry *> &geoms)
It will get a GeometryCollection and distribute in a vector.
TEGEOMEXPORT double GetAngle(te::gm::Coord2D coordA, te::gm::Coord2D coordB)
TEGEOMEXPORT te::gm::Coord2D GetInteriorPoint(const te::gm::Geometry *geometry)
As geos Explanation: An interior point is guaranteed to lie in the interior of the Geometry...
TEGEOMEXPORT const std::string Get2DGeometryType(const te::gm::GeomType &type)
It returns the name of 2D geometry subclass.
TEGEOMEXPORT LineString * SnapLineToPoints(const te::sam::rtree::Index< std::size_t, 8 > &rtree, const std::vector< te::gm::LineString > &referenceSegments, const std::set< std::size_t > &setIndexesIgnored, const te::gm::LineString &linearRingToSnap, bool &wasChanged, double tolerance=0.000000001)
Snaps a LinearRing based on a set of LineString.
TEGEOMEXPORT std::unique_ptr< te::gm::Geometry > GetGeometryUnion(const std::vector< te::gm::Geometry *> &geomVec, double tolerance=0.000000001)
It returns the union of a geometry vector.
TEGEOMEXPORT bool AdjustSegment(te::gm::Point *P0, te::gm::Point *P1, double d0, te::gm::Coord2D &P0out, te::gm::Coord2D &P1out)
TEGEOMEXPORT te::gm::LineString CreateLine(const te::gm::Coord2D &startCoord, const te::gm::Coord2D &endCoord, const int &srid, const int &numberOfIntermediateCoords)
Creates a LineString between the given startCoord and endCoord with the given number of intermediate ...
TEGEOMEXPORT bool IsPointOnPolygon(const te::gm::Coord2D &coord, const te::gm::Geometry *geometry)
Checks if the given point in within the given polygon or multipolygon geometry.
TEGEOMEXPORT Coord2D * locateAlong(const LineString *line, double initial, double final, double target)
Make the line interpolation to find a target.
Configuration flags for the Vector Geometry Model of TerraLib.
TEGEOMEXPORT std::vector< MultiLineString * > GetAsMultiLineStringVector(const te::gm::Geometry &geometry)
Get the vector of MultLineStrings that compose the Geometry.
TEGEOMEXPORT void AddLineString(te::gm::LineString *lineString, te::gm::GeometryVector &pAdd)
Add the linestring given to the vector.
TEGEOMEXPORT te::gm::LineString * ParallelLine(const te::gm::LineString *line, double distance)
Creates a parallel line from the given line. Here will use the distance for offset between the origin...
TEGEOMEXPORT double GetAppropriatePrecision(int srid)
Returns the appropriate precision to be used by spatial operations that adjust geometric data from ot...
TEGEOMEXPORT GeomType Get2DGeomTypeId(const te::gm::GeomType &type)
It returns the 2D geometry subclass type identifier.
TEGEOMEXPORT te::gm::Line * GetIntersectionLine(te::gm::Geometry *geom, te::gm::Coord2D coord)