Tag Info

New answers tagged

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.


0

Something like this would work SELECT ST_Transform( ST_SetSRID( ST_GeomFromGeoJSON('{ "type": "LineString","coordinates": [ [27.456667,5.065], [30.456667,-1.088] ] }') ,4326) ,3857) AS the_geom_webmercator


1

There are a couple of options. Option 1 You could do the query exactly like you have it, then add your linestring using GeoJSON on the client. You'd use CartoDB.js to draw you polygon layer and then use Leaflet to add the GeoJSON layer on top. Option 2 Use a multilayer visualization. The bottom layer you could have as you polygons (styled accordingly. ...


0

It's on both sides. I suppose you want the one the majority of the distance is on. Assuming only a single point of intersection, you'd first need to split the line at the intersection and take the length of both sides. Once you know which side is longer, take any point on that side. Next, you need to determine what segment of the main line the ...


1

Easy, use ST_LineMerge with the MultiLineString geometry. SELECT ST_LineMerge(geom) FROM ... Returns a LineString if it is possible, such is the example in the question.


4

There is few resolutions of this issue, maybe there are few better ones but this two should do also: 'By hand' (in steps) Cut every line with another line which intersects it Create table road_1 as Select row_number() over() as ID, input.name, (st_dump(st_split(input.geom, blade.geom))).geom as geom from roads input join roads blade ...


0

You can use PostGIS ST_NODE function or if you have PostGIS > 2.0 and want to do a cleaner job considering topology, you can follow instructions in this blog



Top 50 recent answers are included