geom

package
v0.0.0-...-85720d3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2014 License: Apache-2.0 Imports: 5 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 AsGeomElement

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

func BuildRelGeometry

func BuildRelGeometry(rel *element.Relation, rings []*Ring, srid int) (*geos.Geom, error)

BuildRelGeometry builds the geometry of rel by creating a multipolygon of all rings. rings need to be sorted by area (large to small).

func BuildRelation

func BuildRelation(rel *element.Relation, srid int) error

func LineString

func LineString(g *geos.Geos, nodes []element.Node) (*geos.Geom, 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)

func PrepareRelation

func PrepareRelation(rel *element.Relation, srid int) (*preparedRelation, error)

Types

type GeomError

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

func NewGeomError

func NewGeomError(message string, level int) *GeomError

func (*GeomError) Error

func (e *GeomError) Error() string

func (*GeomError) Level

func (e *GeomError) Level() int

type Ring

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

func BuildRings

func BuildRings(rel *element.Relation) ([]*Ring, error)

func NewRing

func NewRing(way *element.Way) *Ring

func (*Ring) IsClosed

func (r *Ring) IsClosed() bool

func (*Ring) MarkInserted

func (r *Ring) MarkInserted(tags element.Tags)

type SortableRingsDesc

type SortableRingsDesc []*Ring

func (SortableRingsDesc) Len

func (r SortableRingsDesc) Len() int

func (SortableRingsDesc) Less

func (r SortableRingsDesc) Less(i, j int) bool

func (SortableRingsDesc) Swap

func (r SortableRingsDesc) Swap(i, j int)

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