[FWTools] dgn2shp & guide

Frank Warmerdam warmerdam at pobox.com
Wed Mar 14 11:46:01 EST 2012


On Wed, Mar 14, 2012 at 7:04 AM, Peter Simonovic <psimonovic at gmail.com> wrote:
> Hi all,
>
> I have DGN file with 49 levels and I need to split it into 49 shapefiles.
> It's possilble to use FWTools for that? Can you recommend me some
> cheatsheets or guide,
> how to use FWTools?

Peter,

The level of an element in a DGN file is exposed as the "Level"
attribute.  With ogr2ogr you can do something like the following
to extract only one level.

ogr2ogr level6.shp input.dgn elements -where "level = 6"

You could write a bat file to do this for many levels.

Alternatively you could write a python script to run through the file once,
and write out each element to an appropriate shapefile but writing such
a script would be fairly involved.

Various resources on the GDAL/OGR utilities in FWTools can be found
at http://www.gdal.org/

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 Software Developer


More information about the FWTools mailing list