geobabel

package module
v0.0.0-...-c7bbc21 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 7 Imported by: 1

README

geobabel

PkgGoDev

Package geobabel converts geometry types between popular geometry libraries.

Supported geometry types are:

geobabel exists because no single geometry library is perfect. For example:

  • github.com/paulmach/orb is a pure Go library with friendly API, excellent support for OpenStreetMap data and MapBox Vector Tiles, but only supports 2D geometries, and has a heavy focus on the commonly-used EPSG:4326 and EPSG:3857 projections.

  • github.com/twpayne/go-geom is extremely high performance pure Go library that supports multi-dimensional geometries, multiple encodings, and is projection-agnostic, at the expense of a more complex API and a very limited set of geometric operations.

  • github.com/twpayne/go-geos provides an idiomatic Go API to the huge set of battle-tested geometric operations in the industry-standard GEOS library, at the expense of cgo overhead, C-style memory management, and a focus on 2D geometries.

With geobabel you can combine the best aspects of each library. For example, you can use a pure Go library like go-geom or orb to represent your geometries and use a geometric operation that is only available in go-geos.

Supported conversions

To geom.T To *geos.Geom To orb.Geometry To WKB
From geom.T n/a no yes yes
From *geos.Geom no n/a yes yes
From orb.Geometry yes yes n/a yes
From WKB yes yes yes n/a

Note that WKB does not support LinearRings as a top-level geometry type.

License

MIT

Documentation

Overview

Package geobabel converts geometry types between popular geometry libraries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeomFlatCoordsFromOrbLineString

func GeomFlatCoordsFromOrbLineString(orbLineString orb.LineString) []float64

func GeomFlatCoordsFromOrbMultiLineString

func GeomFlatCoordsFromOrbMultiLineString(orbMultiLineString orb.MultiLineString) ([]float64, []int)

func GeomFlatCoordsFromOrbMultiPoint

func GeomFlatCoordsFromOrbMultiPoint(orbMultiPoint orb.MultiPoint) []float64

func GeomFlatCoordsFromOrbMultiPolygon

func GeomFlatCoordsFromOrbMultiPolygon(orbMultiPolygon orb.MultiPolygon) ([]float64, [][]int)

func GeomFlatCoordsFromOrbPoint

func GeomFlatCoordsFromOrbPoint(orbPoint orb.Point) []float64

func GeomFlatCoordsFromOrbPolygon

func GeomFlatCoordsFromOrbPolygon(orbPolygon orb.Polygon) ([]float64, []int)

func GeomFlatCoordsFromOrbRing

func GeomFlatCoordsFromOrbRing(orbRing orb.Ring) []float64

func NewGEOSGeomFromOrbGeometry

func NewGEOSGeomFromOrbGeometry(geosContext *geos.Context, orbGeometry orb.Geometry) *geos.Geom

func NewGEOSGeomFromWKB

func NewGEOSGeomFromWKB(geosContext *geos.Context, wkb []byte) (*geos.Geom, error)

func NewGeomGeometryCollectionFromOrbCollection

func NewGeomGeometryCollectionFromOrbCollection(orbCollection orb.Collection) *geom.GeometryCollection

func NewGeomLineStringFromOrbLineString

func NewGeomLineStringFromOrbLineString(orbLineString orb.LineString) *geom.LineString

func NewGeomLinearRingFromOrbRing

func NewGeomLinearRingFromOrbRing(orbRing orb.Ring) *geom.LinearRing

func NewGeomMultiLineStringFromOrbMultiLineString

func NewGeomMultiLineStringFromOrbMultiLineString(orbMultiLineString orb.MultiLineString) *geom.MultiLineString

func NewGeomMultiPointFromOrbMultiPoint

func NewGeomMultiPointFromOrbMultiPoint(orbMultiPoint orb.MultiPoint) *geom.MultiPoint

func NewGeomMultiPolygonFromOrbMultiPolygon

func NewGeomMultiPolygonFromOrbMultiPolygon(orbMultiPolygon orb.MultiPolygon) *geom.MultiPolygon

func NewGeomPointFromOrbPoint

func NewGeomPointFromOrbPoint(orbPoint orb.Point) *geom.Point

func NewGeomPolygonFromOrbPolygon

func NewGeomPolygonFromOrbPolygon(orbPolygon orb.Polygon) *geom.Polygon

func NewGeomTFromOrbGeometry

func NewGeomTFromOrbGeometry(orbGeometry orb.Geometry) geom.T

func NewGeomTFromWKB

func NewGeomTFromWKB(wkb []byte) (geom.T, error)

func NewOrbCollectionFromGEOSGeom

func NewOrbCollectionFromGEOSGeom(geosGeom *geos.Geom) orb.Collection

func NewOrbGeometryFromGEOSGeom

func NewOrbGeometryFromGEOSGeom(geosGeom *geos.Geom) orb.Geometry

func NewOrbGeometryFromGeomT

func NewOrbGeometryFromGeomT(geomT geom.T) orb.Geometry

func NewOrbGeometryFromWKB

func NewOrbGeometryFromWKB(wkb []byte) (orb.Geometry, error)

func NewOrbLineStringFromGEOSGeom

func NewOrbLineStringFromGEOSGeom(geosGeom *geos.Geom) orb.LineString

func NewOrbMultiLineStringFromGEOSGeom

func NewOrbMultiLineStringFromGEOSGeom(geosGeom *geos.Geom) orb.MultiLineString

func NewOrbMultiPointFromGEOSGeom

func NewOrbMultiPointFromGEOSGeom(geosGeom *geos.Geom) orb.MultiPoint

func NewOrbMultiPolygonFromGEOSGeom

func NewOrbMultiPolygonFromGEOSGeom(geosGeom *geos.Geom) orb.MultiPolygon

func NewOrbPointFromGEOSGeom

func NewOrbPointFromGEOSGeom(geosGeom *geos.Geom) orb.Point

func NewOrbPolygonFromGEOSGeom

func NewOrbPolygonFromGEOSGeom(geosGeom *geos.Geom) orb.Polygon

func NewOrbRingFromGEOSGeom

func NewOrbRingFromGEOSGeom(geosGeom *geos.Geom) orb.Ring

func WKBFromGEOSGeom

func WKBFromGEOSGeom(geosGeom *geos.Geom) []byte

func WKBFromGeomT

func WKBFromGeomT(geomT geom.T) ([]byte, error)

func WKBFromOrbGeometry

func WKBFromOrbGeometry(orbGeometry orb.Geometry) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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