1

I have two tables both of them has linestring geometry. I try to make a new one which contain the first one and from the second take only the decimal v when the linestring of the first table touch a linestring of the second.

CREATE TABLE Three AS(
SELECT st_astext(r.geom),e."v" FROM r , e WHERE ST_Touches(e.geom, ST_Transform(r.geom,4326)));

But i am not take an error or a result , the geom of r is in another srid than the 4326 which is the e and i transform it.

1

Not sure what the problem is, but just to check further, you might try some checks like:

SELECT ST_SRID(geom) FROM r; 
SELECT ST_SRID(geom) FROM e; 
SELECT ST_Touches(e.geom , ST_Transform(r.geom, 4326)) FROM e,r;  

Also note that ST_Touches() returns true only if lines cross exactly at a vertex or node. For example:

SELECT ST_Touches('LINESTRING(0 0, 2 2)'::geometry, 'LINESTRING(0 2, 2 0)'::geometry);

returns false. You might be wanting ST_Crosses(), or ST_Intersects().

  • I try SELECT st_astext(r.geom),e."E" FROM r , e WHERE ST_Crosses(and ST_Intersect )(ST_StartPoint(ST_Transform(r.geom,4326)),e.geom); but i dont take again results i take a empty table – vagelis Sep 3 '15 at 6:03
  • Can you post the outputs of the first two queries in the answer above? (just to be sure what CRS yuor data are in)? – Micha Sep 4 '15 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.