Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

My first trial using QGIS

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Armored Brigade >> MODS and Scenarios >> My first trial using QGIS Page: [1]
Login
Message << Older Topic   Newer Topic >>
My first trial using QGIS - 11/24/2018 4:02:44 PM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline

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


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?


SRTM raw data


SRTM raw data with color, different min/max

Now I'm curious... what setting should I chose when export SRTM data?

< Message edited by exsonic01 -- 11/24/2018 4:16:11 PM >
Post #: 1
RE: My first trial using QGIS - 11/24/2018 7:36:25 PM   
storm rider


Posts: 217
Joined: 3/13/2013
Status: offline
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:
http://www.matrixgames.com/forums/fb.asp?m=4558328



(in reply to exsonic01)
Post #: 2
RE: My first trial using QGIS - 11/24/2018 8:39:37 PM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
Thank you Storm Rider.
quote:

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?

quote:


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:
http://www.matrixgames.com/forums/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.....

quote:


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?


< Message edited by exsonic01 -- 11/24/2018 9:07:05 PM >

(in reply to storm rider)
Post #: 3
RE: My first trial using QGIS - 11/24/2018 9:25:22 PM   
storm rider


Posts: 217
Joined: 3/13/2013
Status: offline
quote:

ORIGINAL: exsonic01

Thank you Storm Rider.
quote:

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?

quote:


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:
http://www.matrixgames.com/forums/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.....

quote:


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.





< Message edited by storm rider -- 11/24/2018 9:35:23 PM >

(in reply to exsonic01)
Post #: 4
RE: My first trial using QGIS - 11/24/2018 9:51:52 PM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
quote:

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.

quote:


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!!

< Message edited by exsonic01 -- 11/24/2018 9:53:25 PM >

(in reply to storm rider)
Post #: 5
RE: My first trial using QGIS - 11/27/2018 5:18:12 AM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
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.





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?



< Message edited by exsonic01 -- 11/27/2018 5:39:36 AM >

(in reply to exsonic01)
Post #: 6
RE: My first trial using QGIS - 11/27/2018 5:32:10 AM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
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.

(in reply to exsonic01)
Post #: 7
RE: My first trial using QGIS - 11/27/2018 3:51:40 PM   
CCIP-subsim


Posts: 695
Joined: 11/10/2015
Status: offline
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

(in reply to exsonic01)
Post #: 8
RE: My first trial using QGIS - 11/28/2018 12:00:25 AM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
quote:

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.

(in reply to CCIP-subsim)
Post #: 9
RE: My first trial using QGIS - 11/28/2018 12:11:36 AM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
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.


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


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


Yandex satellite.


OCM landscape.


OSM


Stamen-terrain

I think it is ready to go.

(in reply to exsonic01)
Post #: 10
RE: My first trial using QGIS - 12/18/2018 4:39:20 AM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
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.

(in reply to exsonic01)
Post #: 11
RE: My first trial using QGIS - 12/18/2018 5:14:38 AM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
quote:

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.



< Message edited by exsonic01 -- 12/18/2018 5:16:24 AM >

(in reply to JiminyJickers)
Post #: 12
RE: My first trial using QGIS - 12/18/2018 5:26:59 AM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
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.

< Message edited by JiminyJickers -- 12/18/2018 5:34:38 AM >

(in reply to exsonic01)
Post #: 13
RE: My first trial using QGIS - 12/18/2018 6:28:01 AM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
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!

(in reply to JiminyJickers)
Post #: 14
RE: My first trial using QGIS - 12/18/2018 2:33:44 PM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline

quote:

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.

(in reply to JiminyJickers)
Post #: 15
RE: My first trial using QGIS - 12/18/2018 8:15:39 PM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
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.

(in reply to exsonic01)
Post #: 16
RE: My first trial using QGIS - 12/18/2018 8:48:24 PM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
quote:

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.

< Message edited by exsonic01 -- 12/18/2018 8:59:26 PM >

(in reply to JiminyJickers)
Post #: 17
RE: My first trial using QGIS - 12/18/2018 9:50:43 PM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
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.




Attachment (1)

< Message edited by JiminyJickers -- 12/18/2018 9:51:45 PM >

(in reply to exsonic01)
Post #: 18
RE: My first trial using QGIS - 12/18/2018 9:54:36 PM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
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.

Attachment (1)

(in reply to JiminyJickers)
Post #: 19
RE: My first trial using QGIS - 12/19/2018 12:17:35 AM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline


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.

< Message edited by exsonic01 -- 12/19/2018 12:45:18 AM >

(in reply to JiminyJickers)
Post #: 20
RE: My first trial using QGIS - 12/19/2018 12:44:35 AM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
Awesome, glad it is working.

The colour ramp is exported as text editable file, so I just looked at what that showed, it prints a set of numbers for each value of the height, with corresponding colour RGB values etc. I just used that and extrapolated to be able to create a height chart for the colours. So for the style attached above, there are 3060 entries.


(in reply to exsonic01)
Post #: 21
RE: My first trial using QGIS - 12/19/2018 1:14:28 AM   
exsonic01

 

Posts: 1041
Joined: 7/26/2016
From: Somewhere deep in appalachian valley in PA
Status: offline
Amazing pal. I still don't know how did you made <colorPalette> part, I wish you could share some time later. Anyway, thank you so much. Now we can make a satellite/vector/height map for AB using QGIS. This is an achievement for this game I think.

(in reply to JiminyJickers)
Post #: 22
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Armored Brigade >> MODS and Scenarios >> My first trial using QGIS Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.164