pyclipper icon indicating copy to clipboard operation
pyclipper copied to clipboard

Is there a way to read lines from a shapefile?

Open d3netxer opened this issue 6 years ago • 3 comments
trafficstars

Is there a way to read lines from a shapefile and use them as the subject?

d3netxer avatar Mar 04 '19 13:03 d3netxer

Hi, pyclipper is only a wrapper for Angus Johnson's implementation of the Vatti's polygon clipping algorithm. How does your data look like? You need to have the points of the polygons available in the form of a python tuple, list or numpy array.

flabowski avatar Mar 04 '19 21:03 flabowski

I have a polygon shapefile that represents the boundary of the city.

d3netxer avatar Mar 07 '19 14:03 d3netxer

If you are able to extract the polygons from your file, it works (even with numpy arrays). However, this library does not support reading shapefiles, you will have to do this manually. Please refer to the section how to use, it gives a good idea what this library does: https://github.com/fonttools/pyclipper#how-to-use

flabowski avatar Mar 21 '19 16:03 flabowski