Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to create a heatmap of say, provincial population of China and I found this guide to a similar problem http://sensitivecities.com/so-youd-like-to-make-a-map-using-python-EN.html#.Ut3k7bS-thF here.

I have no problem going through the example code though I have to admit that I don't thoroughly understand them all. However when I was trying to mimic the example by using the shapefile of China, the code ran ok till the following

In [6]:

df_map = pd.DataFrame({
    'poly': [Polygon(xy) for xy in m.china],
    'ward_name': [ward['NAME'] for ward in m.china_info]})

It generates an error that says

ValueError: A LinearRing must have at least 3 coordinate tuples

Can someone please explain to me what causes this error?

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.