File listing

 < Day Day Up > 

Microstation Design Files (DGN)

These are also known as DGN files.

Data is encapsulated in a single file, usually with the suffix .dgn; for example: 0824t.dgn.

Data access/connection method

  • Access is available in MapServer through OGR.

  • The CONNECTIONTYPE OGR parameter must be used.

  • The path to the dgn file is required; file extension is needed.

  • All types of features in a DGN file are held in one "layer" of data. The layer is called elements and is the first and only layer.

  • The type of feature to be read from the DGN depends on the TYPE parameter in the map file.

  • DGN files typically contain POINT, LINE, POLYGON, and ANNOTATION feature types.

  • DGN files contain "styling" information, i.e., how to color and present the data. This is used, optionally, by specifying the STYLEITEM "AUTO" parameter.

    DGN files typically use white as a color for their features and therefore aren't visible on maps with white backgrounds.


ogrinfo examples

Using ogrinfo on a single DGN file

Note that no geometry/feature type for the layer is identified because it can be multiple types.

     > ogrinfo /data/dgn/0824t.dgn     Had to open data source read-only.     INFO: Open of '0842t.dgn'     using driver 'DGN' successful.     1: elements 

Using ogrinfo to examine the structure of the file/layer

DGN files aren't really GIS data files. They evolved from drafting formats used by computer-aided drafting/design (CADD) programs.

They carry a few key attributes that are usually consistent across all DGN files. Most of the attributes relate to graphical styling of features for map presentation, such as ColorIndex, Style, etc.

Spatial reference system information isn't always encoded into DGN files. This can be a major problem when trying to adequately reference the DGN data in another mapping program.

Measurement units can be a problem. In some cases the features could be located in kilometers or feet even though it isn't obvious from the output of ogrinfo. Sometimes the only way to identify or correct a problem with units is to open the file in Microstation software.

     > ogrinfo -summary /data/dgn/0824t.dgn elements     INFO: Open of '0824t.dgn'     using driver 'DGN' successful.           Layer name: elements     Geometry: Unknown (any)     Feature Count: 22685     Extent: (-513183.050000, 150292.930000) - (-224583.220000, 407463.360000)     Layer SRS WKT:     (unknown)     Type: Integer (2.0)     Level: Integer (2.0)     GraphicGroup: Integer (4.0)     ColorIndex: Integer (3.0)     Weight: Integer (2.0)     Style: Integer (1.0)     EntityNum: Integer (8.0)     MSLink: Integer (10.0)     Text: String (0.0) 

Map file example

     LAYER       NAME dgn       TYPE LINE       STATUS DEFAULT       CONNECTIONTYPE OGR       CONNECTION "dgn/0824t.dgn,0"       STYLEITEM "AUTO"       CLASS       END     END # Layer 

     < Day Day Up > 


    Web Mapping
    Web Mapping Illustrated: Using Open Source GIS Toolkits
    ISBN: 0596008651
    EAN: 2147483647
    Year: 2005
    Pages: 138

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net