Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have been given a DXF that contains a Elevation attribute but we would like to generate a 3D DXF. I know I can generate a 3D dxf from a shapefile using:

ogr2ogr -f "DXF" out.dxf in.shp -zfield Elev

But the ogr driver doesn't seem to pick up the attributes as fields in the dxf.

Does anyone know if this is possible.

I would like a free solution if possible. We do have FME but I'm looking around for other options.

share|improve this question
not sure what you mean by elev attribute. is it a block definition with attributes? – Brad Nesom Aug 2 '11 at 5:07
up vote 3 down vote accepted

I have been trying to find a way of doing this for months. In the end, the only method I could find was to load the DXF into gvSIG and export it as a shapefile. Doing this adds the linestring z-value to the shapefile's DBF as an attribute.

In my case, the DXFs were OS OpenData containing contours, along with other data that I did not require, so I extracted just the contours to a new DXF before loading the file into gvSIG:

ogr2ogr -f DXF contours.dxf -where "LAYER='G8040201'" original.dxf


share|improve this answer

In FME you would want the 3DForcer transformer.

share|improve this answer
This is the route I would do - though the question sways for a cheaper (i.e. free) solution. – Mapperz Aug 3 '11 at 2:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.