Easiest way to merge shape files

69 views
Skip to first unread message

Ryan Habibi

unread,
Jun 2, 2011, 3:19:23 PM6/2/11
to Geospatial Python
Hi I'm trying to create a little tool that will allow me to chose a
dir and using regular expressions selected a subset of files then
merge into one.

The problem that I'm having is that I don't see how to get the writer
in shapefile.py take the format provided by the reader.

Right now I generate my list of files, open the first file with the
writer then read each shape record for all remaining files. I just
need to know if there is an easy way to write from that format before
I save as a new merge file.

Thank you very much for help in advance.

Joel Lawhead

unread,
Jun 2, 2011, 4:08:35 PM6/2/11
to Geospatial Python
Ryan,

It's pretty easy but maybe not obvious.

Check put the code sample in this post:
http://geospatialpython.com/2011/02/merging-lots-of-shapefiles-quickly.html

If I misunderstood the question or you need some more help just let me
know.

I'd love to talk about your script in a post if you want to share it.

Cheers,
Joel
Reply all
Reply to author
Forward
0 new messages