My first trial using QGIS

exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

My first trial using QGIS

Post by exsonic01 »

Image
This is Bing aerial map. Big red square is the target 60km x 60km zone, northeast of Hamburg.

Image
This is Bing road map. While Bing road shows the road network a bit better, OSM landscape is also good for modding of this game IMO. Which map might be the best choice to import into GIMP and swapping color?

Image
SRTM raw data

Image
SRTM raw data with color, different min/max

Now I'm curious... what setting should I chose when export SRTM data?
User avatar
storm rider
Posts: 40
Joined: Wed Mar 13, 2013 6:19 pm

RE: My first trial using QGIS

Post by storm rider »

Unless you plan to further process the heightmap in some other apps, you should export it to BMP.

It is not necessary to export with a sample spacing of 30m at this point because you can always resize it to 2048px in photoshop or gimp later on.

Also, before you export, you need to make sure that your raster map is properly configured in the right color gradient.
Check this post for more info:
fb.asp?m=4558328


exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

Thank you Storm Rider.
ORIGINAL: storm rider
Unless you plan to further process the heightmap in some other apps, you should export it to BMP.

It is not necessary to export with a sample spacing of 30m at this point because you can always resize it to 2048px in photoshop or gimp later on.

Thanks to let me know. Could you let me know how can I use QGIS to export map bmp in 30m/px, or 2048px for 61.440km?
Also, before you export, you need to make sure that your raster map is properly configured in the right color gradient.
Check this post for more info:
fb.asp?m=4558328
This is the exactly the one that I was curious. Each wargames have their own format for contour. It seems that I miss that part in my files.

But I still couldn't get it. Above example of north east Hamburg region only contains -13m ~ 115m. I just round them to 0 to 100m, but I think I shouldn't do that rounding. Anyway, I think I just can use red channel in this case since the highest height is only 115m, inside the red channel range of 0 to 255m, right?

But I'm still not sure how much color gradient I need to choose in this case for QGIS.....
Formula is (Red Channel) + (Green Channel * 255).

For example: if a pixel value is RGB (171,1,0) then the height is (171) + (1 * 255) = 426

Another example: if a pixel value is RGB (107,2,0) then the height is (107) + (2 * 255) = 617

Is QGIS possible to use the same option like those from Global Mapper?
User avatar
storm rider
Posts: 40
Joined: Wed Mar 13, 2013 6:19 pm

RE: My first trial using QGIS

Post by storm rider »

ORIGINAL: exsonic01

Thank you Storm Rider.
ORIGINAL: storm rider
Unless you plan to further process the heightmap in some other apps, you should export it to BMP.

It is not necessary to export with a sample spacing of 30m at this point because you can always resize it to 2048px in photoshop or gimp later on.

Thanks to let me know. Could you let me know how can I use QGIS to export map bmp in 30m/px, or 2048px for 61.440km?
Also, before you export, you need to make sure that your raster map is properly configured in the right color gradient.
Check this post for more info:
fb.asp?m=4558328
This is the exactly the one that I was curious. Each wargames have their own format for contour. It seems that I miss that part in my files.

But I still couldn't get it. Above example of north east Hamburg region only contains -13m ~ 115m. I just round them to 0 to 100m, but I think I shouldn't do that rounding. Anyway, I think I just can use red channel in this case since the highest height is only 115m, inside the red channel range of 0 to 255m, right?

But I'm still not sure how much color gradient I need to choose in this case for QGIS.....
Formula is (Red Channel) + (Green Channel * 255).

For example: if a pixel value is RGB (171,1,0) then the height is (171) + (1 * 255) = 426

Another example: if a pixel value is RGB (107,2,0) then the height is (107) + (2 * 255) = 617

Is QGIS possible to use the same option like those from Global Mapper?


I don't really use QGIS. I much prefer Global Mapper. From the QGIS (OSGeo4W package) I mostly use SAGA because of its simplicity and easy to use. I find QGIS and GRASS to be all very stupidly hard to use finicky with every little detail, clunky unfriendly and Python interface based (I hate Python and Github!)

The way to do it in global mapper is to create a rectangular polygon w/ specify coordinates, than choose the one option which allows you to specify the length in meters = 61440m.

Then with the digitizer tool, right click on this square and move it around the map to where you want. Select the proper raster gradient to be displayed, then make sure to have square selected. Go to File>Export Raster to bmp, 30 sample spacing and select crop to the selected feature (which is the polygon). It will extract only the area inside the polygon which is 61.440km at 30m/px = 2048px in length. Ideally this exported heightmap, depending on the region's characteristics and data source, be post processed to smooth the ground out of all the noise or even to remove the elevation anomaly caused by the canopy of vegetation.

It sounds simple, but I know that every little thing in these gis programs are all a real pain in ass. Once I have some time and have figured the best settings for post processing, I'll make a little easy guide.



exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

