geom

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 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 = newGeometryError("need at least two separate nodes for way", 0)
	ErrorNoRing     = newGeometryError("linestrings do not form ring", 0)
)

Functions

func LineString

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

func NodesAsEWKBHexLineString

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

func NodesAsEWKBHexPolygon

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

func Point

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

func Polygon

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

Types

type Geometry

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

func AsGeomElement

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

type GeometryError added in v0.7.0

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

func (*GeometryError) Error added in v0.7.0

func (e *GeometryError) Error() string

func (*GeometryError) Level added in v0.7.0

func (e *GeometryError) Level() int

type PreparedRelation

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

func PrepareRelation

func PrepareRelation(rel *osm.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