I am having problem with strange coordinates switching when loading PostGIS layers in QGIS. First, I thought, that problem may be cause by the use of GROUP_BY feature in layer query, but later the problem started to appear in other queries not using this feature and finally it happens also with single table actually containing the geometry multilinestring data (with srid 4326). The problem sometimes strangely disappear when local copy of the sama data (shapefile) is already loaded.

When the problem appears, coordinates of some items are switched, like this:

Correct: LINESTRING(16.87593599289347779 49.7559793078007857, ... Switched:LINESTRING(49.7559793078007857 16.87593599289347779, ...

The data themselves are fine, because if I export table to shapefile, all coordinates are correct. I tried to look at PostgreSQL log (all statements are logged) but no errors were found.

I am using:

  • PostgreSQL 9.1
  • PostGIS 2.1 (full version "POSTGIS="2.1.0 r11822" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.8.0" TOPOLOGY RASTER")
  • QGIS 2.4

EDIT: Some further observations:

  • problem appears when I add multiple PostgreSQL layers to QGIS. Some of the objects become "switched" instantly. The other layer usually brake after I remove the first one from the view (same "switching behavior").
  • problem also appears when I try to create virtual layer in QGIS DB manager plugin (in most simple cases such as table with spatial column loaded twice - once through PostGIS layers dialog, once through DB manager
  • There also seems to be another related issue, which is likely different, because when the features can't be seen, they can still be selected. In this case, "switching" happens on reload (or zoom). On another one, lines appear correctly, only to disappear again on another reload.

Also, the problem appeared on PostGIS 2.0 ("POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8" TOPOLOGY RASTER")

To help understand my issue better, I created screencast at http://youtu.be/rqS6kaFfUaQ

closed as off-topic by underdark Aug 5 '14 at 9:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – underdark
If this question can be reworded to fit the rules in the help center, please edit the question.

  • That's odd. I use PostGIS and QGIS a lot and have never seen such a behavior. Can you provide a mini database dump which shows this behavior? If we can't reproduce the problem, this is going to be hard to answer. – underdark Jul 25 '14 at 15:15
  • 1
    Sure. I will try to set up the local environment, copy the data and provide relevant part of the log. – Miloš Kroulík Jul 25 '14 at 18:18
  • I managed to replicate the error, see edited answer. – Miloš Kroulík Jul 31 '14 at 9:48
  • I updated the question with some further observations. – Miloš Kroulík Aug 1 '14 at 13:03
  • I created screencast showing the issue at youtu.be/rqS6kaFfUaQ – Miloš Kroulík Aug 4 '14 at 8:04

It seems, that issue is solved simply by upgrading DB to PostgreSQL 9.3.

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