2008年10月6日 星期一

Error parsing Geometry

I follow a postgis workshop document to learn postgis. There is a instruction to insert three records manually and then do some calculation with a operator "ST_Distance".

However, whenever I use it, it returns an error. I don't know why but I suspect there is problem in the SRS.

It is just a simple query:

create table points ( pt geometry, name varchar );
insert into points values ( 'POINT(0 0)', 'Origin' );
insert into points values ( 'POINT(5 0)', 'X Axis' );
insert into points values ( 'POINT(0 5)', 'Y Axis' );
select name, AsText(pt), ST_Distance(pt, 'POINT(5 5)') from points; < This returns error in parsing geometry. Why?

沒有留言: