[mapserver-users] DXF layer definition in mapfile

Dejan Gambin dejan.gambin at coin.hr
Thu Mar 4 07:24:26 PST 2010


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:

root# ogrinfo -so test.dxf entities

INFO: Open of `/Library/WebServer/Documents/demodata/test.dxf'
      using driver `DXF' successful.

Layer name: entities
Geometry: Unknown (any)
Feature Count: 888
Extent: (5416785.444339, 5009511.330286) - (5431570.527990, 5024296.413476)
Layer SRS WKT:
(unknown)
Layer: String (0.0)
SubClasses: String (0.0)
ExtendedEntity: String (0.0)
Linetype: String (0.0)
EntityHandle: String (0.0)
Text: String (0.0)


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 

I also tried without DATA and STYLEITEM keywords but doens't help.

Any hint?

Thanks very much

regards, dejan


More information about the MapServer-users mailing list