gj

package
v0.0.0-...-ae1d368 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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

func ConvertUTMtoLatLong(coordinates []float64, zone int, latZone string) []float64

ConvertUTMtoLatLong ... https://www.ibm.com/developerworks/java/library/j-coordconvert/

func GetFeatureFromPoint

func GetFeatureFromPoint(point geometry.Point, name string) *geojson.Feature

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

func GetFeatureName(feature *geojson.Feature) string

GetFeatureName Returns a best guess for name of the feature. If no clue, returns "Unknown name"

func GetFeaturesFromShape

func GetFeaturesFromShape(shape geometry.Shape, includeTriangles bool) []*geojson.Feature

GetFeaturesFromShape returns a geoJSON feature from given shape

func NewCircleFeatureFromCircle

func NewCircleFeatureFromCircle(circle geometry.Circle) *geojson.Feature

NewCircleFeatureFromCircle Returns a GeoJSON PointFeature with property "radius" set to current radius and "name" as the circle name

func NewCircleFeatureFromPoint

func NewCircleFeatureFromPoint(point geometry.Point, radius float64) *geojson.Feature

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL