Ticket #86 (defect)

Opened 2 years ago

Last modified 1 year ago

Postgis to PCL Types: Bool not handled

Status: closed (fixed)

Reported by: ludwig Assigned to: seang
Priority: major Milestone: 0.11
Component: Data Stores and Sources Version:
Keywords: Cc:

I have a geometry table with a bool column, eg

CREATE TABLE testtodelete
(
  name varchar(255) NOT NULL,
  displayname varchar(50),
  prefecture varchar(50),
  county varchar(50),
  kind varchar(50),
  haspolygon bool,
  naturalname varchar(100),
  source varchar(20)
) 
WITH OIDS;

delete from geometry_columns where f_table_name = 'testtodelete'; 
select addgeometrycolumn('testtodelete','geom','4326','POINT',2);

Without the bool value it works ok, with the bool value running something like

>>> import cartography.data.postgis
>>> store = cartography.data.postgis.PGFeatureStore("dbname=GIS user=postgres host=localhost")
>>> for tp in store.typenames():
...     print tp
...     print store.bounds(tp)

causes the rather cryptic error

psycopg2.ProgrammingError: could not identify an ordering operator for type box2d
HINT:  Use an explicit ordering operator or modify the query.

I have traced this down to the bool value not being translated into a PCL type, in cartography/data/postgis.py around line 394, current SVN head.

Ludwig

Change History

08/08/06 07:48:40: Modified by ludwig

Just adding the lines in the PostGis? to PCL mapping in postgis.py around line 400

           elif t in ('boolean'):
                si = BooleanProperty(name)

and the respective import clause should do the trick.

08/08/06 10:17:29: Modified by seang

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r484. Thanks!

07/05/07 09:31:10: Modified by seang

  • status changed from closed to reopened.
  • resolution deleted.

BooleanProperty? is not imported into postgis.py.

07/05/07 09:32:25: Modified by seang

  • status changed from reopened to closed.
  • resolution set to fixed.

Fixed in r744.