How do I copy attribute data to an existing shapefile?

9118
13
Jump to solution
12-02-2015 07:26 AM
DianneBoisvert
New Contributor

I have an existing table containing attribute data about crosswalks with no geometry.  I also have a polyline layer for crosswalks that I want have the attribute data attached to.  How do I get the data from the .dbf into the empty crosswalk feature class?  Merge doesn't work b/c they're different data types.  I can't do a join b/c there is no spatial reference yet.  I figured once the data was in the shapefile I could use the "replace geometry" tool to draw in the lines depicting crosswalks but I'm not sure if that will work.  Am I going about this all wrong?
Thanks,

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

You will have to provide an id field or some other key field in both tables, should they currently not exist, in order to join the tabular data to the file with the geometry.  If you have geometry for both, you could do a spatial join...but you don't

View solution in original post

13 Replies
Elizabeth_R_Jarvie
New Contributor III

Is there an attribute in both layers that you can join on?  Or do you have coordinates in your table to identify their location? 

0 Kudos
DianneBoisvert
New Contributor

No, unfortunately the attribute table doesn't have any coordinates. 

0 Kudos
Celeste_SuliinBurris
New Contributor III

If the table has an address, you could geocode it, and then do a spatial join. If not, you are going to have a find or create a common attribute.  How would you match them by hand?

DanPatterson_Retired
MVP Emeritus

You will have to provide an id field or some other key field in both tables, should they currently not exist, in order to join the tabular data to the file with the geometry.  If you have geometry for both, you could do a spatial join...but you don't

LukeSturtevant
Occasional Contributor III

What fields do you have in both tables? Could you maybe provide a screen shot of both tables to see if there is anything we can do to help?

0 Kudos
ChadKopplin
Occasional Contributor III

Even if you have a name field identify each record you could join on this field, this could be bad if you have the same name for multiple records, but at least it should work for most of the records and cut down the amount of manual work that you may need to do.

Elizabeth_R_Jarvie
New Contributor III

Do you have a streets layer that contains the same street names that are in your table?  You could use that to identify the street your xwalks are on or even identify to two closest streets and create a join field. 

You may find it just as fast to manually add the 'Intersection Number' (given that it is unique to the crosswalk) to your xwalks layer and join your table using the intersection number.

JoeBorgione
MVP Emeritus

First off.... Don't use a shapefile.  That's so 90's.  Create an empty feature class in a File Geodatabase.  Add a long integer field called JoinId.

I would then add a filed in your table (CopyCrosswlakblahblahbla) called JoinId.  Type it as a long integer and then calc it to equal the OID.  This ensures a unique record id but it will 'travel' with the data no matter where you store it in the futuer.  The actual OID my change, but the JoinID remains static.

You have some work to do, but that's why there's payday.  With the table open start creating you polygons and populate the JoinID in the polygon with the appropriate JoinID from your table.

When you are done, perform a join, or simply create a relationship class base on JoinID.

That should just about do it....
ChadKopplin
Occasional Contributor III

Dianne,

Keep in mind that the ObjectID is an internal ID and can change based on changes to the individual line segments themselves.  Lets say you did not complete a line segment, so you create another segment to complete it, your shapefile will add a new ObjectID for that next segment.  The shapefile also orders the ObjectID from TOP to Bottom and starts in the upper left and moves to the right.  Just a few points to keep in mind as you create the line work.

0 Kudos