I have an autocad dwg. which i then saved as a dxf. I have way to many layers in it such as contours, buildings etc. All I need is the red and blue lines. I cannot delete the other lines as they contain the georeference I think.

when i add a vector layer it displays as points which cannot be edited.

What am I doing wrong.

  • Which program are you using?
    – Nathan W
    Aug 7, 2012 at 13:41
  • sorry. Want it in QGIS Lisboa . taken from autocad 2013
    – Ger
    Aug 7, 2012 at 15:55

1 Answer 1


Just picking this up because no one else has, not because I have much experience with DXFs.

An example. I have a mixed geometry DXF called su66.dxf. One of its layers, G8040201, contains contours that I wish to extract to a shapefile. I can do this using ogr2ogr:

ogr2ogr su66.shp -where "LAYER='G8040201'" su66.dxf

This is fine if you happen to know the names of the layers in the DXF. If you don't then you can get a list of the layers using ogrinfo:

ogrinfo su66.dxf -al | grep Layer > layers.txt

This will produce a long text file (layers.txt) with lots of duplicates that you can go through to find the layer names. It won't, unfortunately, tell you which layer contains the contours, for example.

Added later: Okay, Windows 7. If you installed QGIS using OSGeo4W and you don't know anything about working from the command line this is probably the simplest way.

When you installed QGIS it should have put a short-cut on your Desktop called "OSGeo4W". Using the Windows file manager copy this and paste it into the directory containing your DXF. Then double-click on the "OSGeo4W" icon, which should open a OSGeo4W command line window. Type the ogr2ogr command line here and then press return.


  • ok where do i type this in? stupid question i know but gotta start somewhere.
    – Ger
    Aug 8, 2012 at 9:58
  • Windows or Linux? N.
    – nhopton
    Aug 8, 2012 at 11:02
  • The dreaded windows 7. Seriously dislike windows 7. When I get the time i will move to linux.
    – Ger
    Aug 9, 2012 at 10:24
  • 1
    for windows there is a freeware program agr2gui ogr2gui.ca/en/index.php, which has an easy to use gui
    – Kurt
    Aug 10, 2012 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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