Hot answers tagged

30 votes

Computing parameters for QGIS Affine Transformation

First you need to project your geographic coordinates to a cartesian 2D coordinate system, since affine transformations don't apply to geographic coordinate systems. You can apply an affine ...
user avatar
12 votes

Georeferencing DXF using QGIS?

Another - more interactive - option is the Vector Bender plugin. It does to vectors what georefencers does to raster. This feature is also known as "rubber sheeting". There is even a video ...
user avatar
  • 82.1k
9 votes

Exporting to DXF file from QGIS?

There is now native export into DXF in newer versions of QGIS which allows to export map layers including the labels: More about the functionality can be found here: https://www.qgis.ch/en/projects/...
user avatar
  • 9,236
8 votes

Importing DXF in QGIS 3

Option 1: You don't need a plugin for that. You can import DXF (or DWG) in Qgis with a built in option: go to: project >> Import/Export >> Import Layers form DWG/DXF . Later you can export or save it ...
user avatar
  • 531
7 votes

Importing 3D DXF file into QGIS with z information as attribute value?

Miro's answer will work fine, but if you just want to add a Z value to your attributes table (perhaps for labeling in a map or some other reason), I would start as he suggests: v.in.dxf - to import ...
user avatar
  • 33.1k
7 votes

Importing 3D DXF file into QGIS with z information as attribute value?

When talking about having only contours in 3D dxf, the proper way is definitely NOT extracting the vertices as XYZ and interpolating the surface from points. That way you lose the information about ...
user avatar
  • 9,236
7 votes
Accepted

QGIS Export: Set DXF Layers By Attribute

For the sake of closure (and in case I need to look this up again) I'm posting how I created my DXF file with layers. This uses ogr2ogr, but I used the QGIS toolbox so I guess technically it could ...
user avatar
  • 556
7 votes
Accepted

Can't export geometry generator styling to DXF - alternatives?

Important 2018 update I'm not sure which update of QGIS 2.x and 3.x changed it, but as of 2018 November and probably earlier, geometry generator symbology styling does get exported with the native ...
user avatar
  • 7,459
5 votes

How to convert MXD to DWG File

As far as I know, which may not be very far, you can't do that. An mxd is a separate document from the data it contains. Many CAD programs can use shapefiles, although again you wouldn't get symbology....
user avatar
  • 2,240
5 votes
Accepted

How to extract style data from DXF when converting to geoJSON

Have a look at the attributes. GDAL can read the styles from DXF: ogrinfo jcsample.dxf -al INFO: Open of `jcsample.dxf' using driver `DXF' successful. Layer name: entities Geometry: Unknown (...
user avatar
  • 52.5k
5 votes
Accepted

Import .dxf with pyqgis

When constructing the layer URI, remove blank spaces and use geometrytype parameter (all in lower-case) instead of geometryType. See the PyQGIS Cookbook for reference. The relevant part in your code ...
user avatar
5 votes
Accepted

Export DXF from QGIS layer using PyQGIS?

You can take example on the code in qgisapp.cpp and transform it to python as follows (just replace the elements within underscores): dxfExport = QgsDxfExport() settings = iface.mapCanvas()....
user avatar
5 votes
Accepted

Existing C++ libraries that convert ESRI shapefile to DXF/DWG

GDAL supports open ESRI Shapefile and save it as DXF. The C++ API intro is here: https://gdal.org/ogr_apitut.html
user avatar
5 votes
Accepted

Converting GeoDataFrame to DXF using GeoPandas

GeoPandas supports dxf. You just have to keep in mind that dxf can hold only geometry, not attributes, which means that you have to save GeoSeries, not GeoDataFrame. geodataframes = [gdf1, gfd2, gdf3] ...
user avatar
  • 2,159
5 votes
Accepted

Export Project to DXF dialog using Python

Does DxfLayer even support multiple inputs? No. The error QgsDxfExport.DxfLayer(QgsDxfExport.DxfLayer): argument 1 has unexpected type 'list' states that, explicitly. But you can use dxfExport....
user avatar
4 votes

