Merging Layers with different data types

4022
4
Jump to solution
04-16-2014 11:48 PM
RicoKock
New Contributor
Hi

Im new to esri and geoprocessing, so forgive me for posting maybe a newbie Q

Ive got multiple .shp layers that i want to merge, but using ArcMap 10's merge, or even ETG Wizard it only merges some of the layers.
I think its because not all the layers has the same fields or data types.

Further more i tried using Append but same happens.

Any ideas?
0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Honored Contributor
Hi thanks for the reply, Yes all the shapefiles are the same type, im working with points and lines, all the lines seemed to merge(but all their fields are the same data type) only my points wont merge at all, any way to populate all my layer's fields to the same data type??


Here are my random guesses and options I see given the very limited information you have provided.

The points will merge with each other as points if that is what you are trying to do, unless perhaps some are multi-points and some are regular points or they are in different projections.  Use the project tool if they are not in the same projection before merging them.

All of the shapefiles are not the same type if some are lines and some are points.  The points won't merge with the lines if that is what you are trying to do.  You would have to make the points into a duplicate of the original points moved a short distance and then processed through the points to line tool as a two point line to merge them with the other lines. 

You could buffer the lines and the points to convert both the polygons and then merge them.

You could use the Feature to Points tool to convert the lines to points (like the line centroid) and then merge them with the other points.

Do you know if you have two fields that are named the same in different point shapefiles, but one is double and the other is long or text, for example?  That would likely cause a problem.  You could use the Feature Class to Feature Class tool to output a new shapefile version that changed the data type to a common compatible type through altering the field map (typically you would make both double rather than long unless you were absolutely sure all values in both shapefiles were compatible with long).  That tool can match up any field in new output shapefiles provided you alter them to a data type that encompasses all of the actual data in the fields.  Then the merge should work.

Are you sure your inputs are only shapefiles?  If some are geodatabase feature classes and had fields like a GlobalID they would not export to shapefile or merge with shapefiles.  You have to drop the GlobalID from the output first.

Look at the shape field in the table view and tell us the exact type of each file you are trying to merge.  Some could have M values or Z coordinates and the others don't is an example of another random possibility that I cannot eliminate from the information you have provided.

Tell us much more specific detailed information to get more than random guesses.  Give an example of the schemas of two point files that won't merge with all of the actual field names and data types to get more help.

View solution in original post

0 Kudos
4 Replies
TimWitt
Frequent Contributor
Good morning!

Are all of those shapefiles of the same type (i.e. all are polygons or all are points)? You can't merge shapefiles of different kinds.

Tim
0 Kudos
RicoKock
New Contributor
Good morning!

Are all of those shapefiles of the same type (i.e. all are polygons or all are points)? You can't merge shapefiles of different kinds.

Tim


Hi thanks for the reply, Yes all the shapefiles are the same type, im working with points and lines, all the lines seemed to merge(but all their fields are the same data type) only my points wont merge at all, any way to populate all my layer's fields to the same data type??
0 Kudos
RichardFairhurst
MVP Honored Contributor
Hi thanks for the reply, Yes all the shapefiles are the same type, im working with points and lines, all the lines seemed to merge(but all their fields are the same data type) only my points wont merge at all, any way to populate all my layer's fields to the same data type??


Here are my random guesses and options I see given the very limited information you have provided.

The points will merge with each other as points if that is what you are trying to do, unless perhaps some are multi-points and some are regular points or they are in different projections.  Use the project tool if they are not in the same projection before merging them.

All of the shapefiles are not the same type if some are lines and some are points.  The points won't merge with the lines if that is what you are trying to do.  You would have to make the points into a duplicate of the original points moved a short distance and then processed through the points to line tool as a two point line to merge them with the other lines. 

You could buffer the lines and the points to convert both the polygons and then merge them.

You could use the Feature to Points tool to convert the lines to points (like the line centroid) and then merge them with the other points.

Do you know if you have two fields that are named the same in different point shapefiles, but one is double and the other is long or text, for example?  That would likely cause a problem.  You could use the Feature Class to Feature Class tool to output a new shapefile version that changed the data type to a common compatible type through altering the field map (typically you would make both double rather than long unless you were absolutely sure all values in both shapefiles were compatible with long).  That tool can match up any field in new output shapefiles provided you alter them to a data type that encompasses all of the actual data in the fields.  Then the merge should work.

Are you sure your inputs are only shapefiles?  If some are geodatabase feature classes and had fields like a GlobalID they would not export to shapefile or merge with shapefiles.  You have to drop the GlobalID from the output first.

Look at the shape field in the table view and tell us the exact type of each file you are trying to merge.  Some could have M values or Z coordinates and the others don't is an example of another random possibility that I cannot eliminate from the information you have provided.

Tell us much more specific detailed information to get more than random guesses.  Give an example of the schemas of two point files that won't merge with all of the actual field names and data types to get more help.
0 Kudos
RicoKock
New Contributor

Do you know if you have two fields that are named the same in different point shapefiles, but one is double and the other is long or text, for example?  That would likely cause a problem.  You could use the Feature Class to Feature Class tool to output a new shapefile version that changed the data type to a common compatible type through altering the field map (typically you would make both double rather than long unless you were absolutely sure all values in both shapefiles were compatible with long).  That tool can match up any field in new output shapefiles provided you alter them to a data type that encompasses all of the actual data in the fields.  Then the merge should work.



Hi
Thank You so much, this seemed to help and the layers merged. I had 2 fields that needed to change.

Regards & Thanks again
0 Kudos