Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostGIS Geography Type, ERROR: Invalid geography #17317

Closed
qgib opened this issue Sep 4, 2013 · 4 comments
Closed

PostGIS Geography Type, ERROR: Invalid geography #17317

qgib opened this issue Sep 4, 2013 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@qgib
Copy link
Contributor

qgib commented Sep 4, 2013

Author Name: Denver Pierce (Denver Pierce)
Original Redmine Issue: 8572
Affected QGIS version: master
Redmine category:data_provider/postgis


Loading geography types in Master by adding a PostGIS Layer, nothing is displayed and the following log is given:

@query: DECLARE qgisf0_0 BINARY CURSOR FOR SELECT
st_asbinary(st_force_2d("pos"::geometry),'NDR'),"id" FROM
"public"."locations" WHERE "pos" && st_makeenvelope(-180,-90,180,90,4326)
returned 7 [ERROR: Invalid geography. Antipodal (180 degrees long) edge
(180 -90,180 90) detected, add a point between to make two edges that span
less than 180 degrees.]@

Relevant stack exchange post:
http://gis.stackexchange.com/questions/70556/error-invalid-geography-antipodal-edge-with-postgis?noredirect=1#comment96122_70556

And post on the list:
http://osgeo-org.1560.x6.nabble.com/geometry-with-geography-type-column-not-displayed-td4690688.html#a4690860

It seems the BBOX query is being cast to geography, then that is being sent back as invalid as it contains a banned antipodal query on a geography.

@create TABLE global_points (
id SERIAL PRIMARY KEY,
name VARCHAR(64),
location GEOGRAPHY(POINT,4326)
);
INSERT INTO global_points (name, location) VALUES ('freiburg', ST_GeographyFromText('POINT(7.86 48.0)'));
CREATE INDEX global_points_gix ON global_points USING GIST ( location );@

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2013

Author Name: Sandro Santilli (@strk)


Casting the geography to a geometry would fix this:
WHERE "location"::geometry && ...

Jef: was this that you had in mind when you asked about casting to geometry ?

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2013

Author Name: Sandro Santilli (@strk)


I've filed an upstream bug as the workaround suggested by the error message (adding in-between point) doesn't help:
http://trac.osgeo.org/postgis/ticket/2495

@qgib
Copy link
Contributor Author

qgib commented Jun 26, 2015

Author Name: Jonathan Moules (Jonathan Moules)


This still happens with 2.6.1. I'm surprised the priority is so low given it makes QGIS useless with many PostGIS datasets.

@qgib
Copy link
Contributor Author

qgib commented Jun 26, 2015

Author Name: Jürgen Fischer (@jef-n)


Fixed in changeset "90b3efb93dd0b6460ce496a8acd7fcbf34b22f63".


  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant