using google maps and microdem TOGETHER

Ins and Outs of Creating the Map
soccersetter643
Hobo
Posts: 30
Joined: Sun Feb 05, 2012 3:38 pm

using google maps and microdem TOGETHER Unread post

Hey, guys. I thought I would move this to a new post and give you guys a heads up on this (possibly) new way of creating maps.

I finally figured out how to work the MICRODEM, and managed to generate a DEM (keeping careful track of the lat/long numbers that ended up being my final coordinates, for later use in google maps) for my Durango & Silverton map that I'm currently working on. I then took screenshots of both google maps and the satellite views and stitched them together. After cropping and resizing the images, I got the image to line up with the topography, and the result is pretty stunning. It's a great way to both A) quickly map out towns, rivers, and lakes (using the google-maps overlay), and B) create a super realistic, super accurate terrain texture in mere minutes (well, an hour or two, but you know what I mean ;)).

(abbreviated) instructions

step 1: make your DEM using microdem and export it as a targa. keep careful track of the final gps coordinates that you used (see the microdem tutorial for how to do this), as they will be important later on.

step 2: load up your targa image as a heightmap, and generate your terrain. get the terrain to the point where the heights are roughly at the points where you want them, but don't worry about lakes, rivers, or specific terrain adjustments yet.

step 3: using photoshop or gimp or whatever you want (I prefer photoshop, but use whatever) take screenshots of google maps and satellite view of your topography.

*see tips on creating screenshots below for help*

step 4: using the bmptogmp tool to overlay the google map (this may take some time, as it might not line up quite right the very first time you do this. make sure to backup that original photoshop file before you crop it so that you can backtrack your work).

step 5: use the google map as a reference to help with the placement of rivers, lakes, regions, towns, etc. I also recommend that at this point you start your event writing so that you can beta test without worrying about loss of texture quality.

step 6: after you have finished the bones of your scenario, I then recommend using bmptogmp again to apply the google satellite image. make sure you're not doing anymore major changes before doing this. this will make your scenario (hopefully) look all pretty!

step 7: make any final texture-related changes that you deem necessary, and add trees. at this point, you're pretty much done!

Tips for saving the screenshots

a) when you are ready to take the screenshot, fill up as much of your computer screen as you can. then, take the google maps screenshot first, then immediately after take the satellite screenshot. do this in tiles, so that it's easier to match up in photoshop.

b) before you start taking the screenshots, mark the corners of your map by searching for the lat/long coordinates in google, and use the green triangle on the google map view. I recommend doing this in the google map view only, since (at least for me) I only use the google map view as a reference for placing lakes, rivers, cities, etc.

c) for those of you familiar with actions and changing a lot of files automatically using the batch feature of photoshop, I recommend creating an action that crops all the screenshots at once, so that you can ensure that the google map and google satellite images are the same size when you merge them.

d) when you put the images in photoshop, I recommend two layers: the google maps layer is lower, and the satellite image is higher. first, copy and paste the google map, then the satellite, and line them up with each other using the smart guides. when you insert the next set, start with the google map and line that up. then, turn off all the layers EXCEPT for the image you just added, and import the corresponding satellite image. this ensures that the two layers line up properly. it makes it very easy later on for cropping, resizing, and saving the .bmp images, as well as importing into RT3.





I know that this probably is not as complete as it should be, so I will post a more in-depth tutorial at some point later on.

One thing I should say is that the texture detail looks best at a high resolution, and as you zoom out, the texture obviously gets less detailed. But I still think it's better than having a relatively blank map.


Heres part of what my map (WIP) looks like, to give you guys an idea.

Image
Last edited by soccersetter643 on Mon Feb 25, 2013 2:11 pm, edited 2 times in total.
User avatar
OilCan
Engineer
Posts: 832
Joined: Tue Jan 13, 2009 2:03 pm
Location: East Tennessee, USA

Re: using google maps and microdem TOGETHER Unread post

This is great! !!clap!! Well done!

Post the full tutorial when you get a chance.
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: using google maps and microdem TOGETHER Unread post

OilCan wrote:Post the full tutorial when you get a chance.
Yes! Please do. {,0,}
Hawk
soccersetter643
Hobo
Posts: 30
Joined: Sun Feb 05, 2012 3:38 pm

Re: using google maps and microdem TOGETHER Unread post

