26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H 27 #define __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H 30 #include "../sam/rtree.h" 74 _reference = reference;
79 double distance1 = p1.
distance(&_reference);
80 double distance2 = p2.
distance(&_reference);
82 if (distance1 < distance2)
162 template<
class T1,
class T2>
bool Intersects(
const T1& o1,
const T2& o2);
348 const std::vector<te::gm::LineString>& referenceSegments,
362 const std::vector<te::gm::LineString>& candidateSegments,
364 const bool& usePerpendicularDistance =
false);
389 #endif // __TERRALIB_GEOMETRY_INTERNAL_GEOMUTILS_H DistanceOrderFunctor(const te::gm::Point &reference)
TEGEOMEXPORT bool CheckValidity(const te::gm::Geometry *geom, te::gm::TopologyValidationError &error)
It check geometry validity using GEOS.
MultiPolygon is a MultiSurface whose elements are Polygons.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
A Line is LineString with 2 points.
TEGEOMEXPORT double PerpendicularDistance(const te::gm::Point &first, const te::gm::Point &last, te::gm::Point &pin, Point &pinter)
Calculate the perpendicular distance of a point in a segment.
TEGEOMEXPORT void AddPolygon(te::gm::Polygon *polygon, std::vector< te::gm::Geometry * > &pAdd)
Add all line strings from the polygon given to the vector given.
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 Rotate(te::gm::Coord2D pr, te::gm::LineString *l, double angle, te::gm::LineString *lOut)
A point with x and y coordinate values.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
SpatialRelation
Spatial relations between geometric objects.
An utility struct for representing 2D coordinates.
int GetCoordDimension(GeomType t)
It returns the number of measurements or axes needed to describe a position in a coordinate system...
This struct is used sorts a vector of points by distance.
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...
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
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.
TEGEOMEXPORT te::gm::LinearRing * SnapLineToPoints(const te::sam::rtree::Index< std::size_t, 8 > &rtree, const std::vector< te::gm::LineString > &referenceSegments, const te::gm::LinearRing &linearRingToSnap)
Snaps a LinearRing based on a set of LineString.
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 te::gm::Geometry * UnaryUnion(te::gm::Geometry *geom)
It will get the union of the input geometries.
virtual double distance(const Geometry *const rhs) const
It returns the shortest distance between any two points in the two geometry objects.
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::Geometry * > FixSelfIntersection(const te::gm::Geometry *g)
It will fix geometries with self-intersection.
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 te::gm::Geometry * Validate(te::gm::Geometry *geom)
Get/create a valid version of the geometry given. If the geometry is a polygon or multi polygon...
TEGEOMEXPORT void AddLineString(te::gm::LineString *lineString, std::vector< te::gm::Geometry * > &pAdd)
Add the linestring given to the vector.
TEGEOMEXPORT void Polygonizer(te::gm::Geometry *g, std::vector< te::gm::Polygon * > &pols)
It will get a list of polygons formed by the polygonization.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
TEGEOMEXPORT std::vector< te::gm::Point > GetIntersectionPointsByPerpendicularDistance(const te::gm::LineString &lsReference, const std::vector< te::gm::LineString > &candidates)
Gets a vector of LineString reference points including intersection points using perpendicular distan...
TEGEOMEXPORT std::vector< te::gm::Point > GetIntersectionPointsByOperators(const te::gm::LineString &lsReference, const std::vector< te::gm::LineString > &candidates)
Gets a vector of LineString reference points including intersection points using GEOS operators...
bool Intersects(const T1 &o1, const T2 &o2)
bool operator()(const te::gm::Point &p1, const te::gm::Point &p2) const
TEGEOMEXPORT te::gm::Geometry * PrepareGeometriesToIntersection(te::gm::Geometry *geom_A, te::gm::Geometry *geom_B)
Prepares the geometry A with intersection points in geometry B.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
TEGEOMEXPORT std::unique_ptr< te::gm::Geometry > GetGeometryUnion(const std::vector< te::gm::Geometry * > &geomVec)
It returns the union of a geometry vector.
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::LinearRing * AddIntersectionPoints(const te::sam::rtree::Index< std::size_t, 8 > &rtree, const std::vector< te::gm::LineString > &candidateSegments, const te::gm::LinearRing &lr_Reference, const bool &usePerpendicularDistance=false)
Add intersection points in a LinearRing based on a Vector of LineString as reference.
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.
This struct contains informations about GEOS TopologyValidationError.
An utility struct for representing 2D coordinates.
TEGEOMEXPORT te::gm::Line * GetIntersectionLine(te::gm::Geometry *geom, te::gm::Coord2D coord)