I suppose ordinary Earth maps in Freeciv use Mercator projection ?
Are other ones available anywhere ? (Obviously not just images but maps containing terrain type so a civ game can use them.)
I'm especially interested in Winkel-tripel projection, which looked like a good compromise to me, at least for a video game (Mercator destroys sizes, Gall-Peters destroys shapes...)
maps with different projection ?
-
- Hardened
- Posts: 158
- Joined: Fri Jul 02, 2021 4:00 pm
Re: maps with different projection ?
![Image](http://imgur.com/dzCpxyI.jpg)
It is possible to convert the jpeg at your link to a Freeciv map. The process varies a bit depending on the format of the original image but it's basically the following:
- Use an image editing program to limit the number of colors in the image to 13 (for the 13 terrain tiles in Freeciv.) Use the "posterize" option in Photoshop. In Graphic Converter use Picture menu > Colors > Change color usage dynamically.
- Proportionately reduce the image size to the desired Freeciv map size -- for instance, with constrained proportions reduce the width to 200 pixels for a 200 tile wide Freeciv map. In some programs, this causes the color palette to increase because the programmer thought it "smart" to add new shades when resizing. If that occurs, then again limit the number of colors to 13.
- Save a copy of the new map in a graphics format which can be converted to Freeciv terrain map format
- Convert the map
![Image](http://imgur.com/aeYOxcC.jpg)
^ PPM ASCII format img file contents viewed in a text editor. The highlighted portion is the first line of pixels running across the top of the image. The sequence "255 255 255" is the RGB value for a completely white pixel.
The most tedious part is step 1 of the process in which it is important to get 13 distinct colors before reducing the number of colors -- three for ocean, deep ocean, lake, and 10 for the various land tiles. It often takes a bit of fiddling with color levels / balance to get distinct colors for areas like grassland vs. forest, or desert vs. plains. In the image at the link you posted, there is very little difference between jungle and forest so as a Freeciv map it's likely to have only one or the other and not both (all forest, or all jungle.)
Elevation / topographical maps are generally easier to convert because they already tend to have a limited color set - like this one:
![Image](https://i.redd.it/mn1kzojxtua41.jpg)
EDIT: You could also try using any image-to-ASCII-art converter that allows specifying which characters to use. I've used 'jp2a' before with good results on some maps. jp2a also allows forcing width/height of the text (Freeciv map) output to alter the aspect ratio. http://csl.name/jp2a/
Re: maps with different projection ?
Thanks for your reply, i wasn't expecting any
Well, the problem is probably more about finding a suitable source map rather than actually converting it.
As none of the maps i've found contain relevant data, i.e. civ-like terrain types.
And they often have things drawn on top of it, e.g. lines for meridians. Not easy to remove.
So if the colors get simply converted, terrains will just be wrong. It will remotely look like Earth, but not be it. It will confuse plains with grasslands, put mountains in deserts because of the brown shades, not do shallow/deep ocean difference, etc.
Mere conversion to 13 colors won't give me 10 lands and 3 waters (oceans and lakes will surely look the same).
Else, reducing color numbers and shrinking images are no big deal. Same for converting pixels to ascii map (or vice versa).
An alternative could be to start with a high definition image (or, better, a huge civ map) and recompute the projection from it.
I can make a program doing that, no problem for me, but i don't have the maths skills so i'd need a blind formula to apply.
And of course a big enough map, with all the information, must be found.
All that, for a final map with cells somewhere between 20 to 100 km wide (with as correct as possible total surface of 510 millions km²).
![Cool 8-)](./images/smilies/icon_cool.gif)
Well, the problem is probably more about finding a suitable source map rather than actually converting it.
As none of the maps i've found contain relevant data, i.e. civ-like terrain types.
And they often have things drawn on top of it, e.g. lines for meridians. Not easy to remove.
So if the colors get simply converted, terrains will just be wrong. It will remotely look like Earth, but not be it. It will confuse plains with grasslands, put mountains in deserts because of the brown shades, not do shallow/deep ocean difference, etc.
Mere conversion to 13 colors won't give me 10 lands and 3 waters (oceans and lakes will surely look the same).
Else, reducing color numbers and shrinking images are no big deal. Same for converting pixels to ascii map (or vice versa).
An alternative could be to start with a high definition image (or, better, a huge civ map) and recompute the projection from it.
I can make a program doing that, no problem for me, but i don't have the maths skills so i'd need a blind formula to apply.
And of course a big enough map, with all the information, must be found.
All that, for a final map with cells somewhere between 20 to 100 km wide (with as correct as possible total surface of 510 millions km²).
-
- Hardened
- Posts: 158
- Joined: Fri Jul 02, 2021 4:00 pm
Re: maps with different projection ?
You dream big, don't you? ![Smile :)](./images/smilies/icon_e_smile.gif)
Even at 20 to 100 Km cells, features like San Francisco would likely end-up being a single tile overstating the size of the town by at least 100%, and would probably become just one hill tile in the Freeciv map at 1-to-1 conversion. What limit might you choose for final size of the Freeciv map?
If a map were rendered or accurately converted into a scalable format, a la Postscript or SVG, that might solve the size issue for the outline / shape of continents and islands without requiring the math originally necessary to the map projection method at all.
This map might work as a source for conversion to scalable format. The longitude and latitude lines could be knocked-out pretty easily.
https://upload.wikimedia.org/wikipedia/ ... ed.svg.png
I just realized that was generated from an SVG file.
The original SVG map from which that image was derived: https://upload.wikimedia.org/wikipedia/ ... ntered.svg
More: https://commons.wikimedia.org/wiki/Cate ... projection
Once the outline of the land areas is ~accurate, programmatically matching terrain to a given tile location by converting Freeciv tile x,y to actual longitude and latitude on Earth, then pulling data from a source like USGS ( http://www.usgs.gov/media/images/nation ... er-dataset ) about foliage and/or elevation might work to determine majority feature of the individual tile (as "forest" vs. "desert", or "mountain" vs "hill" for instance.)
^ It just occurred to me that one could create a "blank" Freeciv map of any dimensions, then convert x,y of each tile to longitude and latitude to auto-create an Earth map from the USGS data ( http://www.usgs.gov/centers/eros/scienc ... ation-glcc ) at the scale of the Freeciv map size. 100x100 tile map would be very rough. 10000x10000 map would be much more detailed, and so on.
Rotating Winkel-Tripel globe: https://bl.ocks.org/mbostock/3790085
![Smile :)](./images/smilies/icon_e_smile.gif)
Even at 20 to 100 Km cells, features like San Francisco would likely end-up being a single tile overstating the size of the town by at least 100%, and would probably become just one hill tile in the Freeciv map at 1-to-1 conversion. What limit might you choose for final size of the Freeciv map?
If a map were rendered or accurately converted into a scalable format, a la Postscript or SVG, that might solve the size issue for the outline / shape of continents and islands without requiring the math originally necessary to the map projection method at all.
This map might work as a source for conversion to scalable format. The longitude and latitude lines could be knocked-out pretty easily.
https://upload.wikimedia.org/wikipedia/ ... ed.svg.png
I just realized that was generated from an SVG file.
![Smile :)](./images/smilies/icon_e_smile.gif)
More: https://commons.wikimedia.org/wiki/Cate ... projection
Once the outline of the land areas is ~accurate, programmatically matching terrain to a given tile location by converting Freeciv tile x,y to actual longitude and latitude on Earth, then pulling data from a source like USGS ( http://www.usgs.gov/media/images/nation ... er-dataset ) about foliage and/or elevation might work to determine majority feature of the individual tile (as "forest" vs. "desert", or "mountain" vs "hill" for instance.)
^ It just occurred to me that one could create a "blank" Freeciv map of any dimensions, then convert x,y of each tile to longitude and latitude to auto-create an Earth map from the USGS data ( http://www.usgs.gov/centers/eros/scienc ... ation-glcc ) at the scale of the Freeciv map size. 100x100 tile map would be very rough. 10000x10000 map would be much more detailed, and so on.
Rotating Winkel-Tripel globe: https://bl.ocks.org/mbostock/3790085
Re: maps with different projection ?
ProbablyMolo_Parko wrote: You dream big, don't you?![]()
![Smile :)](./images/smilies/icon_e_smile.gif)
It can be as big as possible, due it's a lot easier to resize to a smaller map than to a bigger one.Molo_Parko wrote: Even at 20 to 100 Km cells, features like San Francisco would likely end-up being a single tile overstating the size of the town by at least 100%, and would probably become just one hill tile in the Freeciv map at 1-to-1 conversion. What limit might you choose for final size of the Freeciv map?
With 20km cells we already have more than 1.2 million cells.
Sure thing is that 80x50 isn't enough
![Laughing :lol:](./images/smilies/icon_lol.gif)
Shapes are not the real problem. It's terrain types. If you know that, then terrain type = water indicates the shape.Molo_Parko wrote: If a map were rendered or accurately converted into a scalable format, a la Postscript or SVG, that might solve the size issue for the outline / shape of continents and islands without requiring the math originally necessary to the map projection method at all.
This map might work as a source for conversion to scalable format. The longitude and latitude lines could be knocked-out pretty easily.
https://upload.wikimedia.org/wikipedia/ ... ed.svg.png
I just realized that was generated from an SVG file.The original SVG map from which that image was derived: https://upload.wikimedia.org/wikipedia/ ... ntered.svg
Nothing with civ-like infos there, it seems.Molo_Parko wrote: More: https://commons.wikimedia.org/wiki/Cate ... projection
Yes but i don't know how to extract data from this site and it appears it's "national" data, not "whole planet" data...Molo_Parko wrote: Once the outline of the land areas is ~accurate, programmatically matching terrain to a given tile location by converting Freeciv tile x,y to actual longitude and latitude on Earth, then pulling data from a source like USGS ( http://www.usgs.gov/media/images/nation ... er-dataset ) about foliage and/or elevation might work to determine majority feature of the individual tile (as "forest" vs. "desert", or "mountain" vs "hill" for instance.)
Didn't work when i tried it (i get empty image).Molo_Parko wrote: Rotating Winkel-Tripel globe: https://bl.ocks.org/mbostock/3790085
-
- Hardened
- Posts: 158
- Joined: Fri Jul 02, 2021 4:00 pm
Re: maps with different projection ?
![Image](http://imgur.com/v9XyVmd.jpg)
Well, I eventually found some USGS "Land Cover" data which looks like it would be easily translated to specific Freeciv tile types, see picture above. However, I have yet to find any documentation explaining what it means and how to get the data for a specific global coordinate on Earth.
https://www.usgs.gov/faqs/where-can-i-g ... e_products
Their "EarthExplorer" seems to be visually oriented which is not what I want. I want a text/xml list by global coordinates or a live-lookup by coordinates.
The data exists, but I can't tell where.
![Smile :)](./images/smilies/icon_e_smile.gif)
^ Which sounds like what I want but I can't figure out how to get it!Layer of Coverage
Field Definition: The classification name of the land cover.
https://www.usgs.gov/centers/eros/scien ... er_objects
The government website is giving me a headache. I'm gonna go look at the sky for awhile.
![Neutral :|](./images/smilies/icon_neutral.gif)
^ Apparently Google Earth also has the NASA global land cover data available. However, nowhere can I find any mention of getting a simple json response of land cover type to a query by global coordinates. https://developers.google.com/earth-eng ... 06_MCD12Q1 The hex color per land cover type appears to be at least partially defined in the user guide linked below.
![Image](http://imgur.com/8temO8g.jpg)
^ USGS' MODIS Land Cover user guide (https://lpdaac.usgs.gov/documents/101/M ... ide_V6.pdf) does show the classification values for land cover though, looks great. Still can't manage to get it by coordinates.
Re: maps with different projection ?
Found this while following the links :
https://lcviewer.vito.be/
It looks closer but i can't get it to give me what i want.
Even if it were the case, i'd be unable to redo the projection anyway.
https://lcviewer.vito.be/
It looks closer but i can't get it to give me what i want.
Even if it were the case, i'd be unable to redo the projection anyway.
-
- Hardened
- Posts: 158
- Joined: Fri Jul 02, 2021 4:00 pm
Re: maps with different projection ?
I am actually surprised that every single site hosting land cover data seems to share only image files. 53 GigaBytes worth of image files. I still have not found any site that shares text results of land cover classification by area. I find that odd to the point of being unbelievable, and yet that is exactly how the situation appears to be... weird.
I don't think that it would be necessary to re-do the projection. If you find a land cover/terrain/elevation map that looks like a winner, load the Winkel Tripel svg map, then underlay the land-cover map. Distort the land cover map to fit the existing svg map - which can be done by point-and-click with a mouse, no math required. Photoshop should make it fairly easy ?
![Image](http://imgur.com/BaG5Dik.jpg)
^ This is a partial screenshot of Photoshop showing Madagascar from the Winkel Tripel SVG file with the outline of the land cover map from https://www.wildmadagascar.org/maps/land_cover.html I used the Edit > Transform > Warp feature of Photoshop to fit the land cover image to the SVG image of the island.
![Image](http://imgur.com/xYzD5ka.jpg)
^ The end result is land cover image matching the Winkel Tripel projection of Madagascar. The "warp" process took a few seconds.
I don't think that it would be necessary to re-do the projection. If you find a land cover/terrain/elevation map that looks like a winner, load the Winkel Tripel svg map, then underlay the land-cover map. Distort the land cover map to fit the existing svg map - which can be done by point-and-click with a mouse, no math required. Photoshop should make it fairly easy ?
![Image](http://imgur.com/BaG5Dik.jpg)
^ This is a partial screenshot of Photoshop showing Madagascar from the Winkel Tripel SVG file with the outline of the land cover map from https://www.wildmadagascar.org/maps/land_cover.html I used the Edit > Transform > Warp feature of Photoshop to fit the land cover image to the SVG image of the island.
![Image](http://imgur.com/xYzD5ka.jpg)
^ The end result is land cover image matching the Winkel Tripel projection of Madagascar. The "warp" process took a few seconds.
Re: maps with different projection ?
No winners on the web, apparentlyMolo_Parko wrote: If you find a land cover/terrain/elevation map that looks like a winner, (...)
![Sad :(](./images/smilies/icon_e_sad.gif)
-
- Hardened
- Posts: 158
- Joined: Fri Jul 02, 2021 4:00 pm
Re: maps with different projection ?
The main problem I see with most land cover maps on the 'net is that they have far too many types of land cover for an easy, simple conversion to Freeciv tile types.
![Image](https://upload.wikimedia.org/wikipedia/commons/e/e9/Madagascar_topo.jpg)
^ This one has both elevation and land cover maps. This land cover map has relatively few types of land cover compared to most of the maps, and fewer would be easier to convert. When converting to Freeciv tiles, one could alternate mountain or hill tiles with whichever land cover type is indicated at a particular high-elevation spot on the map. "fmfmfm" could be derived programmatically for an area of the Freeciv map where the corresponding area of the elevation map shows mountain, and the corresponding area of the land cover map shows forest. That would be simple. I'd match all forest areas to forest tiles, shrub and mangrove to jungle tiles, bare soil to desert tiles and in all cases, intermix either hill or mountain tiles if the area indicates medium to high elevation. All three water types would match to lake tiles since the ocean is not included in the "land" cover map. The conversion is very easy to figure out with a map that doesn't have umpteen-bajillion types of land cover.
But most of the land cover maps seem to have so many different types that I'm not sure which Freeciv tile type(s) would be best, or whether to try to mix several across multiple tiles to give an impression of the actual area. Like the Madagascar land cover map I used in my prior post. Here is the color key for that map:
![Image](https://images.wildmadagascar.org/media/fao_veg_cover2.jpg)
^ Their idea of "grassland" strikes me more as plains (in Freeciv.) "Dry cropland and pasture" is what?! exactly? A desert? Or again, plains??? How about "Savanna"... should that become forest or plains or a mix of both tile types in that area? Or a mix of desert and forest? Or all three?
It would be easier with fewer, and more common designations than with many somewhat odd terrain types.
This is a nice color key image:![Image](http://eoimages.gsfc.nasa.gov/images/imagerecords/61000/61004/lcc_key.jpg)
![Image](https://upload.wikimedia.org/wikipedia/commons/e/e9/Madagascar_topo.jpg)
^ This one has both elevation and land cover maps. This land cover map has relatively few types of land cover compared to most of the maps, and fewer would be easier to convert. When converting to Freeciv tiles, one could alternate mountain or hill tiles with whichever land cover type is indicated at a particular high-elevation spot on the map. "fmfmfm" could be derived programmatically for an area of the Freeciv map where the corresponding area of the elevation map shows mountain, and the corresponding area of the land cover map shows forest. That would be simple. I'd match all forest areas to forest tiles, shrub and mangrove to jungle tiles, bare soil to desert tiles and in all cases, intermix either hill or mountain tiles if the area indicates medium to high elevation. All three water types would match to lake tiles since the ocean is not included in the "land" cover map. The conversion is very easy to figure out with a map that doesn't have umpteen-bajillion types of land cover.
But most of the land cover maps seem to have so many different types that I'm not sure which Freeciv tile type(s) would be best, or whether to try to mix several across multiple tiles to give an impression of the actual area. Like the Madagascar land cover map I used in my prior post. Here is the color key for that map:
![Image](https://images.wildmadagascar.org/media/fao_veg_cover2.jpg)
^ Their idea of "grassland" strikes me more as plains (in Freeciv.) "Dry cropland and pasture" is what?! exactly? A desert? Or again, plains??? How about "Savanna"... should that become forest or plains or a mix of both tile types in that area? Or a mix of desert and forest? Or all three?
It would be easier with fewer, and more common designations than with many somewhat odd terrain types.
This is a nice color key image:
![Image](http://eoimages.gsfc.nasa.gov/images/imagerecords/61000/61004/lcc_key.jpg)