whosonfirst / go-whosonfirst-format

Formatter for the Who's on First GeoJSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-whosonfirst-format

Standardised GeoJSON formatting for Whos On First files.

Usable as both a library and a binary.

Library usage

func main() {
  inputBytes, err := ioutil.ReadFile(inputPath)
  if err != nil {
    panic(err)
  }

  var feature format.Feature

  json.Unmarshal(inputBytes, &feature)
  if err != nil {
    panic(err)
  }

  outputBytes, err := format.FormatFeature(&feature)
  if err != nil {
    panic(err)
  }

  fmt.Printf("%s", outputBytes)
}

Binary usage

make build
cat input.geojson | ./build/wof-format > output.geojson

About

Formatter for the Who's on First GeoJSON


Languages

Language:Go 98.5%Language:Makefile 1.5%