Bug report #4792

Geometry type of geography columns can't be found

Added by Sandro Santilli almost 13 years ago. Updated almost 13 years ago.

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

Description

Logging to a PostGIS-1.5 database and browsing tables there's a geography table for which qgis master can't figure the geometry type.
It's a geography with ZM dimensions and contains a POINT. The entry for it in geography_columns says 'Geometry'.

QGiS 1.7.3 is fine with it. I didn't test 1.8

Could depend on 'GEOMETRY' vs. 'Geometry', but it is just a guess, didn't look at the code.

History

#1 Updated by Sandro Santilli almost 13 years ago

The above description was with "Only look in geometry_columns" checked. Deselecting it Qgis gets out of the "Waiting.." indication and reports type "Select..." instead. No idea what that means, but you can't load it as a layer.

#2 Updated by Sandro Santilli almost 13 years ago

Note that 1.7.4 still works, even with "only look in geometry_columns table".
The behavior there is to show 'GEOMETRY' as the type and figure out it is a point when loading it.

#3 Updated by Jürgen Fischer almost 13 years ago

Sandro Santilli wrote:

The above description was with "Only look in geometry_columns" checked. Deselecting it Qgis gets out of the "Waiting.." indication and reports type "Select..." instead. No idea what that means, but you can't load it as a layer.

"Select..." means that there is no data in that column and you need to tell QGIS which geometry it should expect/allow when editing.

#4 Updated by Sandro Santilli almost 13 years ago

As of 6c9663c I get a "Waiting..." message (maybe it was always "Waiting..." rather than "Select...").
The tables contain a single entry. 1.7.4 is able to read them.
It happens with both the geometry and the geography column.

I'll try current master and let you know.

#5 Updated by Sandro Santilli almost 13 years ago

  • Resolution set to invalid

Sorry for the confusing message above. Now I get the meaning of "Select..." (altough it is a bit confusing at first as you don't see any select list before moving over it).

Anyway, I've found the problem: my test database is broken:

strk=# select * from zmgeog;
 id |                                         g
----+------------------------------------------------------------------------------------
  1 | 01010000E0E6100000000000000000F03F000000000000004000000000000008400000000000001040
(1 row)

strk=# select *, geometrytype(g), st_astext(g) from zmgeog;
ERROR:  function geometrytype(geography) does not exist at character 11*

Dunno what's the best way to report such error.
I also confirm 1.7.4 is unable to figure geometry type (just says WAITING there) but contrary to master 1.7.4 is able to open the table.

#6 Updated by Sandro Santilli almost 13 years ago

  • Status changed from Open to Closed

See postgis ticket about the thing: https://trac.osgeo.org/postgis/ticket/1450 (although I still think 1.7.4 was smarter about this)

#7 Updated by Sandro Santilli almost 13 years ago

  • Status changed from Closed to Reopened
  • Resolution deleted (invalid)

Actually, didn't I provide a patch with all the ::geometry casts ?
Since 1.5 won't be affected by changes in 2.0 it would make sense to use the cast (but only for geography)

#8 Updated by Sandro Santilli almost 13 years ago

  • Resolution set to fixed
  • Status changed from Reopened to Closed
  • % Done changed from 0 to 100

Forget it, it really looks like everything is fine now (dunno since which commit).
The casts are in place (maybe 98876da9).

My problem was likely the long waiting due to Bug #4832

Also available in: Atom PDF