Transcript
Page 1: Converting CAD Data Creating a Stand-Alone Feature Class - GIS Mapping Software ... · 2006-02-15 · Converting CAD Data Creating a Stand-Alone Feature Class with the Correct Spatial

Converting CAD Data

Creating a Stand-Alone Feature Class with the Correct Spatial Reference

By Michele Mattix, ESRI Instructor

Editor’s note: In this article, the author walks the reader through the process of converting CAD data to a correctly projected stand-alone feature class in a geodatabase. The accompanying article, “Pre-Work Checklist,” provides a systematic method for becoming familiar with CAD before processing it. CADdatausedtogivemefits.IbeganmyGIScareerworkingpart-timeforaconsultingcompanythatperformedbothforestryandcivilengineeringservices.Inevitably,theengineerswouldcreatetheschematicsforanewhousingdevelopment using their computer-aideddesign (CAD) software, then hand it tome,“theGISgirl,”toaddittomyArcMapproject.IwouldproceedtospendthenexthourorsowonderingwhytheCADdatawassofaroutofalignmentwithmyotherdatathatitseemedinanotheruniverse. ManyGISprofessionalsuseCADdataintheirprojects.Itcanbeuseful,particularlyforadding new data to an existing geodatabase.For example,newdevelopmentprojects in acity are typically drawnup usingCAD.Thenewdataoftenfitsintoanexistingdatasetofstreetsorparcelsandcanbeaggregatedwiththisdatatobringthegeodatabaseuptodate. Though it is not necessary to convertCAD data to the geodatabase format touse geoprocessing tools, there are severaladvantages to converting CAD data. Whenconvertedandaddedtothegeodatabase,CADdatan Can be edited in ArcMap (unconverted CAD data cannot be edited)n Can be used to build a topologyn Can have subtypes and domains applied to itn Shares a common format with other, related dataHowever,themostimportantreasontoconvertCADdataistogetitintoproperalignmentandsetitsspatialreferencesothatitisnotjustinthesameuniversebutinthesamecoordinatesystemastherestofyourdata.

The TaskI have a geodatabase named MyCity thatcontains a feature class called parcels thatconsists of land parcel polygons. I’ve beengiventheschematicsofthenewdevelopmentinCADformatnamedPlat677thatshouldbeadded to the parcels data. After previewingtheCAD data inArcCatalog, it appears that

Answer these questions to get familiar with the data.

__Do you have reference data?ReferencedatashouldhavethesamecoordinatesystemyouwanttoapplytotheCADdatawhenitisconvertedtoageodatabasefeatureclass.ThisreferencedatamaycontaindatathattheCADdatashouldfitinsidesuchasaparcelsfeatureclass.UsethisdataasaguidewhentransformingtheCADdata’sposition.AftertheCADdataisconverted,youmaywanttoaggregatethetwodatasetsintoone.Inthisexample,IcheckthecoordinatesystemoftheparcelsfeatureclassandlearnitisNAD_1983_HARN_StatePlane_Kansas_North_FIPS_1501.[See the accompanying article, “Check the Spatial Reference for a Stand-Alone Feature Class,” if you are not familiar with checking the spatial reference for a feature class.]

__Which CAD file do you want to work with? TheCADdatahastwoentriesinArcCatalog.TheentrywiththewhiteiconistheCADdrawingdataset.Thisisessentiallyapicture—itssymbolizationcannotbecontrolledinArcMapanditdoesnothaveanattributetable.TheturquoiseiconistheCADfeaturedataset.Itcanbeexpandedtoshowaseriesoffeatureclasses(e.g.,annotation,multipatch,point,polygon,andpolyline).Typically,GISusersareonlyinterestedinthePolylinefeatureclass.Inthiscase,IwillusethePolylinefeatureclassforthePlat677featuredataset.

