Documentation ¶
Index ¶
- Constants
- func ConvertUTMtoLatLong(coordinates []float64, zone int, latZone string) []float64
- func GetFeatureFromPoint(point geometry.Point, name string) *geojson.Feature
- func GetFeatureFromPoints(points []geometry.Point, properties map[string]interface{}) *geojson.Feature
- func GetFeatureName(feature *geojson.Feature) string
- func GetFeaturesFromShape(shape geometry.Shape, includeTriangles bool) []*geojson.Feature
- func NewCircleFeatureFromCircle(circle geometry.Circle) *geojson.Feature
- func NewCircleFeatureFromPoint(point geometry.Point, radius float64) *geojson.Feature
- func NewGeoJSONFeatureCollectionFromShape(shape geometry.Shape, includeTriangles bool) geojson.FeatureCollection
- func NewGeoJSONFeatureCollectionFromShapes(shapes []geometry.Shape, includeTriangles bool) geojson.FeatureCollection
- func NewPolygonFeaturesFromPolygon(polygon *geometry.Polygon, includeTriangles bool) []*geojson.Feature
- func TransformFromGeoJSONCoordinatesToPoints(geoJSONGeometry *geojson.Geometry, projection MapProjection) [][]geometry.Point
- func TransformToGeoJSONFeatureCollectionFromPoints(points [][]geometry.Point) geojson.FeatureCollection
- type MapProjection
Constants ¶
const ( // WGS84Projection Use latitude longitude to determine position on a map WGS84Projection = 0 // UTMProjection Use Universal Transverse Mercator basing calculations on a zone and latitude zone (hardcoded to "33" and "Z") UTMProjection = 1 )
Variables ¶
This section is empty.
Functions ¶
func ConvertUTMtoLatLong ¶
ConvertUTMtoLatLong ... https://www.ibm.com/developerworks/java/library/j-coordconvert/
func GetFeatureFromPoint ¶
GetFeatureFromPoint creates a GeoJSON feature from a single point and a map of properties.
func GetFeatureFromPoints ¶
func GetFeatureFromPoints(points []geometry.Point, properties map[string]interface{}) *geojson.Feature
GetFeatureFromPoints creates a GeoJSON feature from a list of points and a map of properties.
func GetFeatureName ¶
GetFeatureName Returns a best guess for name of the feature. If no clue, returns "Unknown name"
func GetFeaturesFromShape ¶
GetFeaturesFromShape returns a geoJSON feature from given shape
func NewCircleFeatureFromCircle ¶
NewCircleFeatureFromCircle Returns a GeoJSON PointFeature with property "radius" set to current radius and "name" as the circle name
func NewCircleFeatureFromPoint ¶
NewCircleFeatureFromPoint Returns a GeoJSON PointFeature with property radius set to current radius
func NewGeoJSONFeatureCollectionFromShape ¶
func NewGeoJSONFeatureCollectionFromShape(shape geometry.Shape, includeTriangles bool) geojson.FeatureCollection
NewGeoJSONFeatureCollectionFromShape returns a GeoJSON FeatureCollection based on a shape
func NewGeoJSONFeatureCollectionFromShapes ¶
func NewGeoJSONFeatureCollectionFromShapes(shapes []geometry.Shape, includeTriangles bool) geojson.FeatureCollection
NewGeoJSONFeatureCollectionFromShapes returns a GeoJSON FeatureCollection based on a list of shapes
func NewPolygonFeaturesFromPolygon ¶
func NewPolygonFeaturesFromPolygon(polygon *geometry.Polygon, includeTriangles bool) []*geojson.Feature
NewPolygonFeaturesFromPolygon returns a list of GeoJSON Features from a polygon. If includeTriangles is true, the triangulated shapes will be added as a separate feature for each triangle.
func TransformFromGeoJSONCoordinatesToPoints ¶
func TransformFromGeoJSONCoordinatesToPoints(geoJSONGeometry *geojson.Geometry, projection MapProjection) [][]geometry.Point
TransformFromGeoJSONCoordinatesToPoints Transforms a geoJSON geometry to points
func TransformToGeoJSONFeatureCollectionFromPoints ¶
func TransformToGeoJSONFeatureCollectionFromPoints(points [][]geometry.Point) geojson.FeatureCollection
TransformToGeoJSONFeatureCollectionFromPoints Transforms a list of point2d to a geoJSON feature collection
Types ¶
type MapProjection ¶
type MapProjection int
MapProjection is the type of projection for given coordinates in a GEOJSON format
func NewMapProjectionFromString ¶
func NewMapProjectionFromString(projection string) MapProjection
NewMapProjectionFromString Returns a MapProjection based on string input. Defaults to WGS84.