It's gonna take a long time to write out the full tutorial, but basically, the theory is that when you make the DEM image in MicroDEM, you record the latitude and longitude of the north-west and south-east corners of the image you're exporting. That way, when you go into google to grab the actual map textures (via screenshots), it's a lot easier to line those maps and resize them correctly on the railroad tycoon map.

Just as an update, I wrote that initial post last night, and just this morning I've already finished all of the rivers, lakes, landmarks, cities, and resource regions, and am starting event scripting.

I've started working on a more complete tutorial. Should I just post it to this forum, or should it be as a .pdf?
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: using google maps and microdem TOGETHER Unread post

soccersetter643 wrote:I've started working on a more complete tutorial. Should I just post it to this forum, or should it be as a .pdf?
You can do it as a pdf and just attach it to a post, if you want. It can be up to a 15 MB attachment.
Hawk
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

Nice idea. I had already used the idea of pulling city and other locations off the Google satellite pics, but I hadn't thought of using the entire image as an overlay for ground texture.
soccersetter643
Hobo
Posts: 30
Joined: Sun Feb 05, 2012 3:38 pm

Re: using google maps and microdem TOGETHER Unread post

Holy hannah, I just overlaid the satellite map, and it looks great, but then I found a new feature. If you overlay the satellite image, you can then use the blur tool and set all the settings to maximum and use the fill tool to blur the entire map, and check out the difference.

BEFORE

Image

AFTER

Image
User avatar
OilCan
Engineer
Posts: 832
Joined: Tue Jan 13, 2009 2:03 pm
Location: East Tennessee, USA

Re: using google maps and microdem TOGETHER Unread post

Now I'm doubly impressed! !*th_up*! I guessing that you could go backwards on this too (start with satellite image and then find coincident lat & longs on microdem)?
soccersetter643
Hobo
Posts: 30
Joined: Sun Feb 05, 2012 3:38 pm

Re: using google maps and microdem TOGETHER Unread post

Yes, in fact, that is the process that I used. However, as this was my first time using MicroDEM, I found that those inital coordinates needed a little bit of tweaking in MicroDEM in order to fit the 64-point pixel parameter that is required in RT3. So in the end, what I found was that I chose the initial area in google, and then there was a process of tweaking the coordinates to fit correctly in microdem.

As for the tutorial, I think I'm just going to do a video tutorial when I get around to it, and post it up on youtube.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

The other issue is that Google and MicroDEM use a different projection, as far as I can tell. This probably isn't an issue with comparatively small areas, but could require blending a patchwork of satellite images on large maps.
soccersetter643
Hobo
Posts: 30
Joined: Sun Feb 05, 2012 3:38 pm

Re: using google maps and microdem TOGETHER Unread post

gumboots, what do you mean by projection?
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

soccersetter643
Hobo
Posts: 30
Joined: Sun Feb 05, 2012 3:38 pm

Re: using google maps and microdem TOGETHER Unread post

Oh I see what you're saying. the other option is doing a slight lens distortion filter in photoshop to correct it. It would just mean searching for more coordinates on the google map so that the distortion is accurate. Further testing should be done to confirm this.

By large area, you mean something as big as north america, right?
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

I was finding noticeable divergence over an area of about 500 miles square.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

Just did a bit of checking. The DEM's are done on a basic cylindrical projection, such that the 5 degree x 5 degree tiles are rectangular. This will be least distorted at the equator, with progressively increasing distrortion as you move further north or south.

So, you could do an "around the world in 80 railways" map at the equator without worrying about projection discrepancies, but if going the other way (from pole to pole) you'd have to make a lot of corrections before you could get satellite imagery to overlay onto the DEM.

Although Google Earth uses a basic cylindrical proejction for its maps, this doesnt apply to the satellite image view you see on the rotatable globe.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

I'm going to try this out. I've just tiled up a 1024x1024 image out of Google Earth satellite images as a part of a test run. It's a bit tedious, but not difficult. I haven't cropped/merged the dems or generated a .gmp yet, but the texture picture is ready for overlay. The procedure went like this:

The area I'm covering is about 750 miles east to west, and 930 miles north to south. Specifically, it runs from -26 S and 141 E, to -39.5 S and 154 E. Yes, it's Australia again. :mrgreen:

Anyway, I found that when taking the screenshots from Google Earth, a two degree by two degree square worked best. Any smaller was too many tiles. Any larger started to give problems with the curvature of the meridians. If I stuck to two degrees by two degrees, the shapes were close enough to a basic tapered quadrilateral. This meant they could be stretched to rectangle and tiled, without mismatching problems at the edges (bearing in mind that I was turning the Google Earth sat images into a composite cylindrical projection, to match the dems and Google maps).

