1

I am using QGIS 3.4.11 on Windows 10 x64.

I have three large DWG files that are the output of a survey (each roughly 5MB). No problem to import them into QGIS as geopackages using the built in DXF/DWG import at geopackage tool under the Project menu. When I do that, the result is a Group of layers (probably 20 or so per geopackage).

Problem is that the layers are not properly georeferenced when I do that (ie they appear in the middle of the Indian Ocean).

Is there some easy way to either edit the extent property of the entire geopackage, specify the extent at import time, or to otherwise georeference the entire geopackage all at once?

I have plenty of control points, but the georeferencing tool that I use for vector files doesn't seem to work for geopackages.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Dan
  • 19
  • 2
  • Do you know what coordinate system your drawing uses? – GreyHippo Oct 01 '19 at 12:07
  • I think the short answer is "no". When I examine the extent using QGIS after I have imported the group, what I see is an extent measured in meters. My other layers (and the project) are WGS 84, decimal degrees. – Dan Oct 01 '19 at 15:33

1 Answers1

1

There is a command line tool that is installed with Qgis that can shift all features. Open the command prompt and input the following:

ogr2ogr data_shifted.shp original_data.shp -dialect sqlite -sql "SELECT ShiftCoords(geometry,1,10) FROM data"

X shift = 1

Y shift = 10

Adjust those values as needed.

The above answer is from the page How to easily shift all features in a vector dataset?

I tried using the tool with geopackage layers but was unsuccessful so you will need to convert you layers to shapefiles. It can easily be done by right clicking the layer in QGIS and selecting Export -> Save features as and make sure to specify the format as ESRI Shapefile.

GreyHippo
  • 2,180
  • 2
  • 17
  • 30
  • I have now tried Vector Bender and Affine Transform, neither of which seem to work as expected on these layers. I am guessing that ogr2ogr won't work either. I am going to try to convert the layers into Rasters, which I know how to georeference. – Dan Oct 03 '19 at 16:25
  • Some of those plugins require specific coordinate systems try and change your project CRS to something other that WGS 1984 decimal degrees. Try EPSG 4326. Most drawings use meters or feet as a unit of measure. – GreyHippo Oct 03 '19 at 20:24
  • If you are able to provide a sample of your data then I can help you better. – GreyHippo Oct 03 '19 at 20:28
  • Happy to provide any kind of sample that would be helpful - but the original DWG's are large (>3MB). I will try changing the coordinate system. – Dan Oct 04 '19 at 21:31