1

I use PostGis, and want to use QGIS to visualize data. But I get error message when trying to show the points in the table.

I create a table:

CREATE TABLE poi
(
  id text NOT NULL,
  coord geography(point),
  CONSTRAINT poi_pkey PRIMARY KEY (id)
);

CREATE INDEX poi_coord ON poi USING GIST ( coord );

I add data to the table:

INSERT INTO poi VALUES ('P01',ST_GeogFromText('POINT(19.034561 47.486079)'));
INSERT INTO poi VALUES ('P02',ST_GeogFromText('POINT(19.030486 47.490477)'));
INSERT INTO poi VALUES ('P03',ST_GeogFromText('POINT(19.030328 47.49059)'));

I see the data in the table:

"P01";"0101000020E610000091B75CFDD8083340DD2230D637BE4740"
"P02";"0101000020E610000061FC34EECD073340583849F3C7BE4740"
"P03";"0101000020E610000031276893C307334050DF32A7CBBE4740"

I try to add the layer in QGIS , but I don't see anything, the log says the following messages :

Query: DECLARE qgis_1 BINARY CURSOR FOR SELECT st_asbinary("coord"::geometry,'NDR'),"id"::text FROM "public"."poi" WHERE "coord" && st_makeenvelope(-180,-90,180,90,4326) returned 7 [ERROR:  Antipodal (180 degrees long) edge detected!]

1 cursor states lost.
SQL: DECLARE qgis_1 BINARY CURSOR FOR SELECT st_asbinary("coord"::geometry,'NDR'),"id"::text FROM "public"."poi" WHERE "coord" && st_makeenvelope(-180,-90,180,90,4326)
Result: 7 (ERROR:  Antipodal (180 degrees long) edge detected!)

Query: CLOSE qgis_1 returned 7 [ERROR:  cursor "qgis_1" does not exist]

I tried it with QGIS 2.4.0 and with two DB configs:

  • PostgreSQL 9.1.7 with PostGIS 1.5.3
  • PostgreSQL 9.3.4 with PostGIS 2.1.3

When I use Geometry instead of Geography, it works well.

What did I do wrong?

  • Are you getting that error with the sample data you have just shown? – raphael Sep 16 '14 at 18:27
  • Yes, only with this 3 rows. – hunyadym Sep 16 '14 at 21:45
  • (Sorry, I just realized that maybe I was ambiguous: so this error message is with this 3 rows, but of course, the problem also occured when I tested with thousands of other rows - it's just a reduced example, but I could reproduce the problem with these data too.) – hunyadym Sep 16 '14 at 21:55
  • 2
    Perhaps the same issue as in hub.qgis.org/issues/8572 – user30184 Sep 17 '14 at 8:39
1

Perhaps, you must to define geometry and SRC

ALTER TABLE your_squema."your_table" ALTER COLUMN geometry SET DATA TYPE geometry(MULTIPOINT, EPSG code) USING ST_Force2d(ST_Multi(geometry ));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.