IBM Informix Spatial datablade LIneFromText function
Posted
by swatit
on Stack Overflow
See other posts from Stack Overflow
or by swatit
Published on 2010-03-30T03:03:24Z
Indexed on
2010/03/30
3:13 UTC
Read the original article
Hit count: 390
Hi Everybody,
I am using IBM-Informix for my school project as part of "Informix on-campus" ativity conduted by IBM.
I am using spatial datablade to store spatial data. My spatial data table looks like,
CREATE TABLE xmlTest (row_id integer NOT NULL,pre integer, post integer,parent integer,tagname varchar(40,1),point ST_POINT);
Then I inserted the spatial data into the table. Now I am trying to select the 'Points' lying under given 'polygon', where the co-ordinates of the polygon are dynamic i.e co-ordinates will be decided in the 'select' query. My query is like
SELECT v2.* FROM xmlTest v1,xmlTest v2 WHERE ST_Contains(ST_Polygon(ST_LineFromText('linestring (0 0, 22000 0,22000 22000,0 22000,0 0)',5)),ST_Point(v1.pre,v1.post,5)) AND v1.tagname like 'n1' AND ST_Contains(ST_Polygon(ST_LineFromText('linestring (0 0,v1.pre 0,v1.pre v1.post,0 v1.post,0 0 )',5)),ST_Point(v2.pre,v2.post,5)) AND v2.tagname like 'n2'
however it is giving me error as "(USE31) - Too few points for geometry type in ST_LineFromText.", in the second linefromtext function. I checked the number of parameters for linestring function, but could not find the source of error. I think,linestring function's parameters should be fixed values and not the variable like in this query. Is it right? Then what is the alternate way, where I can specify my polygon co-ordinates dynamically? or is there any mistake in my query?
I hope my question is clear. I appreciate your help!
© Stack Overflow or respective owner