Tag Info

New answers tagged

0

If the linestring are indeed along the same x but vary on y you can create indices on ST_YMAX() and ST_YMIN() functions like so: CREATE INDEX idx_ymin_ymax ON places (St_ymax(geom),St_ymin(geom)); Next just query the table using St_ymax and St_ymin in the WHERE clause to limit the results.


0

Do you need to care? I looked at CreateTopoGeom documentation. If PostGIs cares about the order, then they will take care of it. Oracle Spatial is very picky about the order of the points in a line and the rings. If you run the function on the data that you have, and if you display that data baring any SRID conversion issues, then you should be good to go


2

Use either ST_Distance or PtDistWithin (see documentation). With the former you can test for the distance of your points and then select based on some distance criteria. If you are wanting to test whether a point lies exactly on your line you could try doing an Intersection or use ST_Contains. My only hesitation with these approaches is that, because a ...


0

You can use ORDER BY, and LIMIT your result to 1 to find the closest road: SELECT gid, ST_Distance(ST_Transform(ST_GeomFromText('POINT(39.240443 26.208803)',3857),4326),geom) AS myLineDistance FROM road ORDER BY ST_Distance(ST_Transform(ST_GeomFromText('POINT(39.240443 26.208803)',3857),4326),geom) LIMIT 1 For the second query, you can convert the ...


0

You were wrong with the start and end points. First and last vertices of the WKT are not at top left but they are closer to bottom right as marked in this image. First and last vertices do not have same coordinates and therefore the linestring is not closed even it looks like it was. Vertices are about 0.000113 degrees apart.



Top 50 recent answers are included