geoencoding

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 7 Imported by: 2

Documentation

Overview

Package geoencoding is a library for encoding and decoding into Go structs using the geometries.

Index

Constants

View Source
const (
	WKT = iota
	WKB
	GeoJSON
	GeoCSV
	Geobuf
)

encode type

Variables

This section is empty.

Functions

func Decode

func Decode(s []byte, codeType int) (space.Geometry, error)

Decode Returns geometry of that decode string by codeType.

func Encode

func Encode(g space.Geometry, codeType int) []byte

Encode Returns string of that encode geometry by codeType.

func Read

func Read(r io.Reader, codeType int) (space.Geometry, error)

Read Returns geometry from reader by codeType.

func ReadGeoJSON

func ReadGeoJSON(r io.Reader, codeType int) (*geojson.FeatureCollection, error)

ReadGeoJSON Returns geometry from reader by codeType.

func Write

func Write(w io.Writer, g space.Geometry, codeType int) error

Write write geometry to writer. by codeType.

func WriteGeoJSON

func WriteGeoJSON(w io.Writer, g *geojson.FeatureCollection, codeType int) error

WriteGeoJSON write geometry to writer by codeType.

Types

type Encoder

type Encoder interface {
	// Encode Returns string of that encode geometry.
	Encode(g space.Geometry) []byte
	// Decode Returns geometry of that decode string.
	Decode(s []byte) (space.Geometry, error)

	// Read Returns geometry from reader.
	Read(r io.Reader) (space.Geometry, error)

	// Write write geometry to writer.
	Write(w io.Writer, g space.Geometry) error

	// Read Returns geometry from reader.
	ReadGeoJSON(r io.Reader) (*geojson.FeatureCollection, error)

	// Write write geometry to writer.
	WriteGeoJSON(w io.Writer, g *geojson.FeatureCollection) error
}

Encoder defines encoder for encoding and decoding into Go structs using the geometries.

Directories

Path Synopsis
Package geobuf is a library for encoding and decoding geobuf into Go structs using
Package geobuf is a library for encoding and decoding geobuf into Go structs using
decode
Package encode is a library for decoding geobuf into Go structs using
Package encode is a library for decoding geobuf into Go structs using
encode
Package encode is a library for encoding geobuf into Go structs using
Package encode is a library for encoding geobuf into Go structs using
protogeo
Package protogeo is a library for encoding and decoding geobuf into Go structs using Code generated by protoc-gen-go.
Package protogeo is a library for encoding and decoding geobuf into Go structs using Code generated by protoc-gen-go.
Package geocsv is a library for read csv file with geospatial data.
Package geocsv is a library for read csv file with geospatial data.
Package geojson is a library for encoding and decoding GeoJSON into Go structs using the geometries.
Package geojson is a library for encoding and decoding GeoJSON into Go structs using the geometries.
Package wkb is for decoding ESRI's Well Known Binary (WKB) format specification at https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary
Package wkb is for decoding ESRI's Well Known Binary (WKB) format specification at https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary
Package wkt is for decoding Well Known Text (WKT) format specification at https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary
Package wkt is for decoding Well Known Text (WKT) format specification at https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary

Jump to

Keyboard shortcuts

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