[mapserver-users] Need help with OGR/DGN

T.F. van den Berg t.f.vandenberg at larenstein.nl
Tue Mar 19 22:37:48 PST 2002


Sara
Through ogr, dgn will have the following generic attributes:

Type: The integer type code as listed below in supported elements.
Level: The DGN level number (0-63).
GraphicGroup: The graphic group number.
ColorIndex: The color index from the dgn palette.
Weight: The drawing weight (thickness) for the element.
Style: The style value for the element.

I.e through ogr no other attributes are returned. The owner of dgnlib
however has recognized the interest, so hopefully it will be added soon!
Regards
Thomas


See also:
http://gdal.velocet.ca/projects/opengis/ogrhtml/drv_dgn.html
http://mapserver.gis.umn.edu/doc/ogr-howto.html
and more specifically:
http://groups.yahoo.com/group/dgnlib/message/34







----- Original Message -----
From: "Sara Yurman" <syurman at spatialfocus.com>
To: <mapserver-users at lists.gis.umn.edu>
Sent: Sunday, March 17, 2002 7:12 PM
Subject: [mapserver-users] Need help with OGR/DGN


> I'm trying to use OGR with .dgn files to do something we currently do
> with shapefiles: produce images of individual parcels with digital
> orthos behind them.  I can get the files to show up with MapServer, but
> I can't get useful information from queries to the OGR layer.
>
> My second strategy was to use ogr2ogr to create shapefiles.  I got
> shapefiles, but without text strings or anything else that might connect
> parcel numbers with locations.
>
> Any suggestions would be deeply appreciated.  I'm truly befuddled.  I've
> listed my ogr2ogr string, the OGR layer from my mapfile, and the
> mapscript for the query below.
>
> Thanks,
>
> Sara
>
>
> ********************ogr2ogr***************************
> I tried a couple things fancier than this, but the
> results were identical:
>
> ogr2ogr -f "ESRI Shapefile" 9344 9344.dgn
>
>
> *******************OGR Layer from mapfile************
>
> LAYER
>     NAME "9344"
>     TYPE LINE
>     CONNECTIONTYPE OGR
>     CONNECTION "data/934413.dgn"
>     STATUS ON
>     STYLEITEM "AUTO"
>     CLASSITEM "LEVEL"
>     CLASS
>           NAME "Parcels"
>           EXPRESSION /[0-9]*/
>           TEMPLATE DUMMY
>     END
> END
>
> **********************Mapscript**********************
> This lists 276 as the number of results, but the number
> of lines is always 0.  The shapeindexes look good,
> ranging from 13 through 885.  Tileindex is always -1.
>
> $map = new mapObj( 'my.map' );
> $rect = $map->{ 'extent' };
> $layer = $map->getLayerByName( '9344' );
> $success = $map->queryByRect( $rect );
> $rc = $layer->{ 'resultcache' };
> $numresults = $rc->{'numresults' };
> print $numresults,"\n";
> $shape = new shapeObj(-1);
> foreach ( 0..( $numresults - 1 ) ){
>           $rc_mem = $layer->getResult( $_ );
>           $stuff = $layer->getShape( $shape, $rc_mem->{'tileindex'},
> $rc_mem->{'shapeindex'} );
>           print $shape->{'numlines'},"\n";
> }
>
>





More information about the MapServer-users mailing list