Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vetinari/osm
go package used to parse OpenStreetMap files and manipulate the data
https://github.com/vetinari/osm
Last synced: about 2 months ago
JSON representation
go package used to parse OpenStreetMap files and manipulate the data
- Host: GitHub
- URL: https://github.com/vetinari/osm
- Owner: vetinari
- License: apache-2.0
- Created: 2015-07-15T17:52:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-19T10:14:21.000Z (over 9 years ago)
- Last Synced: 2024-06-21T01:43:48.679Z (7 months ago)
- Language: Go
- Size: 176 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
osm
===The osm package is used to parse OpenStreetMap files and manipulate the data
## Installation
```bash
$ go get github.com/vetinari/osm
```## Usage
Yet another pbf to osm xml converter:
```Go
package mainimport (
"fmt"
"os"
"github.com/vetinari/osm"
"github.com/vetinari/osm/pbf"
"github.com/vetinari/osm/xml"
)func main() {
if len(os.Args) != 2 {
fmt.Fprintf(os.Stderr, "%s: Usage: %s PBF_FILE\n", os.Args[0], os.Args[0])
os.Exit(1)
}fh, err := os.Open(os.Args[1])
if err != nil {
fmt.Fprintf(os.Stderr, "%s: failed to open %s: %s\n", os.Args[0], os.Args[1], err)
os.Exit(1)
}
defer fh.Close()o, err := osm.New(pbf.Parser(fh))
if err != nil {
fmt.Fprintf(os.Stderr, "%s: failed to parse %s: %s\n", os.Args[0], os.Args[1], err)
os.Exit(1)
}xml.Dump(os.Stdout, o)
}
```## Documentation
http://godoc.org/github.com/vetinari/osm
## Help
pull requests welcome :-)
## To Do
- More documentation ;-)
- tests
- import "log" & debug level / debug
- don't write/dump deleted items unless explicitly requested
- download / parse from osm.org API
- merge 2 or more *osm.OSM into one