zhikrullah / pyshp

Automatically exported from code.google.com/p/pyshp
MIT License
0 stars 0 forks source link

Holes in polygon? #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Are island polygons/polygons with holes supported? If so, please add an example 
to the wiki. I've been trying to create such with pyshp, but didn't manage.

Original issue reported on code.google.com by kris.nac...@gmail.com on 21 Apr 2012 at 11:15

GoogleCodeExporter commented 8 years ago
I have a similar problem when reading shapefile points which used NaNs to 
segment the points into separate polygons - either holes within polygons, or 
two polygons associated with the same record.  Using Matlab's shaperead, the 
break between polygons X coordinate looks like

...  -157.1686  -157.1685   NaN   -157.4838  -157.4892 ...

but using shapefile.py the same coordinates looks like

...  -157.1686, -157.1685, -157.4838, -157.4892, ...

with no indication that there should be a break between the two polygons.

I'm running Matlab 7.9.0.529 (R2009b) on Windows 7, and Python 2.7.1 
(r271:86832, Mar  7 2012, 20:54:07) with [GCC 4.1.2 20080704 (Red Hat 
4.1.2-46)] on an Intel Linux box (MACHTYPE=x86_64-redhat-linux-gnu).  The 
version of shapefile.py is "date: 20110927,
version: 1.1.4"

Original comment by mprater...@gmail.com on 22 Jun 2012 at 6:31

GoogleCodeExporter commented 8 years ago
I am also having issues with this.
I am trying to extract the polygon points and save them within MySQL using 
Polygon Functions.
However I am unable to detect which polygons are inclusive and which are 
exclusive.

Original comment by hayesjor...@gmail.com on 23 Aug 2012 at 6:50

GoogleCodeExporter commented 8 years ago

Original comment by jlawh...@geospatialpython.com on 2 May 2013 at 5:03

GoogleCodeExporter commented 8 years ago
Well, the support is ALMOST there.
pyshp now implements __geo_interface__ 
(https://gist.github.com/sgillies/2217756) support? shape. "MultiPolygon" 
(http://wiki.openstreetmap.org/wiki/Relation:multipolygon) is supported, just 
without polygon roles (inner/outer), which is the problem. I tried to quickly 
glance how to read the inner/outer multipolygon part type here 
(http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf) but didn't succeed.

Original comment by singa...@gmail.com on 30 Mar 2014 at 4:56