Cropping and altering maps

Ins and Outs of Creating the Map
jedgarthomson
Hobo
Posts: 26
Joined: Tue Oct 02, 2007 4:23 pm

Cropping and altering maps Unread post

Is it possible to crop an existing map like one would crop a photo and use only part of it? I am specifically thinking about the large base map of Africa and the Mideast. There are specific parts of it that I would like to crop out, alter, and use as the basis for new scenarios.

Can this be done, and if so, what's the easy way to do it?

Thanks in advance.
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Unread post

I don't think there is any way to do this. You might be able (theoretically) to get a usuable height map out of a scenario file, but you wouldn't be able to keep all the defined towns and regions, etc.

The way to extract a height map would be to choose two terrain colors, one light and one dark (as close to black and white as possible). In the editor, use the "fill above" and "fill below" tools to paint all the low spots dark and all the peaks light. By using a partial transparency each time you fill, and building it up in layers, you can achieve all the gradations of grey between your lowest points and your highest. Then, once you have it looking like a smooth transition between grays, you can use gmp2bmp.exe to create a 1024x1024 bitmap image of it. Use an image editor to crop that as desired, and then save as TGA. Then, you could use that TGA as the height map for a new scenario.

That's a quick overview, but of course it would likely be fairly complicated and definitely tedious. Might be just as well to start from scratch, if you can find DEM's or other topographic height maps to work from, or else use the map builder that Pop Top supplied.
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
Canadian Viking
Brakeman
Posts: 171
Joined: Thu May 17, 2007 11:46 am
Location: Alberta, Canada

Unread post

I don't know if it is possible to crop an existing map. But when creating a map from scratch with the map maker that comes with RRT3, it is worth your time to remake the original map many times if necessary to get the area you want to include as exactly as possible. I wish my Building to Buffalo map had just a little less area on the east edge. And there is definitely extra land on the south side. The west and north edges came out pretty well as I wanted. I only tried two or three times to make the correct map region.

On my next map I tried about a dozen times before I got exactly what I wanted for boundaries on all 4 sides. Get the longitude and latitude lines you want from printed maps (such as in an encyclopedia). It helps to keep some notes on each try so you can compare new efforts to old ones. You will spend a lot of time putting in rivers, cities, territories, etc. so make sure you are starting with the map area that you really want.
User avatar
JayEff
Conductor
Posts: 240
Joined: Sat Nov 11, 2006 8:51 pm
Location: Edmonton AB

Unread post

You can edit the map in any image editor. You can crop it, or use a blur function to smooth the terrain. Or if you want to be weird you can distort it, or cut it in pieces and move it around. You can bend it to make a trapezoid to get something closer to true scale, say in a mid-latitude month.
Grandma Ruth
CEO
Posts: 1237
Joined: Mon Nov 13, 2006 7:17 am
Location: West Yorkshire, England
Contact:

Re: Unread post

JayEff wrote:You can edit the map in any image editor.
I've tried with Serif PhotoPlus and IrfanView but can't open the .gmp file. Do you have to save it as some other sort of file, and if so, what and how? Did anybody else do this successfully? **!!!**
"I will not take 'but' for an answer" - Langston Hughes
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: Cropping and altering maps Unread post

PJay used to have a gmp to bmp converter utility on his site but I don't know where you can get it now.
I thought I still had it but I can't find it on my hard drive - yet.
Hawk
Gwizz
CEO
Posts: 1100
Joined: Sat Nov 11, 2006 6:45 pm

Re: Cropping and altering maps Unread post

Grandma Ruth
CEO
Posts: 1237
Joined: Mon Nov 13, 2006 7:17 am
Location: West Yorkshire, England
Contact:

Re: Cropping and altering maps Unread post

Thanks, guys! Gwizz, I found it on the site you recommended but I don't know what to do next! Here's what it said:

