{"id":32290390,"url":"https://github.com/navibyte/geospatial","last_synced_at":"2025-10-23T02:51:11.632Z","repository":{"id":41962791,"uuid":"316956845","full_name":"navibyte/geospatial","owner":"navibyte","description":"Geospatial data structures, tools and utilities for Dart and Flutter.","archived":false,"fork":false,"pushed_at":"2024-04-22T09:27:41.000Z","size":4142,"stargazers_count":46,"open_issues_count":10,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-04-22T10:33:10.734Z","etag":null,"topics":["api","dart","geojson","geometry","geospatial","gis","ogc","ogc-api","spherical-geometry","web-mercator","wgs84","wkb","wkt"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navibyte.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-29T13:26:29.000Z","updated_at":"2024-07-25T13:09:30.635Z","dependencies_parsed_at":"2023-10-13T16:02:51.955Z","dependency_job_id":"4815f323-e69d-4102-a133-5ceb6a269af3","html_url":"https://github.com/navibyte/geospatial","commit_stats":{"total_commits":793,"total_committers":2,"mean_commits":396.5,"dds":"0.030264817150063017","last_synced_commit":"2ed5bbd9dbf43d006545cab8aa879ad9227e9125"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/navibyte/geospatial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navibyte%2Fgeospatial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navibyte%2Fgeospatial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navibyte%2Fgeospatial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navibyte%2Fgeospatial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navibyte","download_url":"https://codeload.github.com/navibyte/geospatial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navibyte%2Fgeospatial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280551628,"owners_count":26349596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","dart","geojson","geometry","geospatial","gis","ogc","ogc-api","spherical-geometry","web-mercator","wgs84","wkb","wkt"],"created_at":"2025-10-23T02:51:10.729Z","updated_at":"2025-10-23T02:51:11.626Z","avatar_url":"https://github.com/navibyte.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :compass: Geospatial tools for Dart \n\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/navibyte.svg?style=social\u0026label=Follow%20%40navibyte)](https://twitter.com/navibyte) [![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis) \n\n\u003ca title=\"Stefan Kühn (Fotograf), CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:Azimutalprojektion-schief_kl-cropped.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/projections/azimutal/Azimutalprojektion-schief_kl-cropped.png\" align=\"right\"\u003e\u003c/a\u003e\n\n**Geospatial** data structures, tools and utilities for \n[Dart](https://dart.dev/) and [Flutter](https://flutter.dev/) - coordinates,\ngeometries, feature objects, metadata, spherical geodesy, projections, tiling\nschemes, vector data models and formats, and geospatial Web APIs.\n\nRead the docs 👉 [geospatial.navibyte.dev](https://geospatial.navibyte.dev/)! \n\n[![Dart](https://img.shields.io/badge/dart-%230175C2.svg?style=for-the-badge\u0026logo=dart\u0026logoColor=white)](https://dart.dev/) [![Flutter](https://img.shields.io/badge/Flutter-%2302569B.svg?style=for-the-badge\u0026logo=Flutter\u0026logoColor=white)](https://flutter.dev/)\n\n🗺️ [Roadmap 2025: The current state and candidate issues for the geobase package](https://github.com/navibyte/geospatial/issues/254).\n\n✨ New (2025-03-11): The stable version 1.5.0 with [global grids](https://geospatial.navibyte.dev/v1/geobase/global-grids/), better WGS84 [projection](https://geospatial.navibyte.dev/v1/geobase/projections/) support and [unit conversions](https://geospatial.navibyte.dev/v1/geobase/unit-conversions/).\n\n✨ New (2024-11-10): The stable release with [ellipsoidal geodesy functions](https://geospatial.navibyte.dev/v1/geobase/ellipsoidal-geodesy/) letting you calculate distances, bearings, destination positions and intermediate points along the Earth surface accurately.\n\n✨ New (2024-07-26): The stable version 1.3.0 with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)!\n\n## :package: Packages\n\n[Dart](https://dart.dev/) code packages published at \n[pub.dev](https://pub.dev/publishers/navibyte.com/packages):\n\nCode           | Package | Description \n-------------- | --------| -----------\n:globe_with_meridians: [geobase](dart/geobase) | [![pub package](https://img.shields.io/pub/v/geobase.svg)](https://pub.dev/packages/geobase) | Geospatial data structures (coordinates, geometries, features, metadata), ellipsoidal and spherical geodesy, projections and tiling schemes. Vector data format support for [GeoJSON](https://geojson.org/), [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) and [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary).\n:earth_americas: [geodata](dart/geodata) | [![pub package](https://img.shields.io/pub/v/geodata.svg)](https://pub.dev/packages/geodata) | Geospatial feature service Web APIs with support for [GeoJSON](https://geojson.org/) and [OGC API Features](https://ogcapi.ogc.org/features/) clients.\n\n## 📚 Documentation\n\nComprehensive guidance on how to use package and about\n*Geospatial tools for Dart* is available on the\n[geospatial.navibyte.dev](https://geospatial.navibyte.dev/) website.\n\nOverview topics about *Geospatial tools for Dart*:\n\n* [⛳️ Getting started](https://geospatial.navibyte.dev/v1/start/)\n* [📖 Introduction](https://geospatial.navibyte.dev/v1/start/intro/)\n* [💼 Code project](https://geospatial.navibyte.dev/reference/project/)\n* [📚 API documentation](https://geospatial.navibyte.dev/reference/api/)\n\nThe [geobase](https://geospatial.navibyte.dev/v1/geobase/)\npackage documentation by chapters:\n\n* [📍 Coordinates](https://geospatial.navibyte.dev/v1/geobase/coordinates/)\n* [🧩 Simple geometries](https://geospatial.navibyte.dev/v1/geobase/geometry/)\n* [📏 Geometry calculations](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)\n* [🔷 Geospatial features](https://geospatial.navibyte.dev/v1/geobase/features/)\n* [📃 Vector formats](https://geospatial.navibyte.dev/v1/geobase/formats/)\n* [🔵 Ellipsoidal geodesy](https://geospatial.navibyte.dev/v1/geobase/ellipsoidal-geodesy/)\n* [📐 Spherical geodesy](https://geospatial.navibyte.dev/v1/geobase/spherical-geodesy/)\n* [📅 Metadata](https://geospatial.navibyte.dev/v1/geobase/metadata/)\n* [🌐 Global grids](https://geospatial.navibyte.dev/v1/geobase/global-grids/)\n* [🗺️ Projections](https://geospatial.navibyte.dev/v1/geobase/projections/)\n* [🔢 Tiling schemes](https://geospatial.navibyte.dev/v1/geobase/tiling-schemes/)\n* [⚖️ Unit conversions](https://geospatial.navibyte.dev/v1/geobase/unit-conversions/)\n\nThe [geodata](https://geospatial.navibyte.dev/v1/geodata/)\npackage documentation by chapters:\n\n* [🌐 GeoJSON Web API client](https://geospatial.navibyte.dev/v1/geodata/geojson-client/)\n* [🌎 OGC API Features client](https://geospatial.navibyte.dev/v1/geodata/ogcfeat-client/)\n\n## :sparkles: Features\n\nKey features of the [geobase](https://pub.dev/packages/geobase) package:\n\n* 🌐 geographic (longitude-latitude) and projected positions and bounding boxes\n* 🧩 simple geometries (point, line string, polygon, multi point, multi line string, multi polygon, geometry collection)\n* 📏 cartesian 2D calculations (centroid, polylabel, point-in-polygon, distance).\n* 🔷 features (with id, properties and geometry) and feature collections\n* 📐 ellipsoidal (*vincenty*) and spherical (*great circle*, *rhumb line*) geodesy tools, with ellipsoidal datum, [UTM](https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system), [MGRS](https://en.wikipedia.org/wiki/Military_Grid_Reference_System) and ECEF (earth-centric earth-fixed) support\n* 📅 temporal data structures (instant, interval) and spatial extents\n* 📃 vector data formats supported ([GeoJSON](https://geojson.org/), [Newline-delimited GeoJSON](https://stevage.github.io/ndgeojson/), [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry), [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary)\n)\n* 🗺️ coordinate projections (built-in WGS84 based projections on geographic, geocentric, UTM and Web Mercator coordinates + external [proj4dart](https://pub.dev/packages/proj4dart) support)\n* 🔢 tiling schemes and tile matrix sets (web mercator, global geodetic)\n* ⚖️ unit conversions (angle, angular velocity, area, distance, speed and time)\n\nKey features of the [geodata](https://pub.dev/packages/geodata) package:\n\n* 🪄 Client-side data source abstraction for geospatial feature service Web APIs.\n* 🌐 The [GeoJSON](https://geojson.org/) client to read features from static web resources and local files, supports also [Newline-delimited GeoJSON](https://stevage.github.io/ndgeojson/) data.\n* 🌎 The [OGC API Features](https://ogcapi.ogc.org/features/) client to access metadata and feature items from a compliant geospatial Web API providing GeoJSON data.\n\nClient-side support for the OGC API Features standard:\n\nStandard part | Support in this package\n------------- | -----------------------\n[OGC API - Features - Part 1: Core](https://docs.ogc.org/is/17-069r4/17-069r4.html) | Supported for accessing metadata and GeoJSON feature collections.\n[OGC API - Features - Part 2: Coordinate Reference Systems by Reference](https://docs.ogc.org/is/18-058r1/18-058r1.html) | Supported.\n[OGC API - Features - Part 3: Filtering](https://docs.ogc.org/is/19-079r2/19-079r2.html)\u003cbr/\u003e[Common Query Language (CQL2)](https://docs.ogc.org/is/21-065r2/21-065r2.html) | Partially supported (conformance classes, queryables, features filter).\n\n## :keyboard: Sample code\n\n### Geodesy functions with geobase\n\n*Ellipsoidal* and *spherical* geodesy functions to calculate distances etc.:\n\n```dart\n  final greenwich = Geographic.parseDms(lat: '51°28′40″ N', lon: '0°00′05″ W');\n  final sydney = Geographic.parseDms(lat: '33.8688° S', lon: '151.2093° E');\n\n  // How to calculate distances using ellipsoidal Vincenty, spherical\n  // great-circle and spherical rhumb line methods is shown first.\n\n  // The distance along a geodesic on the ellipsoid surface (16983.3 km).\n  greenwich.vincenty().distanceTo(sydney);\n\n  // By default the WGS84 reference ellipsoid is used but this can be changed.\n  greenwich.vincenty(ellipsoid: Ellipsoid.GRS80).distanceTo(sydney);\n\n  // The distance along a spherical great-circle path (16987.9 km).\n  greenwich.spherical.distanceTo(sydney);\n\n  // The distance along a spherical rhumb line path (17669.8 km).\n  greenwich.rhumb.distanceTo(sydney);\n\n  // Also bearings, destination points and mid points (or intermediate points)\n  // are provided for all methods, but below shown only for great-circle paths.\n\n  // Destination point (10 km to bearing 61°): 51° 31.3′ N, 0° 07.5′ E\n  greenwich.spherical.initialBearingTo(sydney);\n  greenwich.spherical.finalBearingTo(sydney);\n\n  // Destination point: 51° 31.3′ N, 0° 07.5′ E\n  greenwich.spherical.destinationPoint(distance: 10000, bearing: 61.0);\n\n  // Midpoint: 28° 34.0′ N, 104° 41.6′ E\n  greenwich.spherical.midPointTo(sydney);\n\n  // Vincenty ellipsoidal geodesy functions provide also `inverse` and `direct`\n  // methods to calculate shortest arcs along a geodesic on the ellipsoid. The\n  // returned arc object contains origin and destination points, initial and\n  // final bearings, and distance between points.\n  greenwich.vincenty().inverse(sydney);\n  greenwich.vincenty().direct(distance: 10000, bearing: 61.0);\n```\n\n### Geospatial data structures with geobase\n\nAs a quick sample, this is how geometry objects with 2D coordinate are created\nusing [geobase](https://pub.dev/packages/geobase):\n\nGeometry    | Shape       | Dart code to build objects\n----------- | ----------- | --------------------------\nPoint       | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_Point.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_Point.svg\"\u003e\u003c/a\u003e | `Point.build([30.0, 10.0])`\nLineString  | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_LineString.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_LineString.svg\"\u003e\u003c/a\u003e | `LineString.build([30, 10, 10, 30, 40, 40])`\nPolygon     | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_Polygon.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_Polygon.svg\"\u003e\u003c/a\u003e | `Polygon.build([[30, 10, 40, 40, 20, 40, 10, 20, 30, 10]])`\nPolygon (with a hole) | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_Polygon_with_hole.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_Polygon_with_hole.svg\"\u003e\u003c/a\u003e | `Polygon.build([[35, 10, 45, 45, 15, 40, 10, 20, 35, 10], [20, 30, 35, 35, 30, 20, 20, 30]])`\nMultiPoint  | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_MultiPoint.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_MultiPoint.svg\"\u003e\u003c/a\u003e | `MultiPoint.build([[10, 40], [40, 30], [20, 20], [30, 10]])`\nMultiLineString  | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_MultiLineString.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_MultiLineString.svg\"\u003e\u003c/a\u003e | `MultiLineString.build([[10, 10, 20, 20, 10, 40], [40, 40, 30, 30, 40, 20, 30, 10]])`\nMultiPolygon | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_MultiPolygon.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_MultiPolygon.svg\"\u003e\u003c/a\u003e | `MultiPolygon.build([[[30, 20, 45, 40, 10, 40, 30, 20]], [[15, 5, 40, 10, 10, 20, 5, 10, 15, 5]]])`\nMultiPolygon (with a hole) | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_MultiPolygon_with_hole.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_MultiPolygon_with_hole.svg\"\u003e\u003c/a\u003e | `MultiPolygon.build([[[40, 40, 20, 45, 45, 30, 40, 40]], [[20, 35, 10, 30, 10, 10, 30, 5, 45, 20, 20, 35], [30, 20, 20, 15, 20, 25, 30, 20]]])`\nGeometryCollection | \u003ca title=\"Mwtoews, CC BY-SA 3.0 \u0026lt;https://creativecommons.org/licenses/by-sa/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:SFA_GeometryCollection.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial_docs/v2023-08-12/assets/doc/data/features/SFA_GeometryCollection.svg\"\u003e\u003c/a\u003e | `GeometryCollection([Point.build([30.0, 10.0]), LineString.build([10, 10, 20, 20, 10, 40]), Polygon.build([[40, 40, 20, 45, 45, 30, 40, 40]])])`\n\nGeospatial feature and feature collections can be instantiated easily too:\n\n```dart\n  // A geospatial feature collection (with two features):\n  FeatureCollection([\n    Feature(\n      id: 'ROG',\n      // a point geometry with a position (lon, lat, elev)\n      geometry: Point.build([-0.0014, 51.4778, 45.0]),\n      properties: {\n        'title': 'Royal Observatory',\n        'city': 'London',\n        'isMuseum': true,\n      },\n    ),\n    Feature(\n      id: 'TB',\n      // a point geometry with a position (lon, lat)\n      geometry: Point.build([-0.075406, 51.5055]),\n      properties: {\n        'title': 'Tower Bridge',\n        'built': 1886,\n      },\n    ),\n  ]);\n```\n\n### GeoJSON, WKT and WKB with geobase\n\nMore details in the article (2024-04-14) [Decode and encode GeoJSON, WKT and WKB in Dart and Flutter apps](https://medium.com/@navibyte/decode-and-encode-geojson-wkt-and-wkb-in-dart-and-flutter-apps-ab2ef4ece2f1).\n\nGeoJSON, WKT and WKB formats are supported as input and output:\n\n```dart\n  // Parse a geometry from GeoJSON text.\n  final geometry = LineString.parse(\n    '{\"type\": \"LineString\", \"coordinates\": [[30,10],[10,30],[40,40]]}',\n    format: GeoJSON.geometry,\n  );\n\n  // Encode a geometry as GeoJSON text.\n  print(geometry.toText(format: GeoJSON.geometry));\n\n  // Encode a geometry as WKT text.\n  print(geometry.toText(format: WKT.geometry));\n\n  // Encode a geometry as WKB bytes.\n  final bytes = geometry.toBytes(format: WKB.geometry);\n\n  // Decode a geometry from WKB bytes.\n  LineString.decode(bytes, format: WKB.geometry);\n```\n\nA sample showing more deeply how to handle WKB and EWKB binary data:\n\n```dart\n  // to get a sample point, first parse a 3D point from WKT encoded string\n  final p = Point.parse('POINT Z(-0.0014 51.4778 45)', format: WKT.geometry);\n\n  // to encode a geometry as WKB/EWKB use toBytes() or toBytesHex() methods\n\n  // encode as standard WKB data (format: `WKB.geometry`), prints:\n  // 01e9030000c7bab88d06f056bfb003e78c28bd49400000000000804640\n  final wkbHex = p.toBytesHex(format: WKB.geometry);\n  print(wkbHex);\n\n  // encode as Extended WKB data (format: `WKB.geometryExtended`), prints:\n  // 0101000080c7bab88d06f056bfb003e78c28bd49400000000000804640\n  final ewkbHex = p.toBytesHex(format: WKB.geometryExtended);\n  print(ewkbHex);\n\n  // otherwise encoded data equals, but bytes for the geometry type varies\n\n  // there are some helper methods to analyse WKB/EWKB bytes or hex strings\n  // (decodeFlavor, decodeEndian, decodeSRID and versions with hex postfix)\n\n  // prints: \"WkbFlavor.standard - WkbFlavor.extended\"\n  print('${WKB.decodeFlavorHex(wkbHex)} - ${WKB.decodeFlavorHex(ewkbHex)}');\n\n  // when decoding WKB or EWKB data, a variant is detected automatically, so\n  // both `WKB.geometry` and `WKB.geometryExtended` can be used\n  final pointFromWkb = Point.decodeHex(wkbHex, format: WKB.geometry);\n  final pointFromEwkb = Point.decodeHex(ewkbHex, format: WKB.geometry);\n  print(pointFromWkb.equals3D(pointFromEwkb)); // prints \"true\"\n\n  // SRID can be encoded only on EWKB data, this sample prints:\n  // 01010000a0e6100000c7bab88d06f056bfb003e78c28bd49400000000000804640\n  final ewkbHexWithSRID =\n      p.toBytesHex(format: WKB.geometryExtended, crs: CoordRefSys.EPSG_4326);\n  print(ewkbHexWithSRID);\n\n  // if you have WKB or EWKB data, but not sure which, then you can fist check\n  // a flavor and whether it contains SRID, prints: \"SRID from EWKB data: 4326\"\n  if (WKB.decodeFlavorHex(ewkbHexWithSRID) == WkbFlavor.extended) {\n    final srid = WKB.decodeSRIDHex(ewkbHexWithSRID);\n    if (srid != null) {\n      print('SRID from EWKB data: $srid');\n\n      // after finding out CRS, an actual point can be decoded\n      // Point.decodeHex(ewkbHexWithSRID, format: WKB.geometry);\n    }\n  }\n```\n\nUsing Newline-delimited GeoJSON (or \"GeoJSONL\") is as easy as using the\nstandard GeoJSON:\n\n```dart\n  /// a feature collection encoded as GeoJSONL and containing two features that\n  /// are delimited by the newline character \\n\n  const sample = '''\n    {\"type\":\"Feature\",\"id\":\"ROG\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-0.0014,51.4778,45]},\"properties\":{\"title\":\"Royal Observatory\",\"place\":\"Greenwich\"}}\n    {\"type\":\"Feature\",\"id\":\"TB\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-0.075406,51.5055]},\"properties\":{\"title\":\"Tower Bridge\",\"built\":1886}}\n    ''';\n\n  // parse a FeatureCollection object using the decoder for the GeoJSONL format\n  final collection = FeatureCollection.parse(sample, format: GeoJSONL.feature);\n\n  // ... use features read and returned in a feature collection object ...\n\n  // encode back to GeoJSONL data\n  print(collection.toText(format: GeoJSONL.feature, decimals: 5));\n```\n\n### Access GeoJSON resources with geodata\n\nThe [geodata](https://pub.dev/packages/geodata) package has the following\ndiagram describing a decision flowchart how to select a client class to access\nGeoJSON features:\n\n\u003cimg src=\"https://raw.githubusercontent.com/navibyte/geospatial/v0.12.0/dart/geodata/assets/diagrams/decision_flowchart.svg\" width=\"100%\" title=\"Decision flowchart to select a client class to access GeoJSON resources\" /\u003e\n\nQuick start code to access a Web API service conforming to OGC API Features:\n\n```dart\n// 1. Get a client instance for a Web API endpoint.\nfinal client = OGCAPIFeatures.http(endpoint: Uri.parse('...'));\n\n// 2. Access/check metadata (meta, OpenAPI, conformance, collections) as needed.\nfinal conformance = await client.conformance();\nif (!conformance.conformsToFeaturesCore(geoJSON: true)) {\n  return; // not conforming to core and GeoJSON - so return\n}\n\n// 3. Get a feature source for a specific collection.\nfinal source = await client.collection('my_collection');\n\n// 4. Access (and check) metadata for this collection.\nfinal meta = await source.meta();\nprint('Collection title: ${meta.title}');\n\n// 5. Access feature items.\nfinal items = await source.itemsAll(limit: 100);\n\n// 6. Check response metadata.\nprint('Timestamp: ${items.timeStamp}');\n\n// 7. Get an iterable of feature objects.\nfinal features = items.collection.features;\n\n// 8. Loop through features (each with id, properties and geometry)\nfor (final feat in features) {\n  print('Feature ${feat.id} with geometry: ${feat.geometry}');\n}\n```\n\n## :rocket: Demos and samples\n\nMore guidance and code examples are provided on the\n[geospatial.navibyte.dev](https://geospatial.navibyte.dev/) documentation site.\n\n✨ See also the\n[Geospatial demos for Dart](https://github.com/navibyte/geospatial_demos) code\nrepository for demo and sample apps demonstrating the usage of\n[geobase](https://pub.dev/packages/geobase) and\n[geodata](https://pub.dev/packages/geodata) packages along with other topics.\n\nCode          | Description \n------------- | -----------\n[earthquake_map](https://github.com/navibyte/geospatial_demos/tree/main/earthquake_map) | Shows earthquakes fetched from the [USGS web service](https://earthquake.usgs.gov/earthquakes/feed/) on a basic map view. The demo uses both [geobase](https://pub.dev/packages/geobase) and [geodata](https://pub.dev/packages/geodata) packages for geospatial data accesss. Discusses also state management based on [Riverpod](https://riverpod.dev/). The map UI is based on the [Google Maps Flutter](https://pub.dev/packages/google_maps_flutter) plugin.\n\n## :newspaper_roll: News\n\n2025-03-11\n* ✨ The stable version 1.5.0 with [global grids](https://geospatial.navibyte.dev/v1/geobase/global-grids/), better WGS84 [projection](https://geospatial.navibyte.dev/v1/geobase/projections/) support and [unit conversions](https://geospatial.navibyte.dev/v1/geobase/unit-conversions/).\n* All docs: [geospatial.navibyte.dev](https://geospatial.navibyte.dev/).\n* Published packages at pub.dev:\n  * [geobase version 1.5.0](https://pub.dev/packages/geobase/versions/1.5.0)\n\n2024-11-10\n* ✨ The stable release with [ellipsoidal geodesy functions](https://geospatial.navibyte.dev/v1/geobase/ellipsoidal-geodesy/) letting you calculate distances, bearings, destination positions and intermediate points along the Earth surface accurately.\n* All docs: [geospatial.navibyte.dev](https://geospatial.navibyte.dev/).\n* Published packages at pub.dev:\n  * [geobase version 1.4.0](https://pub.dev/packages/geobase/versions/1.4.0+1)\n  * [geodata version 1.3.0](https://pub.dev/packages/geodata/versions/1.3.0)\n\n2024-07-26\n* ✨ The [stable version 1.3.0](https://github.com/navibyte/geospatial/milestone/5) with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)!\n* All docs: [geospatial.navibyte.dev](https://geospatial.navibyte.dev/).\n* Published packages at pub.dev:\n  * [geobase version 1.3.0](https://pub.dev/packages/geobase/versions/1.3.0)\n\n2024-05-26\n* ✨ The stable version 1.2.0 with the brand new documentation site published at [geospatial.navibyte.dev](https://geospatial.navibyte.dev/).\n* Published packages at pub.dev:\n  * [geobase version 1.2.0](https://pub.dev/packages/geobase/versions/1.2.0)\n  * [geodata version 1.2.1](https://pub.dev/packages/geodata/versions/1.2.1)\n\n2024-04-22\n* ✨ The [stable version 1.1.0](https://github.com/navibyte/geospatial/milestone/1) adds support for Newline-delimited GeoJSON, EWKT and EWKB.\n* See also the article [Decode and encode GeoJSON, WKT and WKB in Dart and Flutter apps](https://medium.com/@navibyte/decode-and-encode-geojson-wkt-and-wkb-in-dart-and-flutter-apps-ab2ef4ece2f1).\n* Published packages at pub.dev:\n  * [geobase version 1.1.0](https://pub.dev/packages/geobase/versions/1.1.0)\n  * [geodata version 1.1.0](https://pub.dev/packages/geodata/versions/1.1.0)\n\n2023-10-29\n* ✨ The stable version 1.0.0 is now ready. See also the article [Geospatial tools for Dart - version 1.0 published](https://medium.com/@navibyte/geospatial-tools-for-dart-version-1-0-published-0f9673e510b3) at Medium\n* [geobase version 1.0.0](https://github.com/navibyte/geospatial/issues/175)\n* [geodata version 1.0.0](https://github.com/navibyte/geospatial/issues/187)\n\nSee also older news in the [changelog](CHANGELOG.md) of this repository.\n\n## :building_construction: Roadmap\n\n🗺️ [Roadmap 2025: The current state and candidate issues for the geobase package](https://github.com/navibyte/geospatial/issues/254).\n\n🧩 See [open issues](https://github.com/navibyte/geospatial/issues) for planned features, requests for change, and observed bugs.\n\n💡 Any comments, questions, suggestions of new features and other other contributions are welcome, of course!\n\n📚 Documentation: [geospatial.navibyte.dev](https://geospatial.navibyte.dev/)\n\n🪄 Active packages in this repository: \n* [geobase](https://pub.dev/packages/geobase) \n* [geodata](https://pub.dev/packages/geodata) \n\n⚠️ Not active packages in this repository:\n* [geocore](https://pub.dev/packages/geocore)\n\n## :house_with_garden: Authors\n\nThis project is authored by [Navibyte](https://navibyte.com).\n\n## :copyright: License\n\n### The project\n\nThis project is licensed under the \"BSD-3-Clause\"-style license.\n\nPlease see the [LICENSE](LICENSE).\n\n### Included derivative work\n\nThis project contains portions of derivative work: \n\n* [geobase](dart/geobase): details about [DERIVATIVE](dart/geobase/DERIVATIVE.md) work.\n\nSource repositories used when porting functionality to Dart and this project:\n* [geodesy](https://github.com/chrisveness/geodesy) by Chris Veness 2002-2024\n* [polylabel](https://github.com/mapbox/polylabel) by Mapbox 2016-2024\n* [tinyqueue](https://github.com/mourner/tinyqueue) by Vladimir Agafonkin 2017-2024\n\n## :star: Links and other resources\n\nSome external links and other resources.\n\n### Geospatial data formats and APIs\n\nGeospatial:\n* [GeoJSON](https://geojson.org/) based on [RFC 7946](https://tools.ietf.org/html/rfc7946)\n* [Newline-delimited GeoJSON](https://stevage.github.io/ndgeojson/) with variants specified elsewhere:\n  * [GeoJSONL](https://www.interline.io/blog/geojsonl-extracts/)\n  * [GeoJSON Text Sequences](https://datatracker.ietf.org/doc/html/rfc8142)\n* [Simple Feature Access - Part 1: Common Architecture](https://www.ogc.org/standards/sfa)\n* [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) (Well-known text representation of geometry)  \n* [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary) (Well-known binary)\n* [Coordinate Reference Systems](https://www.w3.org/2015/spatial/wiki/Coordinate_Reference_Systems) by W3C\n* [EPSG](https://epsg.org/home.html) (Geodetic Parameter Dataset)\n* [World Geodetic System](https://en.wikipedia.org/wiki/World_Geodetic_System), see also [EPSG:4326](https://epsg.io/4326) about WGS 84\n* [Web Mercator projection](https://en.wikipedia.org/wiki/Web_Mercator_projection), see also [EPSG:3857](https://epsg.io/3857) and [Bing Maps Tile System](https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system)\n* [Geographic coordinate conversion](https://en.wikipedia.org/wiki/Geographic_coordinate_conversion)\n* [Geodetic datum](https://en.wikipedia.org/wiki/Geodetic_datum)\n* [Ellipsoid](https://en.wikipedia.org/wiki/Ellipsoid)\n* [Geodesic](https://en.wikipedia.org/wiki/Geodesic)\n* [Geodesic on ellipsoid](https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid)\n* [Helmert transformation](en.wikipedia.org/wiki/Helmert_transformation)\n* [ECEF](https://en.wikipedia.org/wiki/Earth-centered,_Earth-fixed_coordinate_system) (Earth-centered, Earth-fixed coordinate system)\n* [UTM](https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system) (Universal Transverse Mercator)\n* [MGRS](https://en.wikipedia.org/wiki/Military_Grid_Reference_System) (Military Grid Reference System)\n* [ISO 6709](https://en.wikipedia.org/wiki/ISO_6709) on standard representation of geographic point location by coordinates\n\nOGC (The Open Geospatial Consortium) related:\n* [OGC APIs](https://ogcapi.ogc.org/)\n  * [OGC API Common](https://ogcapi.ogc.org/common/)\n  * [OGC API Features](https://ogcapi.ogc.org/features/)\n  * [OGC API Features - demo services](https://github.com/opengeospatial/ogcapi-features/tree/master/implementations)\n  * [OGC API Features - github resources](https://github.com/opengeospatial/ogcapi-features)\n  * [OGC API Features - schemas](http://schemas.opengis.net/ogcapi/features/)\n* [OGC Web API Guidelines](https://github.com/opengeospatial/OGC-Web-API-Guidelines)\n* [Simple Feature Access - Part 1: Common Architecture](https://www.ogc.org/standards/sfa)\n* [OGC Two Dimensional Tile Matrix Set](https://docs.opengeospatial.org/is/17-083r2/17-083r2.html)\n\nW3C\n* [Spatial Data on the Web Best Practices](https://www.w3.org/TR/sdw-bp/)\n  * [Spatial Things, Features and Geometry](https://www.w3.org/TR/sdw-bp/#spatial-things-features-and-geometry)\n\nThe OpenAPI Initiative (OAI) \n* [OpenAPI home](https://www.openapis.org/)\n* [OpenAPI specification - latest](https://spec.openapis.org/oas/latest.html)\n\n### Dart and Flutter programming\n\nSDKs:\n* [Dart](https://dart.dev/)\n* [Flutter](https://flutter.dev/) \n\nLatest on Dart SDKs\n* [Dart 3.7](https://medium.com/dartlang/announcing-dart-3-7-bf864a1b195c) with developer productivity enhancements.\n* [Dart 3.6](https://medium.com/dartlang/announcing-dart-3-6-778dd7a80983) with digit separators and new features in the pub ecosystem (pub download counts and pub workspaces)\n* [Dart 3.5](https://medium.com/dartlang/dart-3-5-6ca36259fa2f) with improvements in interoperability and an update on the Dart roadmap.\n* [Dart 3.4](https://medium.com/dartlang/dart-3-4-bd8d23b4462a) with WebAssembly (WASM) updates and the roadmap for Dart *macros*. \n* [Dart 3.3](https://medium.com/dartlang/dart-3-3-325bf2bf6c13) with extension types,  evolving JavaScript-interoperability and experimental support for WebAssembly.\n* [Dart 3.2](https://medium.com/dartlang/dart-3-2-c8de8fe1b91f) with improved language \u0026 developer experience.\n* [Dart 3](https://medium.com/dartlang/announcing-dart-3-53f065a10635) with 100% sound null safety, new features (records, patterns, and class modifiers), and a peek into the future.\n* [Dart 3 alpha](https://medium.com/dartlang/dart-3-alpha-f1458fb9d232) with records, patterns, access controls, portability advancements and the new Dart 3 type system (100% sound null safety)\n* [Dart 2.18](https://medium.com/dartlang/dart-2-18-f4b3101f146c) with Objective-C \u0026 Swift interop, and improved type inference\n* [Dart 2.17](https://medium.com/dartlang/dart-2-17-b216bfc80c5d) with enum member support, parameter forwarding to super classes, flexibility for named parameters, and more\n* [Dart 2.16](https://medium.com/dartlang/dart-2-16-improved-tooling-and-platform-handling-dd87abd6bad1) with improved tooling and platform handling\n* [Dart 2.15](https://medium.com/dartlang/dart-2-15-7e7a598e508a) with fast concurrency, constructor tear-offs, improved enums, and more\n* [Dart 2.14](https://medium.com/dartlang/announcing-dart-2-14-b48b9bb2fb67) with Apple Silicon support, default lints etc.\n* [Dart 2.13](https://medium.com/dartlang/announcing-dart-2-13-c6d547b57067) with new type aliases and more\n* [Dart 2.12](https://medium.com/dartlang/announcing-dart-2-12-499a6e689c87) with sound null safety\n\nLatest on Flutter SDKs\n* [Flutter 3.29](https://medium.com/flutter/whats-new-in-flutter-3-29-f90c380c2317) running on Dart 3.7 and with updates to Impeller, Cupertino and DevTools.\n* [Flutter 3.27](https://medium.com/flutter/whats-new-in-flutter-3-27-28341129570c) running on Dart 3.6 and with enhanced Impeller and improvements to Cupertino widgets.\n* [Flutter 3.24](https://medium.com/flutter/whats-new-in-flutter-3-24-6c040f87d1e4) running on Dart 3.5 and with Multi-View Embedding and preview on Flutter GPU. \n* [Flutter 3.22](https://medium.com/flutter/whats-new-in-flutter-3-22-fbde6c164fe3) running on Dart 3.4 and stable support for WebAssembly (WASM), Graphics rendering enhancements, and AI updates.\n* [Flutter 3.19](https://medium.com/flutter/whats-new-in-flutter-3-19-58b1aae242d2) running on Dart 3.3 and Gemini API integration, Impeller updates, and Windows Arm64 support.\n* [Flutter 3.16](https://medium.com/flutter/whats-new-in-flutter-3-16-dba6cb1015d1) running on Dart 3.2 and with Material 3 by default, Impeller preview for Android, etc.\n* [Flutter 3.13](https://medium.com/flutter/whats-new-in-flutter-3-13-479d9b11df4d) running on Dart 3.1 and with new 2D scrolling widgets and faster graphics.\n* [Flutter 3.10](https://medium.com/flutter/whats-new-in-flutter-3-10-b21db2c38c73) running on Dart 3 and with seamless web and mobile integration, and stable Impleller for iOS.\n* [Flutter 3.7](https://medium.com/flutter/whats-new-in-flutter-3-7-38cbea71133c) with Material 3 updates and iOS improvements\n* [Flutter 3.3](https://medium.com/flutter/announcing-flutter-3-3-at-flutter-vikings-6f213e068793)\n  * [What’s New in Flutter 3.3](https://medium.com/flutter/whats-new-in-flutter-3-3-893c7b9af1ff)\n* [Flutter 3](https://medium.com/flutter/introducing-flutter-3-5eb69151622f)\n\nPackages\n* [pub.dev](https://pub.dev/)\n\nDart 3 migration\n* [Dart 3 migration guide](https://dart.dev/resources/dart-3-migration)\n\nNull-safety (Dart 2):\n* Dart [null-safety](https://dart.dev/null-safety)\n* The official [null-safety migration guide](https://dart.dev/null-safety/migration-guide)\n* [Preparing the Dart and Flutter ecosystem for null safety](https://medium.com/dartlang/preparing-the-dart-and-flutter-ecosystem-for-null-safety-e550ce72c010)\n\nGuidelines\n* [Effective Dart](https://dart.dev/guides/language/effective-dart)\n\nRoadmaps\n* [Flutter roadmap](https://github.com/flutter/flutter/wiki/Roadmap)\n* [The road to Dart 3: A fully sound, null safe language](https://medium.com/dartlang/the-road-to-dart-3-afdd580fbefa)\n* [Dart language evolution](https://dart.dev/guides/language/evolution)\n* [Dart SDK milestones](https://github.com/dart-lang/sdk/milestones)\n* Waiting for [new features](https://github.com/dart-lang/language/projects/1) on the Dart [language](https://github.com/dart-lang/language) too ...\n  * [Patterns and related features #546](https://github.com/dart-lang/language/issues/546)\n  * [Type capability modifiers #2242](https://github.com/dart-lang/language/issues/2242)\n  * [Inline classes #2727](https://github.com/dart-lang/language/issues/2727)\n  * [Static metaprogramming #1482](https://github.com/dart-lang/language/issues/1482) with data classes\n\n### Dart and Flutter libraries\n\nThere are thousands of excellent libraries available at \n[pub.dev](https://pub.dev/).\n\nHere listed only those that are used (depended directly) by code packages of\nthis repository (on the latest release):\n\nPackage @ pub.dev | Code @ GitHub | Description\n----------------- | ------------- | -----------\n[http](https://pub.dev/packages/http) | [dart-lang/http](https://github.com/dart-lang/http) | A composable API for making HTTP requests in Dart.\n[meta](https://pub.dev/packages/meta) | [dart-lang/sdk](https://github.com/dart-lang/sdk/tree/master/pkg/meta) | This package defines annotations that can be used by the tools that are shipped with the Dart SDK.\n[proj4dart](https://pub.dev/packages/proj4dart) | [maRci002/proj4dart](https://github.com/maRci002/proj4dart) | Proj4dart is a Dart library to transform point coordinates from one coordinate system to another, including datum transformations (Dart version of proj4js/proj4js).\n[very_good_analysis](https://pub.dev/packages/very_good_analysis) | [VeryGoodOpenSource/very_good_analysis](https://github.com/VeryGoodOpenSource/very_good_analysis) | Lint rules for Dart and Flutter.\n\nIn some previous releases also following are utilized:\n\nPackage @ pub.dev | Code @ GitHub | Description\n----------------- | ------------- | -----------\n[collection](https://pub.dev/packages/collection) | [dart-lang/collection](https://github.com/dart-lang/collection) | Collections and utilities functions and classes related to collections. \n[equatable](https://pub.dev/packages/equatable) | [felangel/equatable](https://github.com/felangel/equatable) | Simplify Equality Comparisons | A Dart abstract class that helps to implement equality without needing to explicitly override == and hashCode.\n[synchronized](https://pub.dev/packages/synchronized) | [tekartik/synchronized.dart](https://github.com/tekartik/synchronized.dart/tree/master/synchronized) | Basic lock mechanism to prevent concurrent access to asynchronous code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavibyte%2Fgeospatial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavibyte%2Fgeospatial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavibyte%2Fgeospatial/lists"}