Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. osm

osm

MITGov0.9.0

A comprehensive Go library for reading, writing, and processing OpenStreetMap data in XML, JSON, and PBF formats.

GitHubGitHub
469 stars58 forks0 contributors

What is osm?

osm is a Go library for reading, writing, and manipulating OpenStreetMap data. It provides native support for OSM data formats (XML, JSON, PBF) and core OSM types like nodes, ways, and relations, solving the problem of efficiently processing OSM data in Go applications.

Target Audience

Go developers working with OpenStreetMap data, including those building geospatial tools, map data processors, or applications that consume OSM planet files or API responses.

Value Proposition

Developers choose osm for its comprehensive format support, efficient stream processing of large datasets, and clean Go-native API that abstracts OSM complexities while maintaining performance through optional CGO acceleration and JSON library swaps.

Overview

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

Use Cases

Best For

  • Parsing large OSM PBF planet files in Go applications
  • Building tools that convert OSM data to GeoJSON format
  • Implementing OSM API v0.6 clients in Go
  • Processing OSM replication change files
  • Working with Overpass API JSON responses in Go
  • Adding OSM data annotation (coordinates, metadata) to ways and relations

Not Ideal For

  • Projects not using Go that require OSM data processing libraries
  • Applications focused solely on map visualization or tile serving without raw data manipulation
  • Environments with strict no-CGO policies where PBF decompression performance is critical
  • Real-time systems needing low-latency, parallel streaming of OSM updates without manual concurrency setup

Pros & Cons

Pros

Comprehensive Format Support

Reads and writes OSM XML, JSON (Overpass API format), and PBF files, enabling seamless integration with planet data and API responses as highlighted in the README.

Efficient Stream Processing

Provides a Scanner interface for parsing large OSM PBF and XML files without loading everything into memory, crucial for handling planet-sized datasets efficiently.

Integrated GeoJSON Conversion

Includes an osmgeojson subpackage that converts OSM data to GeoJSON compatible with osmtogeojson, simplifying use in web mapping applications.

Full OSM API Client

Offers an osmapi subpackage with support for all v0.6 read/data endpoints, reducing boilerplate for building OSM API integrations in Go.

Performance Flexibility

Allows optional integration with faster JSON libraries like json-iterator and CGO-accelerated zlib decompression, with benchmarks showing up to 35% speed improvements.

Cons

CGO Installation Complexity

Optimal PBF decompression requires CGO and external libraries like DataDog/czlib, complicating setup on systems without a C compiler or pkg-config, as noted in the README.

No Built-in Parallelism

Scanners are not safe for parallel use, forcing developers to implement custom concurrency with channels, adding overhead for high-throughput processing scenarios.

Narrow Geospatial Scope

Focuses exclusively on OSM data formats and types, lacking support for other common geospatial formats like Shapefile or KML, which may require additional tools for broader workflows.

Frequently Asked Questions

Quick Stats

Stars469
Forks58
Contributors0
Open Issues3
Last commit27 days ago
CreatedSince 2016

Tags

#geospatial#go-library#osm-xml#osm#golang#xml#openstreetmap#data-parsing#map-data#geo-processing

Built With

G
Go
z
zlib
c
cgo

Included in

Go169.1k
Auto-fetched 20 hours ago

Related Projects

Tile38Tile38

Real-time Geospatial and Geofencing

Stars9,738
Forks621
Last commit1 month ago
S2 geometryS2 geometry

S2 geometry library in Go

Stars1,854
Forks199
Last commit8 days ago
mbtileservermbtileserver

Basic Go server for mbtiles

Stars793
Forks121
Last commit1 year ago
geoosgeoos

A library provides spatial data and geometric algorithms

Stars530
Forks108
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub