Hi,<br><br>Sorry for projection problem. <br><br>I mean;<br><br>select<br>st_intersects(st_buffer(route.the_geom,0.0), st_transform(st_geomFromText('POINT(30 20)',4326),900913)) <br>as result<br>from route<br><br>Now there shouldn't be <b><u>SRID problem</u></b>.. But still the result is <u><b>FALSE</b></u>. But when i don't use buffer;<br>
<br>select<br>st_intersects((route.the_geom), st_transform(st_geomFromText('POINT(30 20)',4326),900913)) <br>as result<br>from route<br><br>The result is <b><u>TRUE</u></b> !!!<br><br>So the problem is not a rounding error. If so, second query result would be FALSE.<br>
I think the result of these two queries should be the same (if transformation rounding errors r concerned). Am i wrong ???<br><br>Thanks, all... <br><br><div class="gmail_quote">On Mon, Jan 18, 2010 at 10:56 PM, Kevin Neufeld <span dir="ltr"><<a href="mailto:kneufeld@refractions.net">kneufeld@refractions.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">? Sorry, I'm confused. I would think you would get a ERROR: Operation on two geometries with different SRIDs when running your query.<br>
<br>
You are taking a lat/long coordinate, transforming it to a [deprecated] mercator projection and storing the results in a table called route.<br>
<br>
Then you are asking if the mercator point, when buffered by 0, intersects a point in lat/long.<br>
<br>
If you meant to include a transform back to 4326 in the intersect query (ie. st_intersects(st_buffer(st_transform(route.the_geom,4326),0.0), ... ), you should be aware that transforming a geometry back and forth between projections will likely lead to rounding errors.<br>
<br>
ie.<br>
SELECT<br>
astext(g1) g1,<br>
astext(g2) g2,<br>
g1,<br>
g2,<br>
g1 ~= g2,<br>
st_intersects(g1, 'SRID=4326;POINT(30 20)'),<br>
st_intersects(g2, 'SRID=4326;POINT(30 20)')<br>
FROM (<br>
SELECT geom g1, st_transform(st_transform(geom,900913),4326) g2<br>
FROM (<br>
SELECT 'SRID=4326;multilinestring((30 20,31 21,32 22))'::geometry AS geom<br>
) a<br>
) b;<br>
-[ RECORD 1 ]-+---------------------------------------------------------------------------------------------------------------------------------------------<br>
g1 | MULTILINESTRING((30 20,31 21,32 22))<br>
g2 | MULTILINESTRING((30 20,31 21,32 22))<br>
g1 | 0105000020E6100000010000000102000000030000000000000000003E4000000000000034400000000000003F40000000000000354000000000000040400000000000003640<br>
g2 | 0105000020E610000001000000010200000003000000FEFFFFFFFFFF3D40FDFFFFFFFFFF33400200000000003F400100000000003540FEFFFFFFFFFF3F40FEFFFFFFFFFF3540<br>
equals | f<br>
st_intersects | t<br>
st_intersects | f<br>
<br>
<br>
Notice how your geometry, when transform to 900913 and back to 4326 looks the same in text, but are in fact different in binary? The transformed geometry, does not intersect (30,20). It might if you buffer it by 0.1.<br>
<br>
Cheers,<br>
Kevin<br>
<br>
ibrahim saricicek wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
hi all;<br>
<br>
I think 0.0 of radius means the object itself? Am i wrong?<br>
<br>
I'm inserting a row to my route table<br>
<br>
insert into route (the_geom) select st_transform(ST_GeomFromText('SRID=4326;multilinestring((30 20,31 21,32 22))'),900913)<br>
<br>
why the result of this is false? that is a point on my route. what is defined with '0.0 of radius'?<br>
the result is true for 0.1 to 0.000000001? Why for 0.0000000001 radius, result is false?<br>
<br>
select<br>
st_intersects(st_buffer(route.the_geom,0.0), st_geomFromText('POINT(30 20)',4326)) as result<br>
from route<br>
<br>
<br></div></div>
------------------------------------------------------------------------<div class="im"><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></blockquote><div><div></div><div class="h5">
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br>