Thursday, November 16, 2017

Creating MultiPoint Shapefiles with PyShp

Pyshp let's you create any type of shapefile.  Normally a point shapefile has one point per record.  But
Photo credit:
you can also have a group of points tied to a single record in a Multipoint shapefile.  To create a Multipoint shapefile, you just use the "poly" method in the Writer. The poly method isn't just for polygons. It can also create polylines and polypoints (i.e. MultiPoints)!

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

# 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

# Save the multipoint shapefile"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


  1. I must say you had done a tremendous job,I appreciate all your efforts.
    Thanks alot for your writings.
    Waiting for a new 1...Please visit our wonderful and valuable website-
    For More Details Visit are Official Websites :

  2. Thanks for sharing this in here. You are running a great blog, keep up this good work.
    Check it out : AWS Training in chennai | AWS Training institute in velachery

  3. Hadoop concepts, Applying modelling through R programming using Machine learning algorithms and illustrate impeccable Data Visualization by leveraging on 'R' capabilities.With companies across industries striving to bring their research and analysis (R&A) departments up to speed, the demand for qualified data scientists is rising.
    data science training in bangalore