geojson

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: MIT Imports: 1 Imported by: 7

Documentation

Index

Constants

View Source
const (
	GeometryPointType           = "Point"
	GeometryMultiPointType      = "MultiPoint"
	GeometryLineStringType      = "LineString"
	GeometryMultiLineStringType = "MultiLineString"
	GeometryPolygonType         = "Polygon"
	GeometryMultiPolygonType    = "MultiPolygon"
	GeometryCollectionType      = "GeometryCollectionType"
)
View Source
const FeatureCollectionType = "FeatureCollection"
View Source
const FeatureType = "Feature"

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	ID         interface{}       `json:"id,omitempty"`
	Type       string            `json:"type"`
	Geometry   geometry.Geometry `json:"geometry"`
	Properties Properties        `json:"properties"`
}

A Feature corresponds to GeoJSON feature object

func NewFeature

func NewFeature(geometry geometry.Geometry) *Feature

type FeatureCollection

type FeatureCollection struct {
	Type     string     `json:"type"`
	Features []*Feature `json:"features"`
}

func NewFeatureCollection

func NewFeatureCollection() *FeatureCollection

func (*FeatureCollection) Append

func (fc *FeatureCollection) Append(feature *Feature) *FeatureCollection

Append appends a feature to the collection.

type Geometry

type Geometry struct {
	Type        string            `json:"type"`
	Coordinates geometry.Geometry `json:"coordinates,omitempty"`
	Geometries  []*Geometry       `json:"geometries,omitempty"`
}

func NewGeometry

func NewGeometry(g geometry.Geometry) *Geometry

type Properties

type Properties map[string]interface{}

Jump to

Keyboard shortcuts

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