DXF export in QGIS giving hatches instead of polylines

Qgis uses GDAL's ogr2ogr to export between formats and from www.gdal.org, "Polygon and MultiPolygon features are written as HATCH entities", so the hatches in AutoCAD should be expected. To generate ...
user avatar
  • 2,100
4 votes

Project house on WGS84

You can accomplish it by using the QGIS Vector Bender plugin, which allows you to translate, rotate, scale, and even distort (if necessary) your original DXF layer. Basically, you will need to ...
user avatar
4 votes

Project house on WGS84

What you are missing is the coordinate of the origin (0,0) of the DXF drawing in degrees. You would have to put up a local coordinate reference system on the origin of the drawing. If you are lucky, ...
user avatar
  • 75.1k
4 votes
Accepted

How to export elevated contours to a DXF file in QGIS

If your original data set is in 2D then you have to add -dim 3. Try this command: ogr2ogr -dim 3 -zfield ELEV -f DXF contours-out.dxf contours.shp The warning about attribute creation is no problem, ...
user avatar
  • 6,762
4 votes

Label rotation values in DXF imported into QGIS

Answer of Carlos is good. Just some precision here. Concerning angle calculation : -0.8028514559 * 180 / pi() = -46 -46° is equivalent to +314° : 360 - 46 = 314 To setup your layer : On your ...
user avatar
  • 841
4 votes

How georeference a DXF file in QGIS 2.14?

You can use affine transformation plugin if you know the offset of the vectors, DXF have to be converted to QGIS editable format (e.g. shapefile) You can use LibreCAD to translate the DXF file You can ...
user avatar
  • 6,762
4 votes

Export DXF from QGIS layer using PyQGIS?

If I use your code in the Python Console with the QgsVectorFileWriter() class , the value 5 is returned which seems to be a ErrAttributeCreationFailed. We could skip the attribute creation using ...
user avatar
  • 72.4k
4 votes

Export DXF from QGIS layer using PyQGIS?

Suggested solution: using the ogr library, with this approach it is possible to set the value of the "Layer" attribute of the DXF with an attribute from the inLayer. from osgeo import ogr import os ...
user avatar
  • 1,826
4 votes

Re-scaling and moving vector layer manually in QGIS

I was a tester of the 3.0 version of QAD plugin, which I consider an impressive programming job. The plugin is still in the experimental phase, but you can install it if you enable the option to ...
user avatar
4 votes

Re-scaling and moving vector layer manually in QGIS

The Plugin AnotherDXFImporter contains a module for georeferencing: 3.2.1. Parameter By means of X and Y offset, a simple displacement of the DXF can be achieved. This is y.B. useful when the ...
user avatar
  • 1,357
3 votes
Accepted

Exporting QGIS shp file to dxf-Which dxf format?

QGIS is built with GDAL/OGR which exports to AutoCAD 2000 DXF format (which means so does the ogr2ogr utility). I don't know what version GRASS writes to (in Processing Toolbox), so that may be worth ...
user avatar
  • 33.1k
3 votes
Accepted

Wrong scale when importing dxf into QGIS?

Google satellite (EPSG:3857) is not a good idea. The units are metres, but only at the equator. The more to the North you go, the greater the difference gets. Alternatively, you can use a custom CRS ...
user avatar
  • 75.1k
3 votes

Is it possible to create 3D dxf with OGR?

For the sake of completeness. I believe this should be a comment on Regan response. But since I don't have enough reputation I'll leave it as a response. The DXF writer supports 2.5D layers, and ...
user avatar
  • 31
3 votes

Georeferencing DXF using QGIS?

The Plugin AnotherDXF2Shape contains a Georeferencing modul: Parameter By means of X and Y offset, a simple displacement of the DXF can be achieved. This is y.B. useful when the original coordinates ...
user avatar
  • 1,357

Only top scored, non community-wiki answers of a minimum length are eligible