__Does the CAD data include projection information (i.e., a .prj file)? AprojectionfileisatextfilethatcontainsinformationaboutthegeographicandprojectedcoordinatesystemtowhichtheCADdatarefers.ArcMapneedsthe.prjfiletoautomaticallyaligntheCADdataviaon-the-flyprojection.Withoutit,ArcMaphasnowayofknowingwheretoplacethedata.Youcancheckthedata’scoordinatesysteminformationbyright-clickingtheCADfeaturedatasetinArcCatalogandviewingtheSpatialReferencetab.ThecoordinatesystemforthePlat677CADdatasetisundefined,whichmeansnoprojectionfileexists.Ifonedidexist,itwouldbecalledPlat677.prjanditwouldbelistedinArcCatalog.

__Do you have a World file or transformation coordinates?AWorldfileisatextfilethatmusthavethesamenameastheCADdataandhas.wldasitsfileextension.Itcontainsoneortwocoordinatepairsoffromandtovalues.ThesecoordinateswilldefinethetransformationoftheCADdatasoitcanbeproperlyorientedandalignedwiththeotherlayersreferencingaknowncoordinatesystem.WorldfilesarenotautomaticallycreatedbyeitherCADsoftwareorArcGIS. Inthisexample,Idonothaveaworldfileandwouldneedtocomeupwithtwocoordinatepairsoffromandtovalues.Thefromvaluesrepresentthe(x,y)coordinatesoftwopointsintheCADdataasitiscurrentlypositioned.Thetovaluesrepresentthesametwopointswithcoordinatesinthecorrectpositiontodisplayproperly.UsingtheCADPolylinefeatureclassandtheparcelsreferencedata,Icreatedaworldfile.TolearnhowtocreateaWorldfile,seethearticle“HowTo:TransformCADdatainArcMaptolineupwithotherdata,”attheESRISupportsite(article#29039atsupport.esri.com).

__What coordinate system do you want to apply to the CAD data when you convert it to a geodatabase feature class?Inthegeodatabase,featuresclassescanbestandaloneorcanbecreatedwithinanexistingfeaturedataset.Afeatureclasscreatedwithinafeaturedatasetwillinheritthespatialreferenceofthefeaturedataset.Spatialreferencesmustbesetforstand-alonefeatureclasses.Inthiscase,Iwantmysoon-to-beconvertedCADdatatohavethesamespatialreferenceastheparcelsfeatureclass.

Pre-Work Checklist

48ArcUserJanuary–March2006 www.esri.com

Page 2: Converting CAD Data Creating a Stand-Alone Feature Class - GIS Mapping Software ... · 2006-02-15 · Converting CAD Data Creating a Stand-Alone Feature Class with the Correct Spatial

www.esri.com ArcUserJanuary–March200649

HandsOn

Continued on page 50

Add the reference data to ArcMap. Ifnoneexists,thensettheDataFrame’scoor-dinatesystemtothecorrectcoordinatesystem.

Add the CAD Polyline feature class. Itprobablywillnotalignwiththeref-erencedatabecauseitisnotgeoreferenced.

Transform the CAD layer. (Layerproperties>Transformationstab)UseeithertheWorldfileortwocoordinatepairsoffromandtovalues.

Turn off unwanted CAD attribute fields.(Layerproperties>Fields).

Convert the now transformed CAD layer into a geodatabase feature class.Exportthedata(right-clicktheCADlayer,Data>ExportData).

Transform CAD data,then convert to geodatabase.

Workflow

12

3

4

5

The parcels feature class in the MyCity geodatabase is my reference data. The CAD data will fit within the purple polygon (encircled) area and will use the same spatial reference as the parcels layer.

this data is not properly oriented relative toits designated position in the parcels featureclass. I want to orient and align the CADPolylinefeatureclassandconvertittoanewstand-alone feature class and ensure that thespatialreferenceisproperlysetfortheMyCitygeodatabase. First, I will go through a pre-work checklist to get familiarwith the data.Please read the accompanying article, “Pre-WorkChecklist,”beforereadingfurther.

The Workflow After going through the pre-work checklist,I ammore familiar withmy data and readyto begin aligning and converting the CADPolylinefeatureclass.UsingArcMap,IwanttotransformtheCADdatasoitalignswiththeparcelsfeatureclass,thenconvertittoastand-alonefeatureclassintheMyCitygeodatabase.The spatial reference for the parcels featureclasswill be assigned to theCADdata.Theaccompanying workflow model shows thesteps I go through to accomplish this task.An alternate method for accomplishing thistask,not covered in this article,wouldbe toconvert theCADdata toa featureclass inageodatabasefirst, thenusespatialadjustmenttoolstoaligntheCADdata.

1. Add Reference Data.Iwill add the parcels feature class to a newmap document in ArcMap. It will be thereference data for the CAD data. The DataFrame adopts the layer’s coordinate system(NAD_1983_HARN_StatePlane_Kansas_North_FIPS_1501).

By adding the CAD Polyline feature class dataset, I can see it is not properly oriented. It needs to be transformed.

2. Add the CAD Polyline Feature Class. After adding theCADPolyline feature classto the map document, ArcMap displays awarningthatthislayerhasanunknownspatialreferenceandmaynotalignproperly.Icheck

Right-clicking on the feature class name in ArcCatalog allows you to view its Fields properties. Clicking on the SHAPE field at the top of the dialog box populates the Field Properties below. The last row provides spatial reference information. Clicking on the ellipsis button, circled here in red, allows you to view and change the coordinate system.

the layer’s alignment by viewing the DataFrame’s coordinate system properties andverify that this is true.The Polyline layer isnotvisibleatthecurrentextent.WhenIzoomoutthefullextent,Iseethatthetwolayersaredrasticallyoutofalignment—eachappearsasaspeckonmyscreen.TransformingtheCADlayerwillsolvethisproblem.

3. Transform the CAD Layer. After right-clicking on the CAD Polylinefeature class, I choose Properties from thecontextmenuandclickontheTransformationstab in the Layer Properties dialog box.The Transformation tab provides threeoptions. I click on the box next to EnableTransformations, browse to the location oftheWorldfile,andensurethatTransformBy:WorldFile is selected.Alternatively, if Ihadtwopairsoffromandtocoordinates(perhapsobtained from the supplier/creator of theCAD dataset), I could use them to create aWorldfileorenterthemintheTransformBy:

Page 3: Converting CAD Data Creating a Stand-Alone Feature Class - GIS Mapping Software ... · 2006-02-15 · Converting CAD Data Creating a Stand-Alone Feature Class with the Correct Spatial

Creating a Stand-Alone Feature Class with the Correct Spatial ReferenceContinued from page 49

50ArcUserJanuary–March2006 www.esri.com

The Export Data option allows you to convert the CAD data directly into a brand new geodatabase feature class. Since the CAD layer has an undefined coordinate system, I chose to use the coordinate system of the data frame. For output, I navigated to the MyCity geodatabase and named the new feature class Subdivision.

On the Coordinate System tab of the Spatial Reference Properties, you can select a coordinate system from a list of predefined ESRI supported systems, or you can import (i.e., borrow) the coordinate system of another feature class. If you want to create a projection file (.prj), click the Save As button.

Coordinatesoption.NomatterwhichmethodIchoose,whenIapplythetransformation,theCADdatamovestotheproperlocation.

4. Turn Off Unwanted CAD Attribute Fields. CADdatacontainsattributefieldsthatarenotuseful in GIS. Before converting the CADPolyline feature class to the geodatabaseformat, I right-click on the CAD Polylinefeature class and choose Properties. In theLayer Properties dialog box, I click on theFieldstabanduncheckeverythingexcepttheFIDandShapefields.

5. Convert to a Geodatabase Feature Class and Set the Spatial Reference.Right-clickingonthePolylinelayerintheTableofContents,IopenthecontextmenuandchooseData>ExportDatatoexportallfeatures.IusethesamecoordinatesystemastheDataFrame,choose Personal geodatabase feature class,

A World file is a text file that contains coordinate values of two points, both their current CAD values (from) and their transformed values (to).

Viewing the Data Frame Properties Coordinate System tab allows you to see the coordinate system of all layers as well as that of the Data Frame.

CAD data layer properties include a Transformations tab. Here you can properly position, or transform, the CAD layer using a World file or two sets of from and to coordinates.

The transformed CAD layer (shown in red) is now aligned with the reference data.

Before converting the CAD data to the geodatabase format, you can turn off unwanted CAD attribute fields by unchecking fields. Unchecked fields will not be converted.nametheoutputfeatureclassSubdivision,and

saveitintheMyCitygeodatabase.IalsoopttoaddthenewSubdivisionfeatureclasstotheData Frame. I confirm the spatial referenceof the new Subdivision layer by viewing itsproperties on the Source tab of the LayerPropertiesinArcMaporviewingitspropertiesinArcCatalog.Alternatively,Icouldalsohaveused the FeatureClass to FeatureClass toolinArcToolboxandsetthespatialreferenceinArcCatalog. AftercreatingthenewSubdivisionfeatureclass,Icouldconvertittopolygons.NowthatI am working in the geodatabase format, Ihave severaloptions for creatingbetterdata.Theremaybegapsandoverlapsbetweentheparcels and Subdivision features where thetransformation was less than perfect. I canedit the Subdivision features now or builda topology to cleanup thenew feature classso that there are no slivers or overlappingpolygons. Imightalsowant toaggregate theSubdivisionfeatureswiththoseoftheparcelsfeatureclass.

Page 4: Converting CAD Data Creating a Stand-Alone Feature Class - GIS Mapping Software ... · 2006-02-15 · Converting CAD Data Creating a Stand-Alone Feature Class with the Correct Spatial

The spatial reference information of a stand-alone feature class can be viewed in ArcCatalog.

1.Right-click on the feature class, choose Properties, then click on the Fields tab in the Feature Class Properties dialog box.2.The top of the dialog box lists the fields in the attribute table. Clicking on a field name populates the lower half of the dialog box with its field properties.3.Click on the Shape field. The last item listed under Field Properties is Spatial Reference. 4.Click on the ellipsis button beside the coordinate system name to open the Spatial Reference Properties dialog box. 5.Select, import, modify, or create a coordinate system. Using the Save As button creates a projection file (.prj) that can be associated with the dataset.

www.esri.com ArcUserJanuary–March200651

HandsOn

For now, however, my task is complete.I have successfully converted theCAD dataintothegeodatabaseformatandsetitsspatialreference so that it is properly oriented andaligned.ThisGISgirlfinallycanquitfrettingoverCADdatafloatinginundefinedspaceandtellit,definitively,wheretogo.

For More InformationLearnmoreaboutworkingwithCADdataattheESRIVirtualCampus(campus.esri.com).A free, hour-long seminar, Geoprocessing CAD Data with ArcGIS, is available aswellasaworkshop,Working with CAD Drawings in ArcGIS.

About the AuthorMichele Mattix is an ESRI softwareinstructor inRedlands,California. She holdsabachelor’sdegreeinmathematics,amaster’sdegree in geography, and a master’s degreeinenvironmental science.After struggling tolearnGISonherown,shevowedtomakethattaskeasierforothersbyapplyingherteachingtalentstoGISsoftwareinstruction.

Check the Spatial Reference for a Stand-Alone Feature Class

In the Fields tab of the Feature Class Properties dialog box, click on Shape, then on the ellipse next to Spatial Reference.

In the Spatial Reference Properties dialog box, select, import, modify, or create a coordinate

system. A projection file can also be created using

the Save As button.


Recommended