This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
arma3:terrain:qgis-real-world-data-tutorial [2019-01-20 10:01] snakeman fixed typos. |
arma3:terrain:qgis-real-world-data-tutorial [2019-02-11 02:57] snakeman added new update from ross. |
||
---|---|---|---|
Line 36: | Line 36: | ||
**For single tile export** | **For single tile export** | ||
- | * Load in just the '.map' files generated in Terra Incognita into QGIS | + | * Load in just the '.map' files generated from Terra Incognita into QGIS |
* Merge rasters | * Merge rasters | ||
* Obtain extents from square feature | * Obtain extents from square feature | ||
Line 43: | Line 43: | ||
**For 4 tile export (large projects 40960 and above)** | **For 4 tile export (large projects 40960 and above)** | ||
- | * Load in just the '.map' files generated in Terra Incognita into QGIS | + | * Load in just the '.map' files generated from Terra Incognita into QGIS |
* Merge Rasters | * Merge Rasters | ||
* Create grid -- 2 x 2 Feature | * Create grid -- 2 x 2 Feature | ||
Line 143: | Line 143: | ||
import os\\ | import os\\ | ||
- | os.system(r%%'''%%gdalwarp **-t_srs EPSG:32620** -wo SOURCE_EXTRA=1000 **-tr 5.0 5.0** -srcnodata "-9999" -r cubic -of GTiff **-te 576787.687480 1841104.815839 597267.687480 1861584.815839 D:/Arma/Heightmaps/Opentopo/output_srtm.asc** **D:/Arma/QGIS/Montserrat/converted.tif**%%'''%%) | + | os.system(r%%'''%%gdalwarp -t_srs EPSG:**32620** -wo SOURCE_EXTRA=1000 -tr **5.0 5.0** -srcnodata "-9999" -r cubic -of GTiff -te **576787.687480 1841104.815839 597267.687480 1861584.815839 D:/Arma/Heightmaps/Opentopo/output_srtm.asc** **D:/Arma/QGIS/Montserrat/converted.tif**%%'''%%) |
Some explanation of the key parameters: | Some explanation of the key parameters: | ||
Line 305: | Line 305: | ||
**Heightmap (.asc) edits** | **Heightmap (.asc) edits** | ||
- | Open your asc and change the following: | + | Open your **asc** in notepad and change the following to ensure it loads in Terrain builder: |
{{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-14.png}} | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-14.png}} | ||
+ | |||
+ | Save to a new asc, whilst maintaining the original for use in your QGIS project space | ||
Before loading the asc file into Terrain Builder, delete the .prj file. Otherwise it will not import into TB. | Before loading the asc file into Terrain Builder, delete the .prj file. Otherwise it will not import into TB. | ||
Line 331: | Line 333: | ||
{{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-11.png}} | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-11.png}} | ||
+ | |||
+ | ===== Preparing Road Shapefile ===== | ||
+ | |||
+ | **Load in road shapefile** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-37.png}} | ||
+ | |||
+ | **Clip vector to square shape** | ||
+ | Top Menu - **Vector** > **Geoprocessing Tools** > **Clip** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-38.png}} | ||
+ | |||
+ | Save features from clip to new shapefile - selecting correct **CRS UTM-20**\\ | ||
+ | |||
+ | Top Menu - **Layer** > **Save As** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-39.png}} | ||
+ | |||
+ | **Set road shapefile to CRS - 31N** | ||
+ | |||
+ | RMB on road shapefile > **Set CRS** > **Set Layer CRS** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-40.png}} | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-41.png}} | ||
+ | |||
+ | **Set QGIS project CRS to UTM- 31N (bottom right corner):** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-42.png}} | ||
+ | |||
+ | **Collect extents from your square shapefile:** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-43.png}} | ||
+ | |||
+ | Extent: (**576787.687480**, **1841104.815839**) - (597267.687480, 1861584.815839) | ||
+ | |||
+ | The first two values will be used in the v.transform step below. | ||
+ | |||
+ | |||
+ | **v.transform on road shapefile using calculated extents from square shapefile** | ||
+ | |||
+ | Your heightmap asc must adhere to Terrain Builders required values of **easting 200000** and **northing 0** | ||
+ | Your road shapefile also needs to line up to the same values - we will use **v.transform** to achieve this | ||
+ | |||
+ | So taking the extent values we grabbed in previous step -\\ | ||
+ | We will do the following calculations to bring these values to (**200000** and **0**):\\ | ||
+ | **Easting: 576787.687480 - 376787.68748 = 200000**\\ | ||
+ | **Northing: 1841104.815839 - 1841104.815839 = 0**\\ | ||
+ | |||
+ | **-376787.68748**\\ | ||
+ | **-1841104.815839** | ||
+ | |||
+ | |||
+ | Having figured out the correct figures plug them into the **v.transform** process | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-44.png}} | ||
+ | |||
+ | Drag and Drop into QGIS your heightmap asc - the one you are able to load into Terrain builder - already adjusted to (**200000**, **0**) | ||
+ | |||
+ | Set CRS on above asc to **UTM - 31N** | ||
+ | |||
+ | Right click on asc in **Layers** > **Zoom to Layer** | ||
+ | |||
+ | In **Layers** panel drag the asc below your **transformed road shapefile** - so you can see the roads layered above the asc | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-45.png}} | ||
+ | |||
+ | Your roads should now be perfectly aligned above your heightmap | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-46.png}} | ||
+ | |||
+ | ==== Setting ID and ORDER fields ==== | ||
+ | |||
+ | RMB on transformed shapefile layer > Toggle **Editing** | ||
+ | |||
+ | RMB on transformed shapefile layer > Open **Attribute Table** | ||
+ | |||
+ | |||
+ | Click **Delete field** - select all fields and press **OK** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-47.png}} | ||
+ | |||
+ | New Field - Name '**ID**' - length **0** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-48.png}} | ||
+ | |||
+ | New Field - Name '**ORDER**' - length 0 | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-49.png}} | ||
+ | |||
+ | Toggle - **Multi Edit mode** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-50.png}} | ||
+ | |||
+ | ID - Enter **0** - click **Update All** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-51.png}} | ||
+ | |||
+ | Select ORDER from drop down - Enter **1** - click **Update all** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-52.png}} | ||
+ | |||
+ | Click - **Switch to table view** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-53.png}} | ||
+ | |||
+ | Click **Save** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-54.png}} | ||
+ | |||
+ | RMB on transformed road shapefile - **Toggle Editing** to save the changes | ||
+ | |||
+ | |||
+ | **Switching to Terrain Builder -** | ||
+ | |||
+ | |||
+ | **Load your road shapefile** | ||
+ | |||
+ | Top menu - **File** > **Import** > **Shapes** | ||
+ | |||
+ | Click **OK** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-55.png}} | ||
+ | |||
+ | Perfectly overlaid within **Terrain builder:** | ||
+ | |||
+ | {{https://pmc.editing.wiki/images/Ross-QGIS-Tutorial-56.png}} | ||
+ | |||
**Coming Soon:** | **Coming Soon:** | ||
- | * Road shapefile creation | ||
* Assisted image classification - for creation of mask | * Assisted image classification - for creation of mask | ||
* 3d preview using Qgis2threejs | * 3d preview using Qgis2threejs |