Bug report #21963

graphical identify and select feature do not work on Postgis-sql layer

Added by Sebastian Brocks almost 5 years ago. Updated almost 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/PostGIS
Affected QGIS version:3.6.2 Regression?:No
Operating System:windows 7 Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:29778

Description

I have a SQL-defined postgis layer defined by this statement:

((((SELECT row_number() over () AS uid,* FROM (SELECT generate_series(0, laenge_asb,100) AS station, st_astext(
ST_LineInterpolatePoint(
geometrie,
generate_series(0, laenge_asb,100):: double precision /(laenge_asb)
)
) FROM "erhaltung"."abschnitt" ) AS subq_1 ) ) ) )

abschnitt is a table in my postgis database with a LineStringZM geometry of SRID 4326 stored in the geometrie column that has an integer laenge_asb column

When I try to identify or select features in it by using the identify or select tool, the PostGIS log tab contains this error and no feature is identified or selected:

2019-04-30T14:09:40 WARNING Fetching from cursor qgis_144 failed
Database error: ERROR: Operation on mixed SRID geometries

2019-04-30T14:09:40 WARNING Query: CLOSE qgis_144 returned 7 [ERROR: current transaction is aborted, commands ignored until end of transaction block
]
2019-04-30T14:09:40 WARNING 1 cursor states lost.
SQL: CLOSE qgis_144
Result: 7 (ERROR: current transaction is aborted, commands ignored until end of transaction block
)

History

#1 Updated by Sebastian Brocks almost 5 years ago

This looks like the issue in issue #4470

#2 Updated by Jürgen Fischer almost 5 years ago

  • Status changed from Open to Feedback

Why are you using st_astext?

#3 Updated by Sebastian Brocks almost 5 years ago

No particular reason, I'm a relative newbie with regard to postgis and QGIS. Changing to st_aswekt makes identify and select work correctly.

#4 Updated by Jürgen Fischer almost 5 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Sebastian Brocks wrote:

No particular reason, I'm a relative newbie with regard to postgis and QGIS. Changing to st_aswekt makes identify and select work correctly.

you shouldn't need either st_astext or st_ewkt - the geometry ST_LineInterpolatePoint produces should work as it, but `st_astext` will essentially just remove the SRID and in turn cause the error.

Also available in: Atom PDF