WKB (Well-Known Binary) is the binary representation of vector geometry from the OGC Simple Features standard (1999), the foundation of almost every GIS database: each geometry inside PostGIS, MySQL Spatial or GeoPackage is WKB. The format is several times more compact than textual WKT because coordinates are packed into doubles without ASCII. Our exporter writes the geometries of the selected OSM layers into a .wkb file: every object is standard OGC WKB, but the file is a container — an 8-byte header (a WKB marker plus the number of objects), then geometries with a length prefix, while the coordinate system lies in a companion .prj file. Honestly: to parse the file you have to read the header and the lengths — this is not a single "bare" blob for a direct ST_GeomFromWKB. Attributes are not preserved, and all the selected layers are merged into one stream of geometries (up to 500,000 objects).
주요 기능
WKB 형식 소개
WKB is the binary encoding of geometry from the OGC Simple Features standard: byte order, a shape type code and coordinates as double-precision numbers. Inside PostGIS, GeoPackage and SpatiaLite geometry is stored exactly like this, which is why WKB is read and written by every spatial library — Shapely, GEOS, JTS, GDAL.
This export is taken by people writing their own pipeline: parsing without going through text, loading into a database, testing their own implementation of the standard, compact transfer of geometry between services.
You need to know how the file is arranged in advance. This is not one "bare" geometry but a container: eight bytes of header (a WKB marker and the number of objects), then geometries one after another, each preceded by its length. The geometries themselves are standard OGC WKB and can be fed into ST_GeomFromWKB one by one once the container is parsed. The coordinate system lies in a neighboring .prj file in text form.
The limits: OpenStreetMap attributes are not preserved — geometry only, and all the selected layers are merged into a single stream with no separation. The ceiling is 500,000 geometries. If you need names, tags and layers, take GeoPackage, FlatGeobuf or GeoJSON.
WKB 파일을 여는 프로그램
다음 프로그램과 애플리케이션으로 OSM2CDR에서 내보낸 Well-Known Binary (OGC)(.wkb) 파일을 열고 편집하고 작업할 수 있습니다:
Format specifications
- Open standard
- 2D only
- Lossless (no quality loss)
- No attributes
- Output: 1 file
- An OGC WKB container: an 8-byte header then length-prefixed per-feature geometries, with the CRS in a companion .prj; not a single bare blob, multiple layers as a ZIP.
WKB 지도 사용자
WKB 내보내기 방법
내보낸 뒤 여는 방법
- Python — read the 8 bytes of the header, then loop: 4 bytes of length and that many bytes of geometry, each through shapely.wkb.loads(); you end up with an ordinary list of Shapely objects.
- PostGIS — load the geometries one at a time: ST_GeomFromWKB(%s, 4326) accepts a chunk unpacked from the container as is.
- The .prj file — do not lose it when moving things around: it records the coordinate system, and without it the receiving side will be guessing.
- GDAL and QGIS — they will not open this container as a ready layer; if you need a layer out of the box, take GeoPackage or FlatGeobuf.
- Checking — compare the number of objects from the header with how many geometries you parsed: a mismatch means the file was not read to the end.
WKB 형식의 인기 지도
Well-Known Binary (OGC) 지도 내보내기 받기
OpenStreetMap에서 전문가용 WKB 지도를 다운로드하세요. 즉시 생성, 모든 영역 지원.