Jump to content
digitalcenturion

TUTORIAL: How to use QGIS to reproject & transform shapefiles to default mapframe.

Recommended Posts

Hello all,

this has been an elusive topic for me but the other night I finally sat down and fiddled with QGIS with QGIS 2.14.3 Essen with GRASS until I figured it out.

 

 

What you need:

Quantum GIS desktop http://www.qgis.org/en/site/forusers/download.html

A map in TB

Some type of shape data you want to use

 

 

 

1) Provided you have a working map in TB that uses the mapframe settings you need to have in arma 3 (Default UTM zone, 200 000 easting and 0 northing coords), use file -> export -> terrain to export your terrain heightmap in ASC format. This is the quickest way

 

 

2) Start up QGIS and using the toolbar on the left, click add raster (second topmost). Add your .asc. Now you have a terrain visible that shows your mapframe bounds. If done correctly the SE corner should be at coords 200 000 and 0

 

D3pW8iU.jpg

 

 

3) Add your shape data, for example Open Streetmaps roads. I use the data from Finlands national land survey - YMMV. The imported data more than likely went somewhere out of bounds, so right click on the imported layer and click "Zoom to layer".

 

oZIq98K.jpg

 

4) Depending on the projection of the source data it will probably appear skewed or rotated - to fix this right click on the layer and press "Set layer CRS". Select the project CRS that we got from terrain builder - WGS 84 / UTM Zone 31N, again right click and zoom to layer.

 

IxV7r96.jpg

 

5) Now it should no longer appear skewed. However - it still is at the wrong place and it might be out of scale. Since Arma and TB likes to have things in powers of 2, map sizes rarely round up to round numbers. Because of this we might need to scale the data. My raw data for example is in cells of 6000x6000m but the end resolution in TB is 6144x6144m. By dividing 6144 by 6000 we get a scale factor of 1,024.

 

We will use the same tool for both moving our shapes and scaling it. It is the V.transform - to access it bring up the Processing Toolbox with ctrl-alt-T, and type transform in the search box. Double click on it! Make sure it operates on the correct layer and type in the correct scale factor - in this case 1,024 for X and Y

 

uycrVBO.jpg

 

6) Now it created a new layer called Transform, that is the correct scale and projection but at the wrong place. Zoom to it again. Now we will use the v.transform tool again to move or shift the data to match up our mapframe- this is a matter of simple maths really. In my case I use a X shift value of 105690 m and Y shift of -6838272.0 - remember we want the end result to be 200 000 and 0. YOu can use the triple dots to find the current extent of your layers. The ideal case is that your shape files are neatly clipped at the same place your map ends - if not your result might be off. I was lucky to only use data from the same sources, so everything matches up nicely.

 

7) Voila - your result should match up nicely. If not it either operated on the wrong layer or your maths were off. Make sure to save your new layer to disk - temporary layers are not saved even when you save your project in QGIS. You can use this shapefile straight up in TB or stay in QGIS and use the superior database tools to make road classifications and such.

 

KDwAdxR.jpg

 

QGIS is a really good program and there is a lot of support for it on the net - I have barely gotten a basic understanding of it but already it will completely change how I do maps for Arma 3.

 

 

 

  • Like 8
  • Thanks 1

Share this post


Link to post
Share on other sites

Useful information here, I wish I knew before I'd started!

 

Don't forget the web-> OpenLayers and Print Composer plugins for an exact satellite image (from google maps or bing maps) at full resolution!

Share this post


Link to post
Share on other sites

Awesome guide, should come in very handy for others :)

Share this post


Link to post
Share on other sites

I do not understand where you get the coordinates of the roads vectors?
Do you use the coordinates of the mouse cursor that you see in the status bar? They calculate it "by eye"?

 

Edit. Ok, i get them from global mapper

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×