26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H
30 #include "../sam/rtree.h"
54 class MultiLineString;
343 bool& wasChanged,
double tolerance = 0.000000001);
346 bool checkValidityAndFix,
bool& wasChanged,
double tolerance = 0.000000001);
359 bool& wasChanged,
double tolerance = 0.000000001);
362 bool checkValidityAndFix,
bool& wasChanged,
double tolerance = 0.000000001);
376 bool& wasChanged,
double tolerance = 0.000000001);
390 std::vector<te::gm::LineString>& vecRtreeSegments,
bool& wasChanged,
double tolerance = 0.000000001);
404 std::vector<te::gm::LineString>& vecRtreeSegments,
bool& wasChanged,
double tolerance = 0.000000001);
419 const std::vector<te::gm::LineString>& referenceSegments,
420 const std::set<std::size_t>& setIndexesIgnored,
422 double tolerance = 0.000000001);
438 const std::vector<te::gm::LineString>& candidateSegments,
439 const std::set<std::size_t>& setIndexesIgnored,
441 const bool& usePerpendicularDistance =
false,
442 double tolerance = 0.000000001);
Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of co...
An Envelope defines a 2D rectangular region.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
LineString is a curve with linear interpolation between points.
A Line is LineString with 2 points.
A LinearRing is a LineString that is both closed and simple.
MultiLineString is a MultiCurve whose elements are LineStrings.
A point with x and y coordinate values.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
TEGEOMEXPORT std::vector< te::gm::Coord2D > 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::Geometry * ClipGeometry(const te::gm::Geometry *geometry, const te::gm::Envelope &clipArea)
Clips the given geometry to the given clipArea.
TEGEOMEXPORT te::gm::Geometry * UnaryUnion(te::gm::Geometry *geom)
It will get the union of the input geometries.
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 bool IsMultiType(te::gm::GeomType geomType)
Verifies if the geomType is a collection type.
TEGEOMEXPORT std::unique_ptr< te::gm::Geometry > GetGeometryUnion(const te::gm::GeometryVectorConst &geomVec, double tolerance=0.000000001)
It returns the union of a geometry vector.
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 te::gm::GeometryVectorConst ToConstVector(const te::gm::GeometryVector &vecGeometries)
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
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 te::gm::GeomType GetMultiType(te::gm::GeomType geomType)
Get the collection type of GeomType.
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 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 ...
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
TEGEOMEXPORT te::gm::GeomType GetMultiLineStringType(const te::gm::Geometry &geometry)
Get the LineStrings that compose the Geometry.
SpatialRelation
Spatial relations between geometric objects.
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 double GetArea(const te::gm::Geometry *geometry)
Calculates the area of the given geometry. If the geometry is from dimension 0 or 1,...
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 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.
TEGEOMEXPORT bool Rotate(te::gm::Coord2D pr, te::gm::LineString *l, double angle, te::gm::LineString *lOut)
TEGEOMEXPORT te::gm::Line * GetIntersectionLine(te::gm::Geometry *geom, te::gm::Coord2D coord)
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.
TEGEOMEXPORT bool SatisfySpatialRelation(const Geometry *g1, const Geometry *g2, SpatialRelation relation)
It returns if two geometries satisfy a given spatial relation.
TEGEOMEXPORT te::gm::GeometryPtr CreateCollectionFromGeometryVector(const te::gm::GeometryVector &geometryVector)
Creates a geometry collection based on the given geometryVector.
TEGEOMEXPORT bool IsNullOrEmpty(const te::gm::GeometryPtr &geometry)
Checks if the geometry is null or empty.
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 std::vector< MultiLineString * > GetAsMultiLineStringVector(const te::gm::Geometry &geometry)
Get the vector of MultLineStrings that compose the Geometry.
TEGEOMEXPORT double GetAngle(te::gm::Coord2D coordA, te::gm::Coord2D coordB)
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 te::gm::GeomType GetSimpleType(te::gm::GeomType geomType)
Get the simple type of GeomType.
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 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.
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. \description If the given g...
TEGEOMEXPORT void AddPolygon(te::gm::Polygon *polygon, te::gm::GeometryVector &pAdd)
Add all line strings from the polygon given to the vector given.
TEGEOMEXPORT void AddLineString(te::gm::LineString *lineString, te::gm::GeometryVector &pAdd)
Add the linestring given to the vector.
TEGEOMEXPORT bool isCCW(const te::gm::LinearRing *ring)
Checks if a LinearRing is in Counter-clockwise orientation.
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...
int GetCoordDimension(GeomType t)
It returns the number of measurements or axes needed to describe a position in a coordinate system.
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 std::vector< te::gm::Geometry * > SplitGeometry(const te::gm::Geometry *inputGeometry, const te::gm::Geometry *bladeLineGeometry)
Splits the given 'inputGeometry' (must be an area) using the given 'bladeLineGeometry' (must be a lin...
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...
TEGEOMEXPORT Coord2D * locateAlong(const LineString *line, double initial, double final, double target)
Make the line interpolation to find a target.
TEGEOMEXPORT GeomType Get2DGeomTypeId(const te::gm::GeomType &type)
It returns the 2D geometry subclass type identifier.
std::vector< te::gm::Geometry * > GeometryVector
std::vector< const te::gm::Geometry * > GeometryVectorConst
TEGEOMEXPORT std::vector< te::gm::Coord2D > 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 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...
An utility struct for representing 2D coordinates.
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).
Utility classes, structures and definitions for Vector Processing.
Enumerations of XML module.