zhikrullah / pyshp

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

Multipolylines are read as a single polyline #63

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. download attached shapefile and test script.  run script.
2. check shapefile in arcgis - it displays as a multipolyline.  check the 
number of parts shape 1 (the second shape) has in arcpy - it has more than one. 
 (n.b. the first shape (0) does have only one part)

What is the expected output? What do you see instead?
Reading a multi polyline I expect three levels of nested lists, like
[[[x11,y11],[x12,y12]],[[x21,y21],[x22,y22]]]

But instead I get a list structured like
[[x1,y1],[x2,y2]] etc

What version of the product are you using? On what operating system?
shapefile.py version 1.2.0 on windows 7 python 2.7.2

Other information:
I notice now in shapefile.py there is no shape type for shapefile.MULTIPOLYLINE 
(don't know if this is intended).  However I successfully created the example 
shapefile as a multipart shape using shapefile.py with type set to 
shapefile.POLYLINE.

Hope this report is of use to you.  Many thanks for your work on this great 
library!

Original issue reported on code.google.com by crispin....@gmail.com on 5 Feb 2014 at 1:42

Attachments:

GoogleCodeExporter commented 8 years ago
Ok I just realised I got this wrong, clients should check shape.parts rather 
than expecting a nested list.  Can't find docs that say this though!

Original comment by crispin....@gmail.com on 5 Feb 2014 at 2:08