stablekernel / postgresql-dart

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.
https://www.dartdocs.org/documentation/postgres/latest
BSD 3-Clause "New" or "Revised" License
129 stars 32 forks source link

[WIP] Add support for Postgis Geometry data types #130

Closed bettdouglas closed 4 years ago

bettdouglas commented 4 years ago

This PR enables support of postgis geometries which is provided via an extension. PostGIS is an extension that enables performing storage of spatial objects, enables manipulation of the objects as well as doing spatial analytics like finding features which are inside a specific region, e.g find all shops inside New York, find 20 closest shops near me, etc. PostGIS Webiste

This PR hopes to add support for this datatype. It requires a dependency on dart_jts which has ability to handle postgis data types as Plain Dart Objects.

Since postgis is an extension, the datatype will not be available in databases where the extension has not been created/activated via CREATE EXTENSION postgis;

Due to that, there are some caveats to implementing this library here though as discussed by @isoos in https://github.com/stablekernel/postgresql-dart/issues/120 since the datatype's oid is dynamic, not static like other officially supported types.

A workaround has been suggested here https://github.com/stablekernel/postgresql-dart/issues/120#issuecomment-640845790

This is the issue which needs reviewing as well as modifying the implementation in order to get the oid of the object as well as testing.

Kindly review. Looking foward to your feedback

bettdouglas commented 4 years ago

Closed due to https://github.com/stablekernel/postgresql-dart/pull/130#discussion_r437470041 to separate the concerns