Photo credit: VancouverMom.ca |
Here's a simple Multipoint shapefile:
import shapefile # Create our writer as a multipoint shapefile w = shapefile.Writer(shapefile.MULTIPOINT) # We'll create a single dbf field w.field("NAME","C",40) # Create a single-part, multi-point shape # by declaring the shape # type after the parts/points list w.poly([[[3,4],[5,6],[7,8],[9,8]]], shapeType=shapefile.MULTIPOINT) # Create a record for this feature w.record("Group1") # Save the multipoint shapefile w.save("mpoint")Repeat the poly and record steps to add additional shapes. Add another nested list of points in the first poly method argument to add more parts to the same record
No comments:
Post a Comment