February 03, 2006

The Complete CAD Spatial Reference

I have done my share of painting and have found that people take one of four approaches to painting around outlets. 1. Paint over everything, I guess this usually starts by forgetting that the electrical outlet is there, then trying to use the roller to go around it accidentally painting over it and then saying to yourself, that doesn't look that bad doesn’t it? (it does look that bad!) 2. Use a brush to cut around the plates; this usually results in a ridge around the outside of the plate and a small sliver of the underlying color showing through. 3. Tape around the switch plate and then paint. This is the worst one, although depending on your skills of taping (and more importantly removing the tape) it can create a nice finished result; however, it is ten times more work than is needed. 4. The best practice for painting around switch plates is to remove the plates, paint and then after everything is dry put the plates back on. (Same can be said for light fixtures, air vents, etc...)

Best practices for CAD interoperability can take many forms since the use of CAD and GIS data can be very diverse. Last post I discussed the fact that it is always better (although not required) to include a coordinate projection file with your CAD drawings to define where on the world you are. If you don’t you’ll get a little annoying message telling you that the data you’ve added to ArcMap has an unknown spatial reference. Besides that ArcGIS won’t know what to do with your CAD data if it is added or copied to a map frame with a different coordinate projection. ArcGIS will use the coordinates in the drawing unmodified unless you give it more information about where on the globe the data belongs.

Another file that can be included with a CAD drawing is called an ESRI world file. This file is an ASCII file of two sets of coordinates that define a coordinate transformation. The file containts two base points and two target points. If a world file exists in the same directory with the same name as the drawing with a .WLD file extension. The four points in the world file will be used to calculate new coordinates for the drawing. With these four points there is enough information to define a MOVE, SCALE and ROTATE transformation. When data is created in page units or some local coordinate system the world file can be used to push the CAD data into its proper position. If you have 500 drawings that are all oriented correctly one to another, but are drawn in a local coordinate system, say using an origin coordinate (0,0) at the corner of some building, you can create an ESRI world file that defines the proper geographic location of that building corner (0,0) and one other point on the map and then include what the proper coordinates should be. Since each of the drawings is properly oriented one to another, you can save time by simply copying the one world file 500 time renaming it for each file name, with a .WLD extension. By also including a projection file properly named for each of the 500 CAD files, ArcGIS would have a complete and accurate spatial reference for the data in each CAD file even though the data was drawn in a local coordinate system. Better than creating a world file for each of these CAD drawings would be to use your CAD program to MOVE, SCALE and ROTATE the drawing contents into the proper coordinates space so that the ESRI world file would not be needed. World files are for people who don't have or know how to use their CAD program.

What if there was a sample tool that could control your AutoCAD application and use a single ESRI world file definition to update all your CAD drawings for you? What if this tool also allowed you to pick a spatial reference (projection file) for all of them and create the properly named file? Would that be useful to you…? Send me your comments.

6 Comments:

Anonymous Anonymous said...

Dear Sir,

Such a tool would be very useful. BTY, how does one obtain the ESRI world file & projection file? can one obtain the files from ArcGIS? how can a CAD user make use of the files to align say the CAD site plan with the files?

If our GIS department receives amny CAD site plans from different architects, how could we import certain CAD shapes e.g. building outlines into ArcMAP easily. thks

6:35 PM  
Blogger Don Kuehne said...

World files are simple ASCII files of two sets of points. They are created interactively using the georeferencing toolbar in ArcMap, or you can generate the file yourself in a text editor. See the help for the format.

.PRJ files are included in the install of ArcGIS in a folder. You can also generate your own custom coordinate systems. Most people select an existing coordinate system from the extensive collection of files provided.

ArcGIS reads CAD files as GIS data, however distinguishing between objects can sometimes be challenging if there is no CAD standard. You may benifit from a series of articles I wrote a while back on the subject:
http://giscadblog.blogspot.com/2006/02/organizing-cad-data-in-arcgis-part-17.html

