All Projects → paulmach → Osm

paulmach / Osm

Licence: mit
General purpose library for reading, writing and working with OpenStreetMap data

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Osm

Mapsui
Mapsui is a .NET Map component for WPF, Xamarin.Forms, Xamarin.Android, Xamarin.iOS and UWP
Stars: ✭ 447 (+192.16%)
Mutual labels:  osm, openstreetmap
Osmproxy
OpenStreetMap tile proxy for REDAXO
Stars: ✭ 17 (-88.89%)
Mutual labels:  osm, openstreetmap
Osrm Backend
Open Source Routing Machine - C++ backend
Stars: ✭ 4,716 (+2982.35%)
Mutual labels:  osm, openstreetmap
Name Suggestion Index
Canonical common brand names, operators, transit and flags for OpenStreetMap.
Stars: ✭ 332 (+116.99%)
Mutual labels:  osm, openstreetmap
Cyclosm Cartocss Style
Cycle oriented CartoCSS style.
Stars: ✭ 109 (-28.76%)
Mutual labels:  osm, openstreetmap
Vectiler
A vector tile, terrain and city 3d model builder and exporter
Stars: ✭ 394 (+157.52%)
Mutual labels:  osm, openstreetmap
Osm4j Core
Core components of osm4j
Stars: ✭ 16 (-89.54%)
Mutual labels:  osm, openstreetmap
basemaps
Scripts to generate MapServer mapfiles based on OpenStreetMap data. Please submit pull requests to the 'main' branch.
Stars: ✭ 51 (-66.67%)
Mutual labels:  openstreetmap, osm
Quickosm
QGIS plugin to fetch OSM data with the Overpass API
Stars: ✭ 91 (-40.52%)
Mutual labels:  osm, openstreetmap
Osmic
CC0 SVG Map Icons, mirror of repo on Gitlab
Stars: ✭ 89 (-41.83%)
Mutual labels:  osm, openstreetmap
Tilemill
TileMill is a modern map design studio
Stars: ✭ 2,952 (+1829.41%)
Mutual labels:  osm, openstreetmap
Osmplotr
Data visualisation using OpenStreetMap objects
Stars: ✭ 122 (-20.26%)
Mutual labels:  osm, openstreetmap
Hootenanny
Hootenanny conflates multiple maps into a single seamless map.
Stars: ✭ 264 (+72.55%)
Mutual labels:  osm, openstreetmap
Overpass Turbo
A web based data mining tool for OpenStreetMap using the Overpass API.
Stars: ✭ 435 (+184.31%)
Mutual labels:  osm, openstreetmap
is-osm-uptodate
Find outdated nodes in OpenStreetMap
Stars: ✭ 16 (-89.54%)
Mutual labels:  openstreetmap, osm
Blender Osm
One click download and import of OpenStreetMap and terrain for Blender! Global coverage! Source code is in the branch 'release'.
Stars: ✭ 588 (+284.31%)
Mutual labels:  osm, openstreetmap
overpass-api-ruby
A Ruby wrapper for OpenStreetMap Overpass API
Stars: ✭ 22 (-85.62%)
Mutual labels:  xml, openstreetmap
accessibility-cloud
👩🏽‍🦯🦮👩🏻‍🦽👩🏿‍🦼 the platform to exchange physical accessibility data in a standardized, future-proof, easy-to-use way.
Stars: ✭ 37 (-75.82%)
Mutual labels:  openstreetmap, osm
Osm2geojson
Convert OSM and Overpass JSON to GeoJSON
Stars: ✭ 25 (-83.66%)
Mutual labels:  osm, openstreetmap
Cities
Poly files for cities, which can be used to create OSM files out of larger regions
Stars: ✭ 115 (-24.84%)
Mutual labels:  osm, openstreetmap

osm CI Go Report Card Go Reference

This package is a general purpose library for reading, writing and working with OpenStreetMap data in Go (golang). It has the ability to read OSM XML and PBF data formats available at planet.osm.org or via the v0.6 API.

Made available by the package are the following types:

  • Node
  • Way
  • Relation
  • Changeset
  • Note
  • User

And the following “container” types:

List of sub-package utilities

  • annotate - adds lon/lat, version, changeset and orientation data to way and relation members
  • osmapi - supports all the v0.6 read/data endpoints
  • osmgeojson - OSM to GeoJSON conversion compatible with osmtogeojson
  • osmpbf - stream processing of *.osm.pbf files
  • osmxml - stream processing of *.osm xml files
  • replication - fetch replication state and change files

Concepts

This package refers to the core OSM data types as Objects. The Node, Way, Relation, Changeset, Note and User types implement the osm.Object interface and can be referenced using the osm.ObjectID type. As a result it is possible to have a slice of []osm.Object that contains nodes, changesets and users.

Individual versions of the core OSM Map Data types are referred to as Elements and the set of versions for a give Node, Way or Relation is referred to as a Feature. For example, an osm.ElementID could refer to "Node with id 10 and version 3" and the osm.FeatureID would refer to "all versions of node with id 10." Put another way, features represent a road and how it's changed over time and an element is a specific version of that feature.

A number of helper methods are provided for dealing with features and elements. The idea is to make it easy to work with a Way and its member nodes, for example.

Scanning large data files

For small data it is possible to use the encoding/xml package in the Go standard library to marshal/unmarshal the data. This is typically done using the osm.OSM or osm.Change "container" structs.

For large data the package defines the Scanner interface implemented in both the osmxml and osmpbf sub-packages.

type osm.Scanner interface {
	Scan() bool
	Object() osm.Object
	Err() error
	Close() error
}

This interface is designed to mimic the bufio.Scanner interface found in the Go standard library.

Example usage:

f, err := os.Open("./delaware-latest.osm.pbf")
if err != nil {
	panic(err)
}
defer f.Close()

scanner := osmpbf.New(context.Background(), f, 3)
defer scanner.Close()

for scanner.Scan() {
	o := scanner.Object()
	// do something
}

scanErr := scanner.Err()
if scanErr != nil {
	panic(scanErr)
}

Note: Scanners are not safe for parallel use. One should feed the objects into a channel and have workers read from that.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].