[postgis-users] POSTGIS: bad lexical cast: source type value could not be interpreted as target

Felix.Villanueva felix.villanueva at uclm.es
Wed Jan 25 12:18:43 PST 2012


Hi, I'm using PostGIS for paint with mapnik some positioning events, I
successfully renderized some maps but when I try to render others I get:

PostGIS: warning: could not determine extent from query: select
xmin(ext),ymin(ext),xmax(ext),ymax(ext) from (select extent(pos) as ext
from rfid) as tmp Error was: 'bad lexical cast: source type value could
not be interpreted as target'

the table rfid is created:

CREATE TABLE rfid (
    rfid varchar(100) PRIMARY KEY,
    time bigint
);

SELECT AddGeometryColumn('rfid', 'pos', -1, 'GEOMETRY', 2);

And an example of the event which I want to render would be inserted by
mean a SQL like this: INSERT INTO rfid (rfid, time, pos) VALUES
('UserID', 1327337692, ST_GeomFromEWKT('POINT(60.0 29.0)'))

It seems that the insertion in the database is ok, the trigger
associated originates an update in my application (I build a Cairo
Image) but when a I try to make a mapnik.render the mentioned error
appear and nothing is painted.

I'm using debian with PostGIS 1.5 and mapnik 0.7

Any idea?

Thanks in advance.
Regards
 Félix

-- 
Dr. Félix Jesús Villanueva Molina
Associate Professor
School of Computer Science
Paseo de la Universidad, 4
13071 Ciudad Real (Spain)
http://arco.esi.uclm.es



More information about the postgis-users mailing list