Module tools

Module tools 

Source
Expand description

Common geometry tools

Structs§

ClipLineResult
After clipping a line, return the altered line, the offset the new line starts at, and if the line is ccw
ClipLineResultWithBBox
Ensuring vec_bbox exists
InterPointLookup
Intersection Lookup for chunks
Intersection
An intersection of two segments
IntersectionOfSegments
An intersection of two segments u and t are where the intersection occurs
IntersectionOfSegmentsRobust
An intersection of two segments including displacement vectors u and t are where the intersection occurs
IntersectionPoint
Intersection Point
NextRingChunk
The next poly chunk
PolyPath
Reconstructing a poly line that interacts with intersections
RingChunk
A path/piece/chunk from a polygon
RingIntersection
Local Intersection to a [poly_index][ring_index]
Segment
A segment in a polygon

Enums§

DistanceMethod
The method to use to calculate the distance
InsideResult
The result of a point being inside, outside, or on the boundary

Traits§

Along
Given a linestring in degrees and a distance, create a Point along the line
Area
Get the area of the polygon. Lines return 0 if not closed. Other geometries return 0.
AverageOfPoints
Get the average of a collection of VectorPoint.
CenterOfPoints
Get the center of a bounding box from a collection of VectorPoint
ClampWGS84Point
Trait to ensure a WGS84 point is valid
Inside
Check if a point is inside a geometry.
LengthOfLines
Get the total euclidean distance of a line or lines
NearestPoint
Get the nearest of a collection of VectorPoint.
SimplifyVectorGeometry
Functions to simplify a vector geometry
ToLines
Given a Geometry, attempt to Return a VectorMultiLineString.
ToPoints
Convert any geometry shape to a VectorMultiPoint

Functions§

along_line
Given a linestring in degrees and a distance, create a Point along the line
bearing
Get the bearing in degrees between two points
build_paths_and_chunks
Build the PolyPaths and PolyChunks
build_polygon_segments
Build all segments
build_polygon_segments_ref
Build all segments
build_sq_dists
build sqdistances for line vector data
clamp_wgs84_point
Updates the WGS84 point’s x and y values as needed to be valid WGS84
clean_linestring
Removes superfluous/collinear points from a linestring
clean_linestrings
Removes superfluous/collinear points from a collection of linestrings
clean_polygon
Ensures the polygon ring order is correct, removes duplicate points, and runs a dekink to be thorough.
clean_polygons
Ensures the collection of polygon ring order is correct, removes duplicate points, and runs a dekink to be thorough.
clip_features
Internal clip function for a collection of VectorFeatures
clip_line
clip an input line to a bounding box Data should always be in a 0->1 coordinate system to use this clip function
clip_line_string
Clip a LineString to an axis and range
clip_multi_line_string
Clip a MultiLineString geometry to an axis and range
clip_multi_point
Clip a MultiPoint to an axis and range
clip_multi_polygon
Clip a MultiPolygon geometry to an axis and range
clip_point
Clip a point to an axis and range
clip_polygon
Clip a Polygon geometry to an axis and range
convert
Given an input data, convert it to a vector of VectorFeature
dekink_polygon
Given a polygon, if the polygon is kinked, dekink it
dekink_polygons
Given a collection of polygons, if any of the polygons are kinked, dekink them
destination
Get the destination given a start point, bearing, and distance
euclidean_distance
Find the euclidean distance between two points
find_polygon_intersection
Find the intersection of two segments if it exists
haversine_distance
Assuming two points are on the surface of the earth as Lon-Lat coordinates, find the distance between them using the haversine formula. Returns the distance in degrees.
intersection_of_segments
Find the intersection of two segments
intersection_of_segments_robust
Find the intersection of two segments. A more robust approach that uses predicates to ensure no false positives/negatives
merge_intersection_pairs
Given an of intersection, find the best way to connect the from->to chunks
point_in_polygon
A Robust point in polygon test
point_in_polyline
A Robust point in polygon test
point_on_line
Check to see if a point is on a line. Uses predicates to ensure the point is truly on the line
point_to_line_distance
Check to see how far away the point is from the line. Supports both Euclidean and Haversine methods
polygons_intersections
Find all intersections within a collection of polygons
polygons_intersections_lookup
Run through the vector_polygons and Builds the ring intersection lookup
polygons_intersections_ref
Find all intersections within a collection of polygons where each polygon is their own ref.
polygons_union
Given a collection of polygons, if any of the polygons interact/overlap eachother, merge them.
polyline_in_polyline
Check if a polyline/hole is inside another polyline/outer ring
rewind
In place adjust the ring if necessary
ring_area
Calculate the approximate area of the polygon were it projected onto the planet. Note that this area will be positive if ring is oriented counter-clockwise, otherwise it will be negative.
simplify
Simplify a vector geometry

Type Aliases§

IntersectionPointRef
A reference to a IntersectionPoint wrapped in an RC & RefCell
PolyPathRef
A reference to a PolyPath wrapped in an RC & RefCell
RingChunkRef
A reference to a RingChunk wrapped in an RC & RefCell
RingIntersectionLookup
[poly_index][ring_index] -> Intersections