I have some CAD data in an unknown local coordinate system that I have to get into a geodatabase in a State Plane coordinate system. I have a CAD script that is currently being run to get do this from within AutoCAD, but I need to do this with Python instead now. I have some examples of the data in the State Plane coordinate system, but I am struggling as to how to find all of the parameters that I need to create the custom .prj file.
The script currently does:
1. Scale all -> 0,0 -> 1/12
2. Move all -> 18766.832,11612.104 -> 2829031.998,1017487.369
3. Rotate all -> 2829031.998,1017487.369 -> -30.0916403
4. Scale all -> 0,0 -> 0.9999129
I am unsure as to the best way to get the Easting, Northing, and Latitude and Longitude of Center. I think that the rotation and two scalings can be done by setting the rotation, units and scale factor. It is the rest that I am struggling to find.
I have done this numerous times.
Start with something from your GIS that is in the proper projection.
Sections work good because then you can easily adjust the CAD drawing to proper world location.
Export the sections to a shape file. Import them into CAD preserving the data and the projection. Make sure your Shapefile has the .prj extension
once imported lock the sections layer.
add your autocad data as a block.
Move it to the sections that a locked.
If you can this would be a good place to resize it and place it where it should go in the real world.
save the DWG.
run build and clean several times to get rid of the crud.
save the DWG.
Now you have choices.
First add the DWG into your ArcGIS session. If everything lines up they way it should (and it should) then you can proceed to strip the cad and export it to your database.
Or you can export the DWG as a shapefile. Save it to the original Sections shapefile you had imported. This way it will give it the same projection as the shape file had as CAD will not export a .prj file without a predefined projection in cad.
FYI, I have spent many hours converting AutoCAD drawings to ArcGIS and most of the DWGs either had no projection or were simply very wrong.
One system I converted was actually in the proper projection but whoever built it used millimeters or something to represent feet. End result the system which spaned 30 x 50 miles was the size of third base when brought direct into ArcGIS
When you open the AutoCAD drawing in ArcGIS does it come up in the proper geographic location?
I would suggest loading something first from the area then adding the DWG.
If it does then simply export the CAD features to a database.
It does not show up in the proper location. It shows up far away and is rotated differently.
Can you use the Georeferencing ToolBar? I am not certain if it requires a specific extension.
Add your CAD data to your drawing.
Zoom to the area where you KNOW your cad data should be.
From the Geoprocessing toolbar select the cad feature type you want to georeference and select fit to display.
then using knows referenced points from the CAD and the GIS use the Add Control Points on the toolbar to select a known CAD location first then the known place it should be.
The select a different CAD location (preferably some distance away) then the the the place it should be.
Do the mentioned procedures create a .prj for the local coordinate drawing or simply rectify said drawing to a known coordinate system (ie, unknown to state plane ****)? Based on the example listed, it seems that a planar transformation is created (based on a best fit) and not a projection (from a known geographic coordinate system to a local planar coordinate system). If the process described does create a prj, it would be helpful to be able to save the settings and create a coordinate system for CAD imports from the same source.