geom

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package geom provides functions for building geometries.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorOneNodeWay = newGeomError("need at least two separate nodes for way", 0)
	ErrorNoRing     = newGeomError("linestrings do not form ring", 0)
)

Functions

func LineString

func LineString(g *geos.Geos, nodes []element.Node) (*geos.Geom, error)

func NodesAsEWKBHexLineString

func NodesAsEWKBHexLineString(nodes []element.Node, srid int) ([]byte, error)

func NodesAsEWKBHexPolygon

func NodesAsEWKBHexPolygon(nodes []element.Node, srid int) ([]byte, error)

func Point

func Point(g *geos.Geos, node element.Node) (*geos.Geom, error)

func Polygon

func Polygon(g *geos.Geos, nodes []element.Node) (*geos.Geom, error)

Types

type GeomError

type GeomError struct {
	// contains filtered or unexported fields
}

func (*GeomError) Error

func (e *GeomError) Error() string

func (*GeomError) Level

func (e *GeomError) Level() int

type Geometry

type Geometry struct {
	Geom *geos.Geom
	Wkb  []byte
}

func AsGeomElement

func AsGeomElement(g *geos.Geos, geom *geos.Geom) (Geometry, error)

type PreparedRelation

type PreparedRelation struct {
	// contains filtered or unexported fields
}

func PrepareRelation

func PrepareRelation(rel *element.Relation, srid int, maxRingGap float64) (PreparedRelation, error)

PrepareRelation is the first step in building a (multi-)polygon of a Relation. It builds rings from all ways and returns an error if there are unclosed rings.

func (*PreparedRelation) Build

func (prep *PreparedRelation) Build() (Geometry, error)

Build creates the (multi)polygon Geometry of the Relation.

Directories

Path Synopsis
Package geojson creates GEOS geometries from GeoJSON files.
Package geojson creates GEOS geometries from GeoJSON files.
Package geos provides a wrapper to the GEOS library.
Package geos provides a wrapper to the GEOS library.
Package limit provides functions to clip geometries at polygon boundaries.
Package limit provides functions to clip geometries at polygon boundaries.

Jump to

Keyboard shortcuts

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