Company: PopTop Software Inc.
Notes: Railroad Tycoon 3 lets players experience railroading from the Golden Era through to the modern day. The game challenges players to create and expand their own railroad empire.
Mime: application/icb
application/x-icb
image/icb
Links: Fan Site with File Formats
Ident: Hex: DE 12 04 95
Class: XML


GMP Converters


The links didn't work, unfortunately. *((hlp))*
"I will not take 'but' for an answer" - Langston Hughes
Gwizz
CEO
Posts: 1100
Joined: Sat Nov 11, 2006 6:45 pm

Re: Cropping and altering maps Unread post

I'll look and see if I have the converter saved on a CD.

My problem is I have so many CDs and not a good index for what each one contains or a good description for searching for a file.
Grandma Ruth
CEO
Posts: 1237
Joined: Mon Nov 13, 2006 7:17 am
Location: West Yorkshire, England
Contact:

Re: Cropping and altering maps Unread post

I know that feeling! Thanks for looking! 8-)
"I will not take 'but' for an answer" - Langston Hughes
low_grade
Dispatcher
Posts: 438
Joined: Sun May 17, 2009 3:02 pm
Location: Cleveland, OH

Re: Cropping and altering maps Unread post

So I'm reviving this dead topic because I have a new question which falls under this heading.

I'm looking for help with cropping and rescaling. I figured that this must be possible since MapMaker suggests rescaling with Photoshop to get your map properly proportioned (ie so that a mile in any direction is really a mile).

So, I got Gimp2, opened up the TGA, cropped, rescaled, and opened the map in the Editor, and now the heights are totally screwed up, and also everything is way too bumpy. Not sure what's going on, and spent enough time messing around, I thought it was time to ask somebody who's been through this what the heck is going wrong here.

Thanks for the help!
User avatar
Wolverine@MSU
CEO
Posts: 1166
Joined: Fri Nov 10, 2006 2:14 pm
Location: East Lansing, MI

Re: Cropping and altering maps Unread post

Probably has to do with how the photo editing program interpolates grayscale vales when resizing, assuming you're working with grayscale heightmaps. First of all, make sure you're working in a "grayscale" mode in the photo editor and not in a "RGB" color space. Cropping should be no problem because it just truncates the data to remove pixels outside the cropped area. Scaling to a larger size involves adding new pixels, and the editing program calculates the grayscale value for the new pixels based on adjacent pixel values, and probably changes the original pixel values through some sort of "smoothing" routine. Downsizing makes things even worse, because the program has to remove pixels and then recalculate new values, which often results in jagged heights. I haven't tried it, but for downscaled maps, you might try "blurring" the downscaled image, or use some other smoothing function. Alternatively, you could up the smoothing function on the RT3 Editor when importing the heightmap. One other limitation of the grayscale heightmap is that you are limited to 256 levels of gray, and your photo editor may be putting in intermediate gray values, especially if you are working in an RGB color space.
low_grade
Dispatcher
Posts: 438
Joined: Sun May 17, 2009 3:02 pm
Location: Cleveland, OH

Re: Cropping and altering maps Unread post

Okay then. I see Gimp likes to use cubic interpolation by default. I'll try the other options and see if that helps.

Edit: Well, looks like it doesn't matter what kind of interpolation I use. But it DOES matter whether I create Grayscale maps which are scaled locally vs globally. Stay away from that local scaling! Makes the Lake Erie shoreline look like the Cliffs of Dover! Seems like I'm getting the hang of this now.