ORIGINAL: storm rider
I don't really use QGIS. I much prefer Global Mapper. From the QGIS (OSGeo4W package) I mostly use SAGA because of its simplicity and easy to use. I find QGIS and GRASS to be all very stupidly hard to use finicky with every little detail, clunky unfriendly and Python interface based (I hate Python and Github!)
Ok, thanks to let me know. Well, should I need to buy Global Mapper?

I understand your feeling towards QGIS. Usually open source softwares have distinctive pros & cons, and I think QGIS also can't escape from those issues of open source. It gives QGIS good expandability from so many plug-ins, but it also give QGIS instability. I used QGIS for so many different projects, I also had the similar feelings. But I still think that QGIS is just good enough for wargame map works. Different layers nicely synced to WGS 84 UTM zones, and several plug in helps to map making a lot easier.

Anyway, I think the issue here is contour map color and color gradient. I couldn't find the way to export 'height.bmp' in exactly same way with Global Mapper using QGIS. If QGIS can print out 'height.bmp' with the same contour color gradient with Global Mapper, then it would be OK to use QGIS. But if we can't find the way then, oh well... We can't use QGIS.

The way to do it in global mapper is to create a rectangular polygon w/ specify coordinates, than choose the one option which allows you to specify the length in meters = 61440m.

Then with the digitizer tool, right click on this square and move it around the map to where you want. Select the proper raster gradient to be displayed, then make sure to have square selected. Go to File>Export Raster to bmp, 30 sample spacing and select crop to the selected feature (which is the polygon). It will extract only the area inside the polygon which is 61.440km at 30m/px = 2048px in length. Ideally this exported heightmap, depending on the region's characteristics and data source, be post processed to smooth the ground out of all the noise or even to remove the elevation anomaly caused by the canopy of vegetation.

It sounds simple, but I know that every little thing in these gis programs are all a real pain in ass. Once I have some time and have figured the best settings for post processing, I'll make a little easy guide.
Thank you so much for all those explanations! I will wait for your guide!!
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

May I ask how much errors are tolerable? I checked coordinates for 4 corners of my zone from google earth and QGIS. I tried so hard to be absolutely accurate as much as possible, but I can't escape from some errors. Especially, it seems that parallel lines from the map is slightly off parallel from longitual / latitude lines. Is this usual? Im worried about desync between height and terrain

Those are my zone files, southern approaching road to Pyongyang, capital of DPRK. This is my practice work using QGIS, so I extracted those from QGIS. But I'm also learning Gmap.

They are all "very close to" 61.44km x 61.44km, and they have 2048px x 2048px, 520dpi. Those are png file but I will print bmp file form for next practice.

Image
Image
Image

Can anyone check those files are good enough to work from GIMP?

22sec, if I send you the cut raster file of STRM data like above pics, would it be helpful for you to create height.bmp?

exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

I found that QGIS have "raster calculator" option, which makes it possible to make a custom color gradient pallet for raster layer. I still don't know how to use RGB numbers in those equation, but once I fully figure out, I think it might be possible to create height.bmp from QGIS.

Once I figure out how to, I will make a full QGIS version post for map making preparation. That would be helpful for this game's modding base.
User avatar
CCIP-subsim
Posts: 467
Joined: Tue Nov 10, 2015 6:59 pm

RE: My first trial using QGIS

Post by CCIP-subsim »

Glad to hear you're getting it working!

Proper GIS software can definitely be very handy for map-making. All the more so if folks can tweak custom filters to make things more AB-friendly by default (for example, rendering out roads at exactly 1 pixel wide and at right angles).
There's more than one way to make a good map. I personally approach the whole exercise more as an art project, but if we can make the science and technology work in our favour here to make the job easier - I'm all for it [:)]
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

ORIGINAL: CCIP-subsim
Glad to hear you're getting it working!

Proper GIS software can definitely be very handy for map-making. All the more so if folks can tweak custom filters to make things more AB-friendly by default (for example, rendering out roads at exactly 1 pixel wide and at right angles).
There's more than one way to make a good map. I personally approach the whole exercise more as an art project, but if we can make the science and technology work in our favour here to make the job easier - I'm all for it [:)]
Thank you. Once get used to it, GIS tools can get a lot of data.
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

This is exactly 61440m x 61440m, 2048px x 2048px, 8inch x 8inch (which gives 256dpi) maps for south of Pyongyang. All exported from QGIS. I uploade bmp files, but imgbb (image hosting site) automatically converts them to png.

Image
ESRI satellite, low quality. It is not that different from high quality for our purpose.

Image
Google satellite, it is exactly same with google CN version.

Image
Yandex satellite.

Image
OCM landscape.

Image
OSM

Image
Stamen-terrain

I think it is ready to go.
User avatar
JiminyJickers
Posts: 290
Joined: Tue Oct 04, 2011 8:21 am
Location: New Zealand

RE: My first trial using QGIS

Post by JiminyJickers »

Hey, if you are still around I wonder if you can provide some advice?

How do you export the images from QGIS to scale? I can't quite get my head around it. I want to say, export a 15 x 15 km scaled map, where as in the game, 1 pixel = 30 meters.
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

ORIGINAL: JiminyJickers
Hey, if you are still around I wonder if you can provide some advice?

How do you export the images from QGIS to scale? I can't quite get my head around it. I want to say, export a 15 x 15 km scaled map, where as in the game, 1 pixel = 30 meters.
To export, print composer (or print layout in QGIS 3 version) is used.

First, you need to be sure about your CRS. Next, you need to be memo the coordinate of north/south/east/west boundary for your 15360m x 15360m (512 pixel x 512 pixel). Or, you could memo the coordinates of 4 corners. You may need to memo the latitude and longitude of north/south/east/west boundary for your zone, this requires Lat Long Tools plug-in.

From print layout, first move your QGIS screen to fully view the target region. Then, you need to set the layout size in x and y dimension. From layout tab, there is 'resize layout to content'. You need to adjust layout size to square, since it is square map. I used 8 inch in x-dir and 8 inch in y-dir. Next, use 'add map' and drag the white area, and map will be printed out. Then, go to item properties tab, there are 'extents'. Now you need to put the coordinate number of 4 boundary (north/south/east/west) in the 'extents'. (It is not latitude and longitude, you can see the coordinate at the bottom of the QGIS screen) Then the map will be fit in the layout. Then you can choose export as image. Save layout, then you can load the layout next time.

User avatar
JiminyJickers
Posts: 290
Joined: Tue Oct 04, 2011 8:21 am
Location: New Zealand

RE: My first trial using QGIS

Post by JiminyJickers »

Awesome thanks for the explanation. I was heading in that direction, but couldn't quite line it up. I'll try that out.


Edit: Works like a charm, thanks for your help!

Now I just need to figure out the heightmap business, haha.
User avatar
JiminyJickers
Posts: 290
Joined: Tue Oct 04, 2011 8:21 am
Location: New Zealand

RE: My first trial using QGIS

Post by JiminyJickers »

Woohoo, now all working fine using QGIS. Figured out the heightmap export as well so I'm all go for some holiday map creation.

Thanks for you help!
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

ORIGINAL: JiminyJickers

Woohoo, now all working fine using QGIS. Figured out the heightmap export as well so I'm all go for some holiday map creation.

Thanks for you help!
Do you figured out how to print height.bmp from QGIS? I know devs printed height.bmp using QGIS and other tools, but I don't know how to do that.
User avatar
JiminyJickers
Posts: 290
Joined: Tue Oct 04, 2011 8:21 am
Location: New Zealand

RE: My first trial using QGIS

Post by JiminyJickers »

Yeah, I use a plugin to download the heightmap from NASA Earth Data. Then use a custom colour ramp, made from the RGB formula. I created the ramp in Excel so that it has right values as per the formula and imported it into QGIS.

I'll share it once I'm back at home PC.
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

ORIGINAL: JiminyJickers
Yeah, I use a plugin to download the heightmap from NASA Earth Data. Then use a custom colour ramp, made from the RGB formula. I created the ramp in Excel so that it has right values as per the formula and imported it into QGIS.

I'll share it once I'm back at home PC.
Holy moly, can I see your result? Is the result height.bmp well recognized from AB? Actually I tried to make height.bmp from SRTM data with RGB formula using raster calculator from QGIS, but so many attempts miserably failed. [:(] But I'm really glad to hear this news, because now we can prepare height.bmp and satellite/vector maps all from QGIS. It would be great if you teach us all.
User avatar
JiminyJickers
Posts: 290
Joined: Tue Oct 04, 2011 8:21 am
Location: New Zealand

RE: My first trial using QGIS

Post by JiminyJickers »

Okay, so the output looks like the below. I have tested it for the region where I grew up and it is working perfectly in Armoured Brigade.

Image
Attachments
HeightMap.jpg
HeightMap.jpg (351.56 KiB) Viewed 1022 times
User avatar
JiminyJickers
Posts: 290
Joined: Tue Oct 04, 2011 8:21 am
Location: New Zealand

RE: My first trial using QGIS

Post by JiminyJickers »

I use the SRTM plugin to get the Height Map for the region I'm in. I then apply the style, as attached, to the layer and export it like you showed me. Works fine for me in Armoured Brigade, haven't tested any other regions yet, but looks good so far.
Attachments
ArmouredBrigadeStyle.zip
(23.68 KiB) Downloaded 29 times
exsonic01
Posts: 1133
Joined: Tue Jul 26, 2016 6:45 pm
Location: Somewhere deep in appalachian valley in PA

RE: My first trial using QGIS

Post by exsonic01 »

Image
Image
It worked perfectly to me as well !!! How did you make style? That is amazing. I already have height.bmp for my section thanks to some folks in this forum. But if I knew this more earlier, I would had more freedom to choose CRS for my map and would choose better section. Now it is too late to change or start a new series again, but anyway, this is great. Thank you so much.
Post Reply

Return to “MODS and Scenarios”