2

In Illustrator I exported a PDF as DXF and inserted it in QGIS as Vector and obtained two layers as points and lines but it is misaligned and in a unknown location.

I know georeference a raster file, but not a PDF or DXF.

The PDF file is the first one (named "Caracterização Geral") here in this link: Caracterização Geral PDF file. It say "PT-TM06/ETRS89".

This is the DXF file in my Google Drive.

I can locate one point, the City Hall - 41.1298608, -8.6066119 [41°07'47.5"N 8°36'23.8"W]. Is the layer called "Câmara_Municipal" in PDF file, a cyan color point.

My project is EPSG: 3857 / WGS 84 / Pseudo Mercator

  • First layer is a Bing Aerial (Web > OpenLayersPlugin > BingMaps >
    Bing Aerial) - CRS: EPSG 3857 / WGS 84 / Pseudo Mercator

  • Another layers with shapefiles lines and points captured from OSM. - CRS: ESPG 4326 / WGS84, which is OK on top the base layer.

  • 1
    Does any answer from this Q&A works for you? – carnendil May 7 '16 at 21:28
3

I think it is a duplicate of How to georeference a dxf?,How to georeference a vector layer with control points?

1) Using the limits of the Carta Administrativa Oficial de Portugal (shapefile, the projection is EPSG:3763 (ETRS89 / Portugal TM06)) you can georeference the original pdf file

enter image description hereenter image description here

2) To georeference a shapefile (it is better to transform your dxf file to a shapefile (3 shapefiles here, points,lines and polygons)), an approach is to use control points, but one point is insufficient and you can find other points using the limits of the precedent shapefile and you can use:

  • ogr2ogr supplying the control points in the -gcp tag

    ogr2ogr -gcp 5 -135 0 0 -gcp 283 -135 1000 0 -gcp 5 278 0 1000 -gcp 283 278 1000 1000 -f "ESRI shapefile" gcppolyg2.shp gcppolyg.shp

  • QGIS with the plugins vectorgeoref or Vector Bender, witch use this method

  • QGIS with the plugin Affine Transformations, more complicated.

3) Other approaches have been pointed as moving the dxf file with a CAD software before converting it to a shapefile

  • 1
    no, you can only move the dxf file – gene May 8 '16 at 15:21
  • 1
    The advice that gene has given is excellent, as is the advice that Zoltan provides. You will need to work in cartesian (x, y) coordinates rather than geographic (latitude, longitude) coordinates which means that the imagery should be transformed to a desirable projection if you are going to use the imagery as a base for the transformation of the vector file(s). I would pick as many coincidental points from the image, with the majority being on or near the perimeter if possible. This will help make the vector fit within the bounds of the area of interest. – jbgramm May 8 '16 at 16:31
4
  1. 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)
  2. You can use LibreCAD to translate the DXF file
  3. You can use SurveyingCalculation plugin to calculate transformation parameters from coordinates given in source and target CRS
  • LibreCAD an open source CAD software which can open and edit DXF files. You can use a single command to translate all of your entities in your drawing. – Zoltan May 8 '16 at 8:26
  • 1
    I reduced the 40 MB DXF to 2.5 MB removing the background fill around the drawing and purging the unused blocks. I also have exploded the blocks in your drawing, to be useful in a vector GIS. You can download the new file from my drive: drive.google.com/open?id=0BxCl4jYINGSQZHNTbEVnWV9QMHM – Zoltan May 8 '16 at 8:33
  • Which projection would you use your map? Longitude/latitute won't help you much. – Zoltan May 8 '16 at 8:35

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.