SHP file and data table modifications

SHP file and data table modifications

Anonymous
Not applicable
3,006 Views
4 Replies
Message 1 of 5

SHP file and data table modifications

Anonymous
Not applicable

Hello!  A newbie here!  I am using Windows 10 and 2014 Civil 3D/Map 3D. The past couple days, I have been researching how to do the below process. I keep searching for answers and have found find bits and pieces that seem to be hints and clues, but I haven't been successful.  I'm not sure if I'm missing holes in the complete set of steps  or if I'm searching for the answer using the wrong terminology.  But what I have tried isn't working. So,I thought I would try this forum out:

 

Overall objective: I am trying to create a new SHP file from an existing SHP file that has additional columns of data.  So my question is:

 

1. How do you preserve or do a "save as" of an existing SHP file and rename it?  Is it an export function?

2. After I create a renamed or new version of an existing SHP file and delete the geometries that I don't want within the file, how do I "purge" or delete the rows of information from the table?

3. Lastly, how do you create additional columns within the Data Table so we can input information?  I want to add columns that have a score from 0-4 and then a column that has some text information.

 

Thanks for your help!  

0 Likes
Accepted solutions (1)
3,007 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Accepted solution

Hi,

 

there are probably different ways to achive that - here is one:

 

1. How do you preserve or do a "save as" of an existing SHP file and rename it?  Is it an export function?

 

 

Windows Explorer: Copy all files which belong to your SHP file set (e.g. shp, shx, dbf)

Rename all copied files as you wish (just make sure the name is identical for all the different file extensions).

 

2. After I create a renamed or new version of an existing SHP file and delete the geometries that I don't want within the file, how do I "purge" or delete the rows of information from the table?

 

If you delete SHP geometry (features) with a standard GIS application the attribute data is deleted automatically. No need to delete that separatly. 

Its the other way round which can lead to issues - open the DBF file (attribute data) in Excel and delete some rows and save it. You will just have destroyed your SHP file.

 

3. Lastly, how do you create additional columns within the Data Table so we can input information?  I want to add columns that have a score from 0-4 and then a column that has some text information.

 

Import your SHP into Map/Civil using "mapimport".

In Import option choose "import attribute data".

Map will create a Map-Object-Data table for the attribute data. You can add new columns using Map functionality (command adedefdata):

After finishing export the files as SHP again - don't forget to export attached attribute data as well (command mapexport).

 

 

 

Rb

 

 

 

 

Message 3 of 5

Anonymous
Not applicable

Thanks so much! I thought I had use the SHP data through the FDO connection.  So the import and export function makes sense.

 

I have followed the steps and it appears to be working.  However, I am not getting the geometry and the information to export as I would expect.  There doesn't seem to be any geometry show up and while the columns in the data table are showing, there isn't any data within the fields once I connect the SHP file.

 

I'll play around with the export option and do some searching, but if you have any quick thoughts, I would appreciate it.  

0 Likes
Message 4 of 5

Anonymous
Not applicable

Hi,

 

Map has a SchemaEditor for FDO data sources - but for an unknown reason Map cannot edit an existing SHP schema (e.g. adding / deleting columns) as soon as the SHP contains data.

 

So, you did the import, added the columns?
Then you do the export?

But the result is not as expected after connecting through FDO?

 

(1) Geometry not showing up?
First copy SHP, SHX and DBF file of the newly exported SHP into new folder.
Then open new drawing and add the copied SHP file.

Geometry showing up?

 

(2) Attribute data columns empty?
There should be some data - maybe not all exported features were linked to the map object data table. Did you export features you did not import prevoiusly? If so - these exported objects had not been linked to the Map object data table - and hence there is no data for them.

 

rob

 

 

0 Likes
Message 5 of 5

parkr4st
Advisor
Advisor

Another way.

 

with the shp in a map, right click the layer in Task Pane, Display manager, and select Export Layer to SDF, and save the SDF file

 

put the SDF into the map and select task pane , Map Explorer tab & right click select the SDF layer and select edit schema

 

In the schema editor you can add the fields you want directly to the data table.  You can verify the addition by looking at the data table for the SDF file as you go.  Fields can also be removed from the schema by right click and delete property so be careful.

 

A mapimport with the data and mapexport with the data back to shp.  Make sure you keep the data attached in mapimport process in the data column, click and select Create Object Data; the select fields button and select data fields you want.  this is a chance to remove certain data from the data set you are creating without changing the original SDF file data.

 

Select all the imported objects and Mapexport, save the new file as ESRI shapefile(*shp), with a new file name, Selection tab chose the relevant options, Data tab, click the select attributes button and select the object properties, (drop down to see the list),  Options tab make sure the Coordinate system is correct and Other, Treat closed polylines as polygons if that applies.  OK and your new .shp is written.

 

As you modify, add or subtract data from the data set after the changes are made there is a process named Check in that you do to write the changes to the data table.  it is available with the command -MAPCHECKIN, on the Feature Edit ribbon.  There is an pencil icon in the rightmost column of the data table to indicate the changes made so you know which record is being checked in.

 

Another way to add column to the data table is with calculations using data in the table through the Options menu at the bottom of the data table.

 

dave