Tag Info

New answers tagged

1

The easiest solution is to use union, cascaded_unionor unary_union. All the lines are split at the points of intersection: from shapely.geometry import LineString line1 = LineString([(0, 0), (2, 2),(3,1)]) line2 = LineString([(2, 0), (2, 1),(1,2)]) print line1.intersection(line2) POINT (1.5 1.5) for line in line1.union(line2): print line LINESTRING (0 ...


1

Gdal PYthon binding works with conjuration with gdal. You need to have installed GDAL along with the binding to work. A quick skim over the errors you provided they suggest that while you installed gdal-python you haven't install the gdal by itself: A possible solution chain is: Install GDAL (http://www.gisinternals.com/sdk/) Append the installation ...


2

I suspect the issue is the GDAL 1.11 bindings you're fetching from gohlke do not match the internal GDAL inside of Arc*. Your bindings need to be compiled against ESRI's GDAL to work reliably. It's possible they can be made to work, but it is going to be a lot of headache. In short, ESRI needs to provide the gdal_i.lib stub file that GDAL generates as part ...


0

use the dir() function dir(intersection) ['AddGeometry', 'AddGeometryDirectly', 'AddPoint', 'AddPoint_2D', 'Area', 'AssignSpatialReference', 'Boundary', 'Buffer', 'Centroid', 'Clone', 'CloseRings', 'Contains', 'ConvexHull', 'Crosses', 'Destroy', 'Difference', 'Disjoint', 'Distance', 'Empty', 'Equal', 'Equals', 'ExportToGML', 'ExportToJson', 'ExportToKML', ...


0

found the problem: the files were still busy from the check if it contains geometries. ds=None lyr=None Setting both variables = None before actually deleting the file solves the problem.


0

This should go as a comment. But is too long. Thanks much Gene! There are both LineString and MultiLineString features. So this code for line in shape(elem['geometry']) shows TypeError: 'LineString' object is not iterable when feature is MultiLineString. So the final code that works is as below. with fiona.open(source_path) as source: with ...


2

A MultiLineString is a list of lines: from shapely.geometry import MultiLineString, mapping, shape coords = [((0, 0), (1, 1)), ((-1, 0), (1, 0))] lines = MultiLineString(coords) print lines MULTILINESTRING ((0 0, 1 1), (-1 0, 1 0)) for line in lines: print line LINESTRING (0 0, 1 1) LINESTRING (-1 0, 1 0) # convert to GeoJSON format: print ...


1

Manage to solve my problem. THis can be done by instantiating OGR and openup a shapefile database, layers etc Afterwhich, create a OGRPoint object with the neccessary lat lon input OGRPoint* pt = new OGRPoint(lat, lon); set a spatial filter based on this point object on the layer next extract the feature based on the filter resu;lt Finally extract the ...


-1

Version 2.4 of Qgis has Layer Files (QLR) which can be used instead of OVF/VRT files to do this.



Top 50 recent answers are included