Leave a comment

Merging shapefiles

Another process that I though would be quite simple was merging 2 shapefiles.  It seems there is an issue with the shapefile names not being recognized and I had to use “str” to identify the names as strings.

temp1 = "temp1.shp"
 temp2 = "temp2.shp"

strlist = str(temp1)+";"+str(temp2)
 outshp = (gp.workspace+"/final.shp")
 gp.Merge_management (str(strlist), outshp)
 gp.AddMessage ("Merged Shapefiles")

When I tried to just use the names of the shapefile copies I could not get this to work.  I then created a simple list and identified the shapefile names as strings as well as in the actual Merge_managment, I had to identify the strlist as string.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: