Skip to content

Package geom implements efficient geometry types for geospatial applications.

License

Notifications You must be signed in to change notification settings

twpayne/go-geom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 16, 2025
b22fd06 · Jan 16, 2025
Jan 16, 2025
Mar 12, 2024
Jan 16, 2025
Jan 16, 2025
Sep 5, 2022
Jul 12, 2019
Jan 16, 2025
Jan 16, 2025
Jan 16, 2025
Sep 5, 2022
Jul 12, 2019
Jan 16, 2025
Jul 27, 2016
Dec 2, 2015
Jul 24, 2022
Feb 24, 2021
Jan 16, 2025
Oct 30, 2023
Jun 18, 2020
Jan 16, 2025
Jan 16, 2025
Aug 18, 2024
Feb 24, 2021
Oct 30, 2023
Jan 16, 2025
Jan 16, 2025
Mar 12, 2024
Oct 30, 2023
May 7, 2020
Oct 30, 2023
May 20, 2020
Oct 30, 2023
Jan 16, 2025
Oct 30, 2023
Sep 7, 2020
Oct 30, 2023
Jun 24, 2020
Oct 30, 2023
May 7, 2020
Aug 18, 2024

Repository files navigation

go-geom

PkgGoDev Go Report Card

Package geom implements efficient geometry types for geospatial applications.

Key features

  • OpenGeo Consortium-style geometries.
  • Support for 2D and 3D geometries, measures (time and/or distance), and unlimited extra dimensions.
  • Encoding and decoding of common geometry formats (GeoJSON, KML, WKB, and others) including sql.Scanner and driver.Value interface implementations for easy database integration.
  • 2D and 3D topology functions.
  • Efficient, cache-friendly internal representation.
  • Optional protection against malicious or malformed inputs.

Examples

Detailed features

Geometry types

Encoding and decoding

Geometry functions

  • XY 2D geometry functions
  • XYZ 3D geometry functions

Protection against malicious or malformed inputs

The WKB and EWKB formats encode geometry sizes, and memory is allocated for those geometries. If the input is malicious or malformed, the memory allocation can be very large, leading to a memory starvation denial-of-service attack against the server. For example, a client might send a MultiPoint with header indicating that it contains 2^32-1 points. This will result in the server reading that geometry to allocate 2 × sizeof(float64) × (2^32-1) = 64GB of memory to store those points. By default, malicious or malformed input protection is disabled, but can be enabled by setting positive values for wkbcommon.MaxGeometryElements.

Related libraries

License

BSD-2-Clause