8:43 AM  
Blogger Carol said...

Hi Don,

Very useful information. Thanks!

In your third paragraph you state that it is better to use your CAD program to MOVE, SCALE, and ROTATE the drawing into the correct coordinate space rather than have to do it once you have added it to ArcMap. I agree.

We have a lot of contractors who supply us completely spatially unreferenced drawings and I would like to change this. However, they often say they don't know how to do it or can't do it in CAD Lite.

Can you give me a brief run-down of how they can reference their drawings to my required projection system (WGS84 UTM)within CAD? Also what software and version do they need to be able to do this? Can it be done in CAD Lite?

Many thanks,
Carol

3:58 AM  
Blogger Don Kuehne said...

Carol,

Contractors can use the actual coordinates of the real world objects in your projection. They do have the ability in any CAD program lite or not to decide what coordinates they will draft objects at. Therefore the process of MOVE, SCALE, ROTATE would still apply of the Lite CAD users too. They need to know at least two points in their CAD map and where in your coordinates system they belong to get their bearings. There is no way around having some tie in to control points for the project. If they use a different projection that is actually ok, since ArcGIS can project the data. You would just need to supply the .PRJ file for that projection.

The second part of the spatial reference would be the definition of the coordinate system for the CAD file. For AutoCAD users you could use the free ArcGIS for AutoCAD download to pick a coordinate system definition that would be embeded into the drawing. Or you could supply the .prj file and simply name the correct .prj file that represents your coordinate system where the name of the file is [drawing name].prj. You can do this after the fact. If all drawings are in the same coordinate space in a folder then you could also take advantage of the universal projection file and use that one .PRJ file to define the coordinates for all CAD files in a directory.

If contractor do use a different projection than yours, that is actually ok, since ArcGIS can project the data. You would just need to supply the .PRJ file for that projection to identify what the coordinate numbers in the file are supposed to be drawn in.

There is no magic if the contractors don't know where they are on the earth in any know coordinate system.

Remember to keep the two parts of the Spatial reference separate. One is do the numbers that represent coordinates in the CAD file correct for the projection. The next part is have I defined for ArcGIS which coordinates system the coordinates are supposed to be using (this is the .PRJ either external, internal as with ArcGIS for AutoCAD, or using the universal .PRJ).

Note: ArcGIS for AutoCAD does not work in AutoCAD LT. So those users would do just fine by drawing in the correct coordinate space and you could provide the .PRJ as an external file.

10:21 AM  
Anonymous Anonymous said...

Hi Don,
I came across your blog again; I should have bookmarked it years ago when I first viewed it. Anyways, I am continuously having issues with .dgn files from our DOT client.

Does ESRI have any way of identifying how many models (other than default) are in the .dgn file?

I know the scaling factor to get the .dgn data out of the local datum plane into state plane coordinates, but I don’t see any real easy way to apply that scale factor when converting .dgn to GIS. I have created .prj with the scale factor attached, but the data doesn't move.

Any suggestions or tips?

Thanks!
Chris

3:34 PM  
Blogger Don Kuehne said...

The geoprocessing tool Import from CAD can create a staging geodatabase where the different Microstation models are identified. You can join a couple of tables together and get a pretty good idea of where things are inside the .dgn file that way. You can even join the table by EntityID back to the direct read view of the data in a blue-folder CAD feature class view of the CAD file.

As far as the scale factor. If it is a datum redefinition you are working with you would need to consult someone a little more familiar with coordinate system definitions than me. Once you have the right modification to the .prj file ArcGIS would read it correctly. In fact I was just working with some people at Arizona DOT that performed such an edit on their .prj files for reading their Microstation files. If what you are doing is just a standard offset and scaling of false coordinates in a CAD file then the shift would be defined in the World File (.wld) instead.

3:50 PM  

Post a Comment

<< Home

FREE hit counter and Internet traffic statistics from freestats.com