DGN Files map registration

617
4
12-09-2012 09:36 PM
Santosh_Pavan_KumarNukala
New Contributor III
Namaskaaram/ Hola/ Hi,

I need to used DGN files in my application, I was somehow able to display a DGN file using CAD related interfaces in ArcObjects, the DGN file was not geo-referenced and hence was displaying junk coordinates. Now if I have to use DGN files in my application, do I need to convert DGN to any other ArcGIS related format like coverage or shapefile and then register the converted format and use it. I remember in my previous assignment while working on ArcInfo Workstation 8.0.2 , we converted DGN file to ArcInfo coverage and then used the coverage for future purpose. Now im developing in C#.

Request you to please help me on this.. If any sample code is available for geo referencing the DGN files, please post it

Thanks in Advance,
Santosh
0 Kudos
4 Replies
KarenHodge
Esri Contributor
You may want to check out the topic of Georeferencing a CAD Dataset in the desktop help.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001000000010000000.htm

The DGN file can be georeferenced using an affine transformation stored in a world file.  You can, of course, convert the CAD drawing to a geodatabase, but that isn't required.


Namaskaaram/ Hola/ Hi,

I need to used DGN files in my application, I was somehow able to display a DGN file using CAD related interfaces in ArcObjects, the DGN file was not geo-referenced and hence was displaying junk coordinates. Now if I have to use DGN files in my application, do I need to convert DGN to any other ArcGIS related format like coverage or shapefile and then register the converted format and use it. I remember in my previous assignment while working on ArcInfo Workstation 8.0.2 , we converted DGN file to ArcInfo coverage and then used the coverage for future purpose. Now im developing in C#.

Request you to please help me on this.. If any sample code is available for geo referencing the DGN files, please post it

Thanks in Advance,
Santosh
0 Kudos
Santosh_Pavan_KumarNukala
New Contributor III
Thanks for the reply.. I had checked this link previously but my requirement is .. I need to Georeference DGN maps without using Desktop related tools like georeferencing toolbar.. I only have ArcGIS 10 Developer Kit License and dont have desktop license. So is there any way I can georeference the DGN files ? I have checked Coverage and DataConversion geoprocessing tools which converts the CAD data into geodatabase or coverage, and there are commands like TRANSFORM (affine/Projective) in coverage tools through which i can transform the coordinates.

I have the code that extracts polyconic coordinates from the DGN file's header, secondly I am able to frame the topleft and bottom right coordinates base on the Mapsheet Number (DGN file name.. for ex 38K.dgn) using the mapsheet name 38 and K, we can frame the correspoding topleft and bottom right coordinates. earlier in Workstation we converted the dgn to coverage using IGDSARC command ,then created a dummy coverage with lat long coordinates and transform the coverage to dummy coverage's coordinates using Transform command.

I have seen some georeferencing classes that require .wld file or .prj file to be generated. I would like to know if there is anyway to directly georeference the CAD data without using desktop. In case we need to use geoprocessing tools.. please send me the links for some samples on using Coverage/Coversion tools as i could not find much help.
Request you to kindly reply on this and let me know your opinion.


You may want to check out the topic of Georeferencing a CAD Dataset in the desktop help.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001000000010000000.htm

The DGN file can be georeferenced using an affine transformation stored in a world file.  You can, of course, convert the CAD drawing to a geodatabase, but that isn't required.
0 Kudos
KarenHodge
Esri Contributor
I saw you posted in another forum as well.  I may not have great insight for you.

CAD only supports a simple, two-point transformation using a WLD file.  You can programmatically create that WLD file and apply it. 

However, in your other post, it appears that you need a more complex transformation.  In that case, you should first convert the CAD data to a geodatabase.  Best results are also achieved when the CAD file has an associated PRJ.

Now that you have a geodatabase, you can do a more complex transformation of the data.

To get answers on how to do data transformation on geodatabases, you may want to repost your question with a different title omitting the reference to DGN files.  DGN transformation is so different than geodatabase transformation.
0 Kudos
Santosh_Pavan_KumarNukala
New Contributor III
First of all Thanks a Lot for replying. I have somehow found a way to overlay my vector DGN file onto my raster
image. Here is how i have done.

- I have programatically created a WLD file and assigned the from and To coordinates to the DGN file.
- After applying two point transformation, the DGN file did not overlay exactly on my geo-tiff raster image. I Then Imported DGN to a feature dataset in Geodatabase. Using CadToGeodatabase class.
- I have decided to apply a spatial reference to the feature dataset using a prj file.
- I managed to know values of GCS datum, spheroid, Prime meridian, Polyconic Projection for maps of my country.
- Assuming these values remain constant for all the maps that i use. The only values I had to manipulate in the prj
file that differ from map to map are - Central Meridian and Latitude of Origin. assuming Polyconic proj.
- I programatically changed these two parameters in prj files and saved it with map name ( abc.dgn --> abc.prj )
- Later I used the below script in python to Define Projection for imported the feature dataset.

*****************************
import arcpy
import os

arcpy.env.workspace = "D:/"
arcpy.env.overwriteOutput = True
spatialRef = arcpy.SpatialReference("D:/abc.prj")
arcpy.DefineProjection_management(imported_dataset, spatialRef)
******************************

After applying spatial reference to the Imported feature dataset, the feature dataset exactly overlaps on  my geo-tiff image.
I am not sure if this is the actual solution but I was somehow able to see what i wanted. I considered applying transformation after importing to geodatabase. There are SpatialAdjustment Tools which do the transformation like Piecewise, Edgematching, Affine etc.. but all these classes were found in ESRi.ArcGIS.EditorExt namespace which can be used in Desktop applications and ArcMap Edit sessions. Since I was working on stand alone application with Developer license only, I could not use these Spatial Adjustment classes and if there was a way.. I did not know how to use them.

Now my next goal is to use symbology for various 63 geographic layers imported from DGN map. There is a Level Code assigned to each of the 63 layers. I need to segregate each layer based on LEVEL_CODE and assign line styles and Symbology to each layer. Please Help ..


Thanks/ Gracias
Santosh
0 Kudos