Skip to content
forked from cairnapp/go-geobuf

Compact GeoJSON encoding for Golang

License

Notifications You must be signed in to change notification settings

mscno/go-geobuf

 
 

Repository files navigation

Go Geobuf

A compact Protobuf representation of GeoJSON. Based on Mapbox's geobuf.

Limitations

Due to the nature of Go being a statically typed language, custom properties are not currently supported.

Some properties may lose their types through encoding/decoding. For instance, int8s may become uints or just ints.

Encoding/Decoding

A basic example shows how this library will infer the proper precision for encoding/decoding

import (
    "github.com/mscno/go-geobuf"
    "github.com/mscno/go-geobuf/internal/geometry"
    "github.com/mscno/go-geobuf/internal/geojson"
)

point := geojson.NewGeometry(geometry.Point([]float64{
    124.123, 
    234.456
}))
data := geobuf.Encode(point)
decoded_point := geobuf.Decode(point)

About

Compact GeoJSON encoding for Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 67.7%
  • HTML 28.1%
  • Elixir 3.9%
  • Just 0.3%