Edit 2: Seems I'm always speaking too soon here. Funny how when I export a Greyscale from Mapmaker and then load it in Gimp the ocean is still blue. I noticed that when I then opened my scaled/cropped image in the Editor the ocean shoreline was somewhat elevated from what it should be, so I figured something wasn't quite right. I then took your advise about saving in Greyscale not RGB, but now the Editor says it needs a truecolor file and won't open it. So I went back again to Gimp, made the Mapmaker image Greyscale then switched it back to RGB to get the truecolor, and now when I open up the resulting image in the Editor, there's no ocean, but a flat somewhat ELEVATED region where the ocean should be. !hairpull! Maybe if I first fill the blue ocean with black, this will help. I guess I could try blurring, too, so that the shoreline doesn't come out so dramatic. Or I could give up on Mapmaker and make maps form scratch using DEMs, but this option sounds incredibly tedious, though it's worth a try, Mapmaker probably isn't a good tool for zooming in on regions like I'm trying to do. Or I could just plan on having to lower and smooth the ocean shoreline down to sea level, which may be the happy medium I have to live with.
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Re: Cropping and altering maps Unread post

Making a map from DEM's is an option, however, you end up using the same procedures. The DEM gets converted into a greyscale bitmap, and you have to work with that in an image editor in exactly the same way. The advantage of the DEM is that it can be more accurate and more detailed, and you can zoom in on a small area. But you still need to figure out how to generate a useful height map, which is all this greyscale image editing.

The blue for the ocean should indeed be replaced with black, prior to importing into the editor. I'd first brighten the entire image a little bit, such that your darkest greys are a bit lighter than true black; then fill the blue with true black. When you bring this into the editor, you'll have a deep basin which you can fill with ocean, and the brightening step that you did earlier will ensure that the shoreline stays intact (i.e. if 0=black and 255=white, all your land areas are in a range of say 10 to 255, and the only places at 0 are the ocean). When you fill in the ocean, use the "fill all areas below this point" and when it paints the sea, it will raise it all to wherever you click, i.e. at the beaches that were represented by grey=10.

The bumpiness is less a function of the image, I think, and more of the smoothing settings in the editor. Just play around with the options until you get something you like, and keep in mind you can make across-the-board changes like "raise all the lowest land" or "squish down the peaks" (I forget what the terminology is) within the editor.
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
Wolverine@MSU
CEO
Posts: 1166
Joined: Fri Nov 10, 2006 2:14 pm
Location: East Lansing, MI

Re: Cropping and altering maps Unread post

WPandP wrote:Making a map from DEM's is an option, however, you end up using the same procedures. The DEM gets converted into a greyscale bitmap, and you have to work with that in an image editor in exactly the same way. The advantage of the DEM is that it can be more accurate and more detailed, and you can zoom in on a small area. But you still need to figure out how to generate a useful height map, which is all this greyscale image editing.
If you use Microdem to create the heightmap, and use the correct colorscale (ELEV_COLORS_0-9999.dbf), you get 1024 colors (~1 meter height change per color). It does not convert to a grayscale. Using DEMs as the source is much better than the Mapmaker, which suffers from latitude-dependent distortion. There's a tutorial posted in the EXTRAS section here, although it's a bit outdated, having been written several years ago, but gives the basic concepts about how to use Microdem, how to select areas and scaling maps for final output of the heightmap. It takes a little investment in time to learn how to use it, but if you're going to be making maps of real-world locations, it's the best way to go. If you really can't get it to work, tell me what latitude/longitude coordinates you want, the size of the final RT3 map, and I'll crank one out for you. I've done it for others, but I can't guarantee a rapid turnaround time.
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Re: Cropping and altering maps Unread post

I thought that your input into the Editor still has to be a greyscale image, so you have to get your DEM to export into 256 greys, or else convert it into that in an image editor. Am I wrong about this? And, the DEM viewer I've used was able to export to a greyscale image directly, though I forget the name of it (I did it using my work computer which is a Mac, so it wouldn't be much help to the majority PC users here).
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
Wolverine@MSU
CEO
Posts: 1166
Joined: Fri Nov 10, 2006 2:14 pm
Location: East Lansing, MI

Re: Cropping and altering maps Unread post

Microdem can color a map any way you want given the correct elevation -> color database. I made a custom database to allow 1000 different levels of elevation. The Editor can read 256-level "grayscale" or 1024-level RGB. I forget exactly what the formula was for coding the colors, but it only uses the green and blue channels.
Post Reply