A comprehensive Go library for reading, writing, and processing OpenStreetMap data in XML, JSON, and PBF formats.
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.
Go developers working with OpenStreetMap data, including those building geospatial tools, map data processors, or applications that consume OSM planet files or API responses.
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.
General purpose library for reading, writing and working with OpenStreetMap data
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
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.
Provides a Scanner interface for parsing large OSM PBF and XML files without loading everything into memory, crucial for handling planet-sized datasets efficiently.
Includes an osmgeojson subpackage that converts OSM data to GeoJSON compatible with osmtogeojson, simplifying use in web mapping applications.
Offers an osmapi subpackage with support for all v0.6 read/data endpoints, reducing boilerplate for building OSM API integrations in Go.
Allows optional integration with faster JSON libraries like json-iterator and CGO-accelerated zlib decompression, with benchmarks showing up to 35% speed improvements.
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.
Scanners are not safe for parallel use, forcing developers to implement custom concurrency with channels, adding overhead for high-throughput processing scenarios.
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.