AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export Map Features to Shapefile

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
FJankovsky
1203 Views, 19 Replies

Export Map Features to Shapefile

I use a lot of data connections to Excel and Access for point features.  I often need to share this information with others that can use the shp format.  My normal workflow is to use the Export Layer Data to SDF feature and then use Mapimport to bring the points and Object Data into a new drawing.

 

FJankovsky_0-1701176741046.png

 

I then use Mapexport to create the shapefile.  This workflow works well but I often wonder if I'm missing a simpler solution that would directly export the map features from the data connection to a shapefile. 

 

19 REPLIES 19
Message 2 of 20
ChicagoLooper
in reply to: FJankovsky

Hi @FJankovsky 

A simpler solution? That depends on your DATA you start with.

 

  1. What format is Handhole Ma...? Shapefile? SDF? Something else?
  2. The statement .......a lot of data connections to Excel and Access for point features.... could mean different things to different users? Does that mean you are using an ODBC to Access/Excel to create a Join?

101.png

Chicagolooper
Message 3 of 20
FJankovsky
in reply to: FJankovsky

Yes, I am using ODBC to connect to individual files, no Joins.  Some connections for a particular project may be Excel, for other projects the connection may be to an Access DB.

Message 4 of 20
edwa8511
in reply to: FJankovsky

I usually use the MAPEXPORT command to create shapefiles.

Message 5 of 20
FJankovsky
in reply to: edwa8511

Unfortunately, I haven't found a way for map features to export using MAPEXPORT.

Message 6 of 20
ChicagoLooper
in reply to: FJankovsky

@FJankovsky wrote

<<....I am using ODBC to connect to individual files, no Joins.  Some connections for a particular project may be Excel, for other projects the connection may be to an Access DB....>>

 

Unfortunately that workflow won't work for you. In fact it  won't work for anyone that's wants to export to shapefile. An ODBC connection doesn't 'export' anything. It won't take an AutoCAD object such as a point, line, or polygon and 'create' a feature class in shapefile format (point feat. class, line feat. class, or polygon feat. class).

 

An ODBC will connect or JOIN data in Excel (or Access) with an existing shapefile feature class. 

 

For example you have a county-wide parcel shapefile accurately inserted in your drawing. This parcel feature class is geospatially represented by polygons and it has data in the shapefile's dbf (database file). The dbf has owner last name, owner first name, Parcel ID#, parcel address, square footage, property taxes, and school district. You are running for a seat on your neighborhood School Board and want to personally call each voting homeowner to promote your educational views and ask for their vote.

 

The shapefile database does not have phone numbers. Using your fine research skills you compose an Excel list of phone numbers with names. You can now use an ODBC to 'connect' or JOIN your Excel list with with the shapefile. Why do you want to do this? Because by joining your Excel with the shapefile's database you'll have phone numbers related to homeowners who, based on your map, live in your school district.

 

What are the benefits of using a JOIN? By using a join you can phone homeowners who reside in your school district. If you're ambitious, you can also hang a Flyer (brochure) on the front door knobs of those who couldn't (or didn't) answer your call. Without the JOIN you might end up calling homeowners who don't live in your district. And that wastes time and time is money.

 

The JOIN also insures you make contact with all homeowners in your voting district which optimizes your chances of making contact and getting their vote. 

 

If a new subdivision is built in your district, you can't use an ODBC to add-on to your parcel map. You can, however, add names and phone numbers to your Excel list.

 

An appropriate workflow in Map3D is to draw plain vanilla parcels onto your existing map. You may then ADD those newly drawn AutoCAD polygons to the shapefile. Once they'er successfully added it will increase the overall coverage of the parcel map. You can't use an ODBC to create a brand new shapefile or add new parcels onto an existing shapefile. An ODBC requires a KEY. You can manually add a KEY to the new subdivision parcels. 

 

Why does it work? A JOIN works because you have 'common data' that serves as a key linking both the dbf and the Excel list. For example, street address in the dbf is related to the same street address in Excel. The street address serves as a KEY. Without a key the join doesn't exist. And if it doesn't exist your ODBC won't work. Adding the Excel data to a shapefile is why you use an ODBC to begin with--you want to JOIN the Excel with the shapefile's database.

 

Depending on your data and what you want you want to accomplish, there might be alternative ways to achieve your goal without using an ODBC. Explain the data you already have, explain your Excel (if you have one), and what you're trying to achieve. Better yet share your data.

 

Chicagolooper
Message 7 of 20
edwa8511
in reply to: FJankovsky

In the past, I managed city utilities with CAD features linked to Access and Excel files (with ODBC connections); the GIS  features were also linked to these files to reduce duplication of data.  I was able to export features to shapefiles using MAPEXPORT.  It's been a while, but I believe that the associated data was available in the MAPEXPORT's Data window (in Select Attributes option) or I created Object Data tables for to match the fields in the database in order to export needed data with the feature. 

*It's been a few years since dealing with this, maybe someone else out there can shed light on how to do this*

 

I could export manholes with all of the pipe elevations, sizes, and directions or all of the water services with their sizes, materials, and dates.  I built the system to work similarly in AutoCAD Map, ArcMap, and ArcGIS because we had users with different needs/requirements.

 

 

 

For Chicagolooper's example, if you have access to ArcGIS, my preferred process would be to use the county's parcel data (or use ArcGIS's Data Enrichment on the parcel boundaries created in Map) to join to any additional needed datasets.  The new layer can be directly dropped or imported into Map, or it can be exported to a SHP and then brought into Map.

 

I'm lucky to be able to live comfortably in both ArcGIS and AutoCAD environments.  I typically use CAD for features and GIS for attributes.

Message 8 of 20
ChicagoLooper
in reply to: FJankovsky

@edwa8511 wrote:

<<...I then use Mapexport to create the shapefile. ..>>

You can export plain vanilla AutoCAD objects to shapefile. But........you can only export ONE feature class per shapefile and that means only points. Or only lines. Or only closed polygons. You are violating shapefile RULES if you try to combine more than one feature class. 

 

If you want to export more multi-classes simultaneously, then then have have to export to geodatabase (Gdb). Unlike a shapefile, a geodatabase can support more than one feature class. The term geodatabase can confuse some users. A geodatabase is unofficially considered a multiclass shapefile

 

 

You also wrote:

<<...This workflow works well but I often wonder if I'm missing a simpler solution that would directly export the map features from the data connection to a shapefile. ..>>

There might be. But to be perfectly honest, that depends on whether you start from scratch and what you're trying to export(?!) Or whether starting from pre-existing data and what you're trying to achieve. 

 

Can you provide more detail? And upload images? (More images are always better than a few.) Better yet, can you share a sample of your data and the expected result?

 

Chicagolooper
Message 9 of 20
FJankovsky
in reply to: ChicagoLooper

@ChicagoLooper 

Sample input file and sample output shapefile attached.

Message 10 of 20
Koesti
in reply to: FJankovsky

Hi @FJankovsky ,

another workflow for the export of Map Features to SHP files:

  1. Connect to any vector data FDO data source.
  2. Create a SHP FDO connection to empty folder.
  3. Run command Bulkcopy in TaskPane.

    Koesti_1-1712739672293.png

  4. Select the map feature sources (or layer if a filter has been set).
  5. Export to SHP connection.

Please find a short video showing the export of ODBC FDO connection to MDB exporting to SHP.

This method can also be used to add additional columns to SHP files.

Regards

Brigitte



Brigitte Koesterke

Technical Support Senior Specialist
Message 11 of 20
FJankovsky
in reply to: Koesti

@Koesti 

Briggite,

Thank you for the explanation and the short video.  That looks like a very workable solution.  I do have one question, I had heard in the past on this forum that some didn't trust Bulk Copy.  I don't remember what the issues were, but I've stayed away from it since then.  Do you have any thoughts or comments on the reliability of Bulk Copy?

Message 12 of 20
Koesti
in reply to: FJankovsky

Hi @FJankovsky,

interesting question, I do not remember to much trouble request in product support about BulkCopy.
The main points with SHP files is the limitations of characters of column names, which need to be edit manually.

Maybe you give it a try and let me know if you run in any problems.

Regards

Brigitte



Brigitte Koesterke

Technical Support Senior Specialist
Message 13 of 20
FJankovsky
in reply to: Koesti

@Koesti 

Brigitte,

 

I finally had some time to play with this and the process works well with one exception, one of my attribute fields is not coming through in the Bulk Copy process.  I've repeated the process multiple times and it drops the first column of my table each time.  Any ideas?

Message 14 of 20
ChicagoLooper
in reply to: FJankovsky

@FJankovsky 

Bulk Copy is used to copy existing attributes to a new shapefile, e.g. copy existing attributes, such as all attributes or just a few of the attributes, to a new shapefile. You may even RENAME an attribute (column heading in the Table View) using Bulk Copy procedure.

 

What does your shapefile represent (green X's shown below)? Manhole covers? Fire hydrants? Sump pumps? Something else? Your csv file is also shown, how does your csv relate to your Bulk Copy operation?  You don't need a csv file when performing Bulk Copy.901.PNG

 

FYI, you cannot use Bulk Copy to add an attribute (add a brand new data column) to the the Table.

 

Chicagolooper
Message 15 of 20
FJankovsky
in reply to: ChicagoLooper

@ChicagoLooper 

The CSV file is the data connected to with ODBC.  The items can be considered manhole covers.  When using Brigitte's method creating a shapefile using bulk copy, it is dropping my primary key attribute column.  I am not using the CSV file for bulk copy.

Message 16 of 20
ChicagoLooper
in reply to: FJankovsky

@FJankovsky 

OK, understood. You are not copying from the csv. So you are copying from an existing shapefile, correct? And you've designated a FOLDER for your bulk copy to land in once your bulk copy operation has completed, correct?  

 

Would it be possible to upload screenshots demonstrating your BULK COPY workflow? 

 

Chicagolooper
Message 17 of 20
FJankovsky
in reply to: ChicagoLooper

@ChicagoLooper 

Back to the original post, I am not copying from a shapefile, but rather an ODBC connection to either a CSV file or an Access database file.  I am then creating a shapefile from that data to share with others.

Message 18 of 20
ChicagoLooper
in reply to: FJankovsky

Images? Can you upload the dialog windows?

 

Chicagolooper
Message 19 of 20
FJankovsky
in reply to: ChicagoLooper

@ChicagoLooper 

Can't do that right now, but I followed Brigitte's video.

Message 20 of 20
FJankovsky
in reply to: Koesti

@Koesti @ChicagoLooper 

Brigitte,

I went through your video again in order to take some screenshots for ChicagoLooper and I discovered the issue.  When you made your new SHP connection, it was already "connected".  When I did my original testing, I did not connect to the folder.  Going over it today, I connected to the folder and all fields from my attribute table properly imported.

 

Thank you again for the video and thank you ChicagoLooper for following up.

 

Best regards,

 

Frank

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


AutoCAD Beta