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:
LINESTRING(16.87593599289347779 49.7559793078007857, ...
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