Tag Info

New answers tagged


The correct syntax is: print multiline.ExportToWkt() 'MULTILINESTRING ((0 0,0 1),(0 1,0 2),(0 2,0 3,0 4))' line = ogr.ForceToLineString(multiline) print line.ExportToWkt() 'LINESTRING (0 0,0 1,0 2,0 3,0 4)' It is easier with Shapely coords = [((0,0),(0,1)),((0,1),(0,2)),((0,2),(0,3),(0,4))] from shapely.geometry import LineString, MultiLineString line1 = ...


You can create the polygon using Buffer. Note that the distance is in the units of the coordinate reference system you're using (which is probably degrees since you said its latitude and longitude). So if you want a 10 metre buffer, you probably need to project it (or be willing to accept some inaccuracy in the buffer size if you just want to convert 10 ...


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.

Top 50 recent answers are included