Documentation ¶
Index ¶
- func GetEars(polygon []geometry.Point) ([][]geometry.Point, error)
- func NewTriangulatedPolygonFromPoints(points []geometry.Point) (geometry.Polygon, error)
- func TriangulateByEarCut(polygon []geometry.Point) ([][]geometry.Point, error)
- func TriangulateGeoJSONFeatureCollectionToShapes(featureCollection *geojson.FeatureCollection, mapProjection gj.MapProjection) ([]geometry.Shape, error)
- func TriangulateGeoJSONFeatureToShape(feature *geojson.Feature, mapProjection gj.MapProjection) (geometry.Shape, error)
- func TriangulatePoints(points []geometry.Point) ([][]geometry.Point, error)
- func TriangulateShapesFromFile(filePath, fileName string, fileType file.InputType, ...) ([]geometry.Shape, error)
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTriangulatedPolygonFromPoints ¶
NewTriangulatedPolygonFromPoints creates a fully triangulated Polygon from a list of points
func TriangulateByEarCut ¶
TriangulateByEarCut Triangulates a list of points returning a list of triangles of Point2d
func TriangulateGeoJSONFeatureCollectionToShapes ¶
func TriangulateGeoJSONFeatureCollectionToShapes(featureCollection *geojson.FeatureCollection, mapProjection gj.MapProjection) ([]geometry.Shape, error)
TriangulateGeoJSONFeatureCollectionToShapes takes a GeoJSON FeatureCollection and returns it as a list of shapes. You need to provide a MapProjection so we know which MapProjection the provided dataset has.
func TriangulateGeoJSONFeatureToShape ¶
func TriangulateGeoJSONFeatureToShape(feature *geojson.Feature, mapProjection gj.MapProjection) (geometry.Shape, error)
TriangulateGeoJSONFeatureToShape takes a GeoJSON Feature as input and triangulates it to a shape.
func TriangulatePoints ¶
TriangulatePoints initiates a triangulation based on a single dimensioned polygon Returns a double dimensioned array consisting of triangles
func TriangulateShapesFromFile ¶
func TriangulateShapesFromFile(filePath, fileName string, fileType file.InputType, mapProjection gj.MapProjection) ([]geometry.Shape, error)
TriangulateShapesFromFile tries to fetch shapes from a GeoJSON file. The shapes will be triangulated if necesssary, cached, and saved besides the file in a gob-format. The next load will use the cached entries.
Types ¶
type Error ¶
type Error struct { // Description short description of error Description string // Ears ears of the triangulation when it failed Ears [][]geometry.Point // PolygonWhenError The failing polygon upon failure PolygonWhenError []geometry.Point }
Error contains information about the state when a triangulation happened