[Mapserver-users] Does anyone know how to view an individual layer in a DGN file?

Frank Warmerdam warmerdam at pobox.com
Fri Dec 12 08:16:11 PST 2003


Stephen Clark wrote:
> Hi all,
>  
> I have some Microstation DGN file that are comprised of several layers 
> of data.
>  
> How would I view only one layer at a time using a layer file?
>  
>  
> Here is what I have to view the entire DGN file:
>  
> LAYER
>    NAME "FDP_2001_dgn"
>    TYPE LINE
>    STATUS ON
>    CONNECTIONTYPE OGR
>    CONNECTION 
> "d:/sclark1/server_data_copy/datasets/forest-data/TPL/fdp-dgn-utm/fdp_2001_utm.dgn"
>   CLASS
>  COLOR 0 255 0
>   END
>   PROJECTION
>      "AUTO"
>   END
>   METADATA
>     WMS_TITLE "FDP 2001"
>     WMS_ABSTRACT "N/A"
>     WMS_SRS "EPSG:26910"
>   END
> END

Stephen,

The OGR DGN driver represents all levels in the DGN file as a single OGR layer.
However, there is a Level attribute that you can use to distinguish the levels
you want to select.  So you could add something like the following to your layer
to select only one level:

  FILTERITEM "Level"
  FILTER "32"

Note, that MapServer will still read all the elements in the file and
internally discard the ones not of the correct level.  If you create 24
LAYER's for each of the levels, the file will effectively be read through
24 times.  Not very efficient.  If you intend to do alot of rendering from
DGN data, and you want efficiency it would generally be better to pre-split
the data into files with the desired per-layer data.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the MapServer-users mailing list