The finished map will be rectangular (I'll be using 768 wide by 960 high), but the BMP that has to be made first (for the bmp2gmp tool) has to be 1024 x 1024. So, break out the calculator and do some number crunching to stretch the 768x960 to 1024 square, then calculate the pixel positioning of the degree grid for latitude and longitude. Set up said grid. You now have a blank psd with longitude and latitude grid on it. Tiles can be made to fit this.

Photoshops wont do weird distortions/warping on multiple layers at the same time. It will only do a basic tapering and corner moving on a quadrilateral (it's called the Distort tool, but doesn't really "distort", if you know what I mean). To get the corners right, I had to have a Google Earth shot with the latitude/longitude grid on it, and another screenshot just underneath without the grid. These were pasted into a second psd, that was purely for making tiles. Once each tile was all sorted out and cropped, I resized it down to fit the grid on the main 1024x1024, and pasted it into that.

With me so far? Cool. !*th_up*!

So, first set up a new 1024x1024 file in Photoshop, with grid positioned according to calculations. Set up a second, blank, psd that is for making tiles. I made this quite large, so I could get the tile edges more accurate without going cross-eyed (actual size was 750 wide by 830 high).

Find the bit you want in Google Earth, line it up nicely, turn grid off (Ctrl+L), take shot, paste shot to the second blank psd. Turn grid back on (Ctrl+L), take another shot, paste this on straight on top of the first one. Select both together, move them until they are centred in the PSD. Crop the image to grid boundaries (Ctrl+A > crop image > Ctrl+D). Now adjust corners with the "Distort" tool until the screenshot grid intersections are at the corners of the psd. Crop again (you need to do this double crop or the bits hanging out will cause problems). Turn off the top layer.

Voila. You now have one 2 degree by 2 degree tile. Now resize that down to fit the tile size of the main, composite psd. In my case this was 158 wide by 152 high. Paste the result into the big psd. That's the first one done. Step backward on the second psd (Ctrl+Alt+Z) to bring it back to its original size. It's now ready for more screenshots to be pasted and distorted to suit.

Now just repeat the process until all the tiles are done. It may take a couple or few hours, depending, but it's easy enough once you get into the swing of it.

Yes, I could have saved a few keystrokes by tiling everything without resizing every tile down to fit the 1024x1024 image first, then just resizing the finished composite image once. I chose not to do it that way, because the composite would have been huge and a bit awkward to work with (10000x11000 images are not a lot of fun to work with, IMO).

So, that's how you make a composite satellite image, at 1024x1024, with a cylindrical projection, from Google Earth screenshots. The one I did had 49 tiles, and once finished looks immaculate. !*th_up*!
Attachments
base_1024x1024.jpg
base_1024x1024.jpg (278.11 KiB) Viewed 6908 times
Last edited by Gumboots on Sun Jul 28, 2013 6:39 pm, edited 1 time in total.
User avatar
Wolverine@MSU
CEO
Posts: 1166
Joined: Fri Nov 10, 2006 2:14 pm
Location: East Lansing, MI

Re: using google maps and microdem TOGETHER Unread post

Very nice work Gumboots. I'll have to give it a try the next map I make. I've always been looking for a way to overlay Google Earth imagery on a RRT map. !!clap!!
User avatar
OilCan
Engineer
Posts: 832
Joined: Tue Jan 13, 2009 2:03 pm
Location: East Tennessee, USA

Re: using google maps and microdem TOGETHER Unread post

Wow! Very nice. I'm very interested in seeing the final outcome. :salute:
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

I might make another one and see how streamlined I can get the process. I wasn't really thinking of efficiency this time around, since I was mostly doing this one in the ad breaks while watching tv. I just did it one or two tiles at a time and then saved. I think the best way really would be to just paste straight to one, very large, image that had the lat/long grid. This would be slightly disconcerting to work with, partly due to the size and partly due to the minor mismatches between the tiles probably being visible at that scale. However, once merged into one layer and scaled down to 1024x1024, it should look perfect. It should also be faster to do.

The way I'm thinking of it, it'd be paste the screenshots, then turn off top layer once stretched to fit the grid, select lower layer only with the Select tool, invert selection, then Cut. Top layer (now invisible anyway) could then be deleted.

The other point is that when I scaled down the tiles from 750x830 to 158x152, I got a partial tranparency coming in on the last pixels along each edge. This was purely an artifact of the scaling algorithm, and left visible, sort of greyed out, lines between tiles. I got around that by cheating. :mrgreen: What I did was duplicate all the tiles, then merge the duplicates into one layer, then set that behind all the other tiles, then offset it one pixel left and one pixel up.

That filled in the partial transparency along the edges of the tiles, and is not noticeable to the eye. It looks just as good as if it hadn't been cheated, but it was (again) more keystrokes etc, so not the most efficient method overall. If using a more efficent method, I probably could have done the whole thing in an hour.

---------------------------------------------------------------------------------------------

The other thing worth mentioning is the choice of vertical and horizontal scales. A degree of latitude is the same distance over the ground at any latitude (or near enough to it, if you're not that fussed about oblate spheroid stuff) but a degree of longitude varies from roughly 70 miles over the ground at the equator, to zero at the poles.

The cylindrical projection used by DEM's and Google Maps assumes that a degree of longitude is the same distance at all latitudes. It starts from the equator and goes from there, so the further you get from the equator, the more your map will be stretched east to west. What I decided to do was effectively change the radius of the cylinder that the map is projected onto, so that it matched a point roughly halfway down the map.

What this does is to nullify the stretching at that latitude, so that a mile east to west will be the same number of pixels as a mile north to south. At the top of the map, east to west distances will be slightly scrunched (around 7% in this case) and at the bottom of the map, east to west distances are slightly stretched (again, around 7% in this case). Overall, however, doing it like this gives the least distortion of distances while still using a cylindrical projection.

It had another advantage, in that because I was using 33 degrees South as a reference, the finished map only had to be 84% of the width that it would have needed if using the equator as a reference. This means a more compact and manageable map on screen, while still keeping the same miles per pixel ratio. If using a basic (equatorially based) cylindrical projection straight from DEM/Google, I would have had to take the map out to 896 pixles wide to cover the same area, and the east-west distances would have been more distorted. Having tried an 896x1024 test map on my 20" monitor, I'm convinced the 768x960 will be superior during actual gameplay. !*th_up*!
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: using google maps and microdem TOGETHER Unread post

Ok, have tried applying a .bmp and, being on W7 64 bit, I get the problem talked about here: Re: Bmp2gmp dummies guide?. IOW, it applies but is all stripey and dark, and generally useless. :mrgreen:

However, the good news, taking what I can get in the way of good news at this stage, is that even though the textures/colours are borked, the overlay does appear to exactly match the .gmp heightmap. So, as soons as I can get that texture application to render properly, it should be fine.

I tried downloading Wolverine's PDF tutorial from this post, but my copy of Reader wont open it. Says something about "raise without handler" and quits. Maybe the old attached PDF is corrupted.

===================================================

ETA: Ok, I know what I did wrong. I had saved as 32 bit .bmp without alpha channel visible. If I save as 24 bit .bmp with alpha channel visible, it imports to the .gmp perfectly

BUT

there has to be a glitch of course.....

...although the textures are applied almost perfectly (will need minor touching up around some coastal bits) the remaining problem is that they are only shown at a distance. When you get close in to the terrain, the applied .bmp textures fade out and are replaced with a basic, sort of pale olive green/cracked dirt sort of texture. Screenshots follow.

The other problem is that although the map looks awesome "from space", once you get down to "Cessna altitudes" the textures degrade. Obviously this is not a bug as such, merely a limit on the amount of information the original 1024x1024 .bmp can contain. As with any raster image, once you zoom in enough it will begin to pixellate badly. This is a separate problem to the one mentioned just above.

My current conclusion is this: although the application of a sat image .bmp to the .gmp is easy enough, it will probably have to be considered only a useful guide to manual terrain painting, at least on fairly large maps. It may work better on very small areas.

Would be delighted to be proven wrong about the larger maps, of course. ;-)

===================================================

AHA! I think I know what is going on. I think the two problems are actually related. Think about it this way: the overlaid .bmp is raster, therefore pixellates badly when viewed from "low to moderate altitude". Considering that, the problem will obviously get worse at ground level. I have a suspicion that what is happening when zoomed right in at ground level is that you are effectively "looking between the pixels". IOW, the .bmp has run out of information to feed you at that scale, so you just get the default RRT3 general purpose ground texture.

I opened soccersetter's Durango map and the same thing happens. When you zoom right in, you see the generic/fallback RRT3 ground texture, rather than the fancy stuff applied via .bmp.

Image

Image
Post Reply