[mapserver-users] DXF layer definition in mapfile

Dejan Gambin dejan.gambin at coin.hr
Fri Mar 5 02:55:42 EST 2010


Frank,

You were right (as usual I would say :-)

I was using MapServer 5.6.0 (on Mac OSX, from KyngChaos) with GDAL Complete 1.6. I upgraded GDAL to 1.7 but didn't upgrade MapServer to 5.6.1 so it was using GDAL 1.6 I suppose. Now everything works

Thanks very much

regards, dejan
On 4. ožu. 2010., at 17:06, Frank Warmerdam wrote:

Dejan Gambin wrote:
> Hi,
> Since DXF driver has been made, I would like to show a DXF file on the map. Is this possible? What syntax do I have to use to make it work?
> I have tried defining it similar to dgn syntax, but it doesn't work. I get: "msOGRFileOpen(): Open failed for OGR connection in layer `layer_name'.  File not found or unsupported format.". ogrinfo works fine on this file. For example:
...
> My layer definition looks like this:
> LAYER # dxf
>  NAME         "layer_name"
>  GROUP 	   "group_name"
>  STATUS       ON
>  TYPE         LINE
>  METADATA     "DESCRIPTION" "Description"
>  END
>  CONNECTIONTYPE OGR
>  CONNECTION "/Library/WebServer/Documents/demodata/test.dxf"
>  DATA "0"
>  STYLEITEM "AUTO"
>  CLASS
>    NAME "All"
>  END
>  PROJECTION
>    "init=epsg:31275"
>  END
> END 

Dejan,

I suspect you have more than one gdal/ogr on your system and MapServer
isn't using the new one.  Because DXF files are represented as having only
one layer you don't normally need a DATA statement to select the layer.
One example of mine looks like:

MAP

STATUS ON
EXTENT 0 80 120 160
SIZE 600 400
FONTSET "/home/warmerda/mapserver/fonts.lst"
IMAGECOLOR 0 0 128

IMAGETYPE png

LAYER
 NAME shppoly
 TYPE line
 CONNECTIONTYPE OGR
 CONNECTION "assorted.dxf"
 STATUS default
 STYLEITEM "AUTO"
 CLASS
   NAME "work"
 END
END

LAYER
 NAME textstuff
 TYPE annotation
 CONNECTIONTYPE OGR
 CONNECTION "assorted.dxf"
 STATUS default
 STYLEITEM "AUTO"
 CLASS
   NAME "work"
 END
END

END


-- 
---------------------------------------+--------------------------------------
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