Skip to content

support postgis geometric datatypes #111

@ToddG

Description

@ToddG

I'd like to use several postgis geometric datatypes such as:

I don't know how to solve this issue, but I suspect it will involve pgo + pog + squirrel...

Notes

postgis geometryoid defined here

https://github.com/postgis/postgis/blob/2ecfaefce1e4730c1eab3733469750c9546f6e8a/libpgcommon/lwgeom_pg.h#L35C1-L44C15

pgo uses types defined in postgres

https://github.com/ToddG/pgo/blob/ed334496fb784d3b7f5780863a4ff353461d2ba3/src/pgo_internal.hrl#L20-L22

% from pg_type.h
-define(BOOLOID, 16).
-define(BYTEAOID, 17).

postgres

However, I don't see where BOOLOID (for example) is defined
https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.h

PostGIS Notes

EPSG:4326

https://epsg.io/4326

WGS 84 -- WGS84 - World Geodetic System 1984, used in GPS

PostGIS Links

PostgreSQL Links

PostGIS examples

CREATE TABLE geometries (name varchar, geom geometry);
INSERT INTO geometries VALUES
  ('Point', 'POINT(0 0)'),
  ('Linestring', 'LINESTRING(0 0, 1 1, 2 1, 2 2)'),
  ('Polygon', 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'),
  ('PolygonWithHole', 'POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 1 2, 2 2, 2 1, 1 1))'),
  ('Collection', 'GEOMETRYCOLLECTION(POINT(2 0),POLYGON((0 0, 1 0, 1 1, 0 1, 0 0)))');
SELECT ST_AsGeoJSON(geom) FROM geometries;
{"type":"Point","coordinates":[0,0]}
{"type":"LineString","coordinates":[[0,0],[1,1],[2,1],[2,2]]}
{"type":"Polygon","coordinates":[[[0,0],[1,0],[1,1],[0,1],[0,0]]]}
{"type":"Polygon","coordinates":[[[0,0],[10,0],[10,10],[0,10],[0,0]],[[1,1],[1,2],[2,2],[2,1],[1,1]]]}
{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[2,0]},{"type":"Polygon","coordinates":[[[0,0],[1,0],[1,1],[0,1],[0,0]]]}]}
{"type":"Point","coordinates":[0.1,0.2]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    type requestA request to add support for a PG type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions