Page 1 of 1

PostGIS geometry PgDAC

Posted: Fri 13 Mar 2020 11:47
by UserJK
Hi.

I have PostgreSQL database with Postgis geometry.
How to decode postgis binary geometry to 'WKT' or any other format or get PgDAC object (ex. TPgPoint) in Delphi application (or any other)

Code: Select all

procedure TfmMain.Button5Click(Sender: TObject);
var
  fld: TField;
  pgfld: TPgGeometricField;
  pGeom: TPgGeometric;
  pPoint: TPgPoint;
  pCBlob: TCompressedBlob;
  x,y: Double;
begin
  PgQuery1.SQL.Clear;
  PgQuery1.SQL.Add('SELECT * FROM test_geom');
  PgQuery1.Open;
  fld := PgQuery1.FieldByName('geometry');
  pgfld := TPgGeometricField(fld);

  pGeom := pgfld.AsPgGeometric;
  pCBlob := TCompressedBlob(pGeom);//works, but how to decode geometry data?

  pPoint := TPgPoint(pGeom);//don't work
  x := pPoint.X;
  y := pPoint.Y;
I also have tried to use postgis function ST_AsText(geometry) in SQL

Code: Select all

  PgQuery1.SQL.Add('SELECT ST_AsText(geometry) FROM test_geom');
  PgQuery1.Open;
But this throws me error that function st_astext(public.geometry) doesn't exist.

When I create table using point or polygon data type I can get TPgPoint.

Code: Select all

CREATE TABLE test_geom_point
(
  geometry point,
  id integer NOT NULL
);

INSERT INTO test_geom_point(
            geometry, id )
    VALUES (point(2,1), 1);
Unfortunately, this isn't Postgis geometry and I can't show this data in application like QGis.
Also I can't show in my application data with Postgis geometry

How to decode Postgis geometry?

Re: PostGIS geometry PgDAC

Posted: Tue 17 Mar 2020 12:40
by oleg0k
Hello,
We support only official releases of database systems, and we cannot guarantee compatibility of our products with third-party solutions.
We’ll consider adding support for PostGis in future releases.

wbr, Oleg
DAC Team

Re: PostGIS geometry PgDAC

Posted: Fri 27 Nov 2020 09:25
by Morelli
Hi,

do you now support PostGIS GEOMETRY?
Had anyone ins this forum successfully read/wrote PostGIS geometries?

Re: PostGIS geometry PgDAC

Posted: Thu 03 Dec 2020 17:37
by oleg0k
Hello,
We support only official releases of database systems, and we cannot guarantee compatibility of our products with third-party solutions. You are welcome to leave your suggestion about adding support for PostGIS spatial geometry types to PgDAC on our UserVoice page ( https://devart.uservoice.com/forums/104 ... y_id=18923 )

wbr, Oleg
Devart Team