Skip to content

GeoJSON geometry encoding and decoding for CoMapeo

License

Notifications You must be signed in to change notification settings

digidem/comapeo-geometry

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

71e08c2 · Nov 27, 2024

History

22 Commits
Sep 4, 2024
Sep 3, 2024
Nov 26, 2024
Sep 3, 2024
Nov 27, 2024
Nov 27, 2024
Sep 3, 2024
Sep 4, 2024
Sep 4, 2024
Sep 4, 2024
Sep 3, 2024
Sep 3, 2024
Sep 3, 2024
Sep 4, 2024
Sep 30, 2024
Sep 30, 2024
Sep 3, 2024

Repository files navigation

CoMapeo Geometry Encoding

GeoJSON geometry encoding and decoding to/from protobufs for CoMapeo.

This repo contains a protobuf definition and encoding/decoding functions for a subset GeoJSON geometry objects. It is used by the CoMapeo project to encode and decode geometries.

Encoding Format

The encoding format is inspired by Geobuf, with some changes which prioritize simplicity over optimization and compactness:

  • Coordinates are encoding as double in original precision instead of Geobuf's sint64 and rounded to 6 decimal places.
  • For polygons and multipolygons, the last position is repeated in the encoded protobuf. Geobuf optimizes storage by skipping the repeated last position.
  • Only supports Geometry objects, not Feature objects.

The subset of GeoJSON geometries supported are:

  • Only Point, Polygon, MultiPoint and MultiPolygon are supported.
  • Only 2D positions (coordinates) are supported.
  • No support for bbox.

Future versions may support more geometry types and 3D positions.