maps with different projection ?

Smallpox vs. largepox, gen2 vs gen5, early war vs. peaceful alliances. Which is your favourite gaming style?
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

How about these... GProjector gets a bit buggy on my system when I keep changing the projection. I quit the program, then started again and the Winkel Tripel looks better now.

Image

Image
^ Only difference is adding "Bartholomew's Scaling"

Those are just screenshots of course, if you want actual exports of any of the projected images as png or uncompressed tiff, let me know!

Image
^ Just for fun -- this is the Earth 160x90 v2 Freeciv scenario's map, converted to PPM image at 1-to-1 (tile-to-pixel), then enlarged, and reprojected as Winkel Tripel in GProjector.


https://ibb.co/album/Q34fg0
^ Link is to a picture album of different projections from the Freeciv Earth 160x90 v2 map. The 19 projections in this album are the only projections by GProjector which produce "normal" looking maps that don't add or lose areas, and can easily be translated into new Freeciv maps.

"Normal" rectangular projections in Gprojector which can easily be translated to Freeciv maps:
BSAM Cylindrical
Braun Perspective
Braun Stereographic
Compact Miller
Cylindrical Stereographic
Equirectangular
Gall Stereographic
Kamenetsky
Kharchenko-Shabanova
Mercator -- loses the poles barely
Miller Cylindrical 1
Miller Cylindrical 2
Miller Perspective Compromise
Patterson Cylindrical
Pavlov -- loses a bit of the poles
Tobler Cylindrical 1
Tobler Cylindrical 2
Urmayev Cylindrical 2
Urmayev Cylindrical 3


https://ibb.co/album/CWysRb
^ This album shows the original map image with 3 more projections which are a bit weird but might actually work-out ok as Freeciv maps.

Weird but might work projections:
Adams World in a square 1 - only 1 pole which is at upper-right and lower-left corners which might be perfect for standard Freeciv topology
Gringorten - north pole center, south pole all 4 corners, south america split
Peirce Quincuncial north pole center, south pole all 4 corners, south america split

Image
^ Original Freeciv scenario "Earth 160x90 v2"

Image
^ Terrain map remade with "Adams World in a Square I" projection.

Attached is a Freeciv 2.6 scenario file with terrain layer map made by converting the terrain layer from "Earth 160x90 v2" to an image, then re-projecting the image in GProjector as Adams World in a Square I, then converting the image of the new projection back to a Freeciv terrain layer map. It's a bit of a different view but it works. There is only one pole though.
Attachments
Earth - Adams World in a Square 1 160x160.sav.zip
(14.44 KiB) Downloaded 120 times
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: maps with different projection ?

Post by meynaf »

Ok i will keep that for later. But first things first. I need trustable data with high enough resolution. For now i only have 1x 23-values + 3x 256-level data, in need of a conversion algorithm to make single 13-values data, this for a 21600x10800 area which probably needs a better downscaling method than my current pixel skipping...
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

At 21,600 * 10,800 pixels, your image has 233 million pixels. If your final map size target is 1,000x1,000 tiles, that is 1,000,000 tiles total. In which case, it might be better to develop an algorithm to convert each high-definition 233 pixel area of the image to 1 tile, rather than to convert 233 million pixels to 233 million tiles, and then have to reduce (skip) low-definition tiles to get to 1 million for a 1 MegaTile Freeciv map.

The problems with areas of fine detail would likely be the same either way: small islands will either disappear into ocean, or will be over-sized even at only 1x1 tile.

Then there is the problem of the -other- map layers for rivers, irrigation, specials/resources, etc. It might be easier in the long run to amalgamate all layers into one layer for projection changes. The 14 Freeciv tile types could be represented as pixel/byte values 1 to 14, then the e03_ river layer could be represented within byte values ranging from 20 to 30, and so on to combine all the layers into one, re-project the map, then split the layers apart again?
EDIT: Or, use RGB image with Geo data in R, then original Freeciv x,y values in G and B. After projection, use the current x,y and the original x,y per pixel to remap the other layers to the new terrain layer. That might be easier. Minor problem with max byte value though. 32 bit color? :)


For "trustable" data, maybe convert several data sets "Geo"-images to 1,000 x 1,000 pixels using standardized land-cover values, then generate a list of discrepancies at x,y coordinates to assess how many areas are problematic. If several data sets agree on a pixel, the classification might be right. :D If the mismatches are only a dozen or so pixels, manually determining what is actually at the given spot on Earth via satellite image at GooberMaps wouldn't be too much work.
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: maps with different projection ?

Post by meynaf »

Molo_Parko wrote:At 21,600 * 10,800 pixels, your image has 233 million pixels. If your final map size target is 1,000x1,000 tiles, that is 1,000,000 tiles total. In which case, it might be better to develop an algorithm to convert each high-definition 233 pixel area of the image to 1 tile, rather than to convert 233 million pixels to 233 million tiles, and then have to reduce (skip) low-definition tiles to get to 1 million for a 1 MegaTile Freeciv map.
That depends.
Land cover data cannot be averaged, so how to reduce a pixel area to a single pixel ? Simple skipping gives too much importance to some details (the higher leftmost value of a block isn't necessarily representative of the whole area).
It might be better to first reduce the range of values by converting to freeciv.

As an example, let's take an area that is 33% value 14 (= grassland), 32% value 20 (= grassland), 35% value 50 (= forest).
Highest is 35%, so value 50. Means forest.
However, both grassland types equal to 65% together so the tile should probably be grassland instead...

Molo_Parko wrote: The problems with areas of fine detail would likely be the same either way: small islands will either disappear into ocean, or will be over-sized even at only 1x1 tile.
Yep.

Molo_Parko wrote: Then there is the problem of the -other- map layers for rivers, irrigation, specials/resources, etc. It might be easier in the long run to amalgamate all layers into one layer for projection changes. The 14 Freeciv tile types could be represented as pixel/byte values 1 to 14, then the e03_ river layer could be represented within byte values ranging from 20 to 30, and so on to combine all the layers into one, re-project the map, then split the layers apart again?
14 Freeciv tile types ? I can only count 13 (10 land, 3 water).

Molo_Parko wrote: EDIT: Or, use RGB image with Geo data in R, then original Freeciv x,y values in G and B. After projection, use the current x,y and the original x,y per pixel to remap the other layers to the new terrain layer. That might be easier. Minor problem with max byte value though. 32 bit color? :)
Easier for me is to have one value for each tile type (4 bits are enough), two bits indicating each of the two possible special resources, and one extra for rivers (no irrigation at startup). Total 7 bits, no problem.

Of course this doesn't say where the heck i can find such data. There is nothing at all for special resources and rivers will be confused with ocean or lake - or just disappear because they're too small to be seen (at 21600x10800 a single pixel is still more than 1km large !).

Molo_Parko wrote: For "trustable" data, maybe convert several data sets "Geo"-images to 1,000 x 1,000 pixels using standardized land-cover values, then generate a list of discrepancies at x,y coordinates to assess how many areas are problematic. If several data sets agree on a pixel, the classification might be right. :D If the mismatches are only a dozen or so pixels, manually determining what is actually at the given spot on Earth via satellite image at GooberMaps wouldn't be too much work.
I am afraid that there is nothing such as standardized land cover values. Different dataset means different data.
My current one seems trustable enough, apparently. The biggest problem is how to interpret things.
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

The 14th tile type is the "inaccessible" tile which might have some value for features such as "bottomless" pits on land, or the inside of an active volcano, or the vertical edges of a canyon or tall cliff, or any rock feature which wouldn't be scalable by standard Freeciv units, etc., although a cosmetic make-over of the tile graphic when used for such purposes might be nice, which would then require a custom tile set (which I avoid).


In my opinion, some areas which actually are "flooded vegetation" (wetlands) but which aren't actually "swamp" (forested wetlands) might best be represented as irrigated grassland from the start -- because the irrigation is naturally occurring rather than a product of terrain alteration by units. The definitions of terms such as swamp, bog, and marsh differ -- they aren't identical and translating them all as "swamp" tiles isn't quite accurate. Boston, Massachusetts is in some areas on a "fen", which is a wetland but is not a swamp (not forested), and is not highly acidic (not a bog), as an example. It's land that is chronically wet due to low elevation, but that's all it is -- naturally irrigated land. Using irrigation as a starting terrain feature in such places extends the flexibility of standard Freeciv without creating custom tile sets. http://www.nps.gov/piro/learn/nature/wetlands.htm


There is data regarding "land use", natural resources, and so on but I don't know of any combined lists except the CIA World Factbook which is not in an easily extracted "data" format. https://www.cia.gov/the-world-factbook/ ... resources/

Image
^ That would work for determining where Freeciv's "coal" resource belongs, or doesn't.


For rivers... 594 MB data set downloading now from: https://www.hydrosheds.org/page/hydrorivers
EDIT: Completely different data set structures etc. Trying another set now...


-We- could standardize land cover values from multiple sets. Where one set uses 10 for grassland, the other uses 14 for grassland, change both to a standard value, 101 for instance. Same for each classification type from both sets - hardwood forest values from both sets become 102, jungle values become 103, and so on. There actually is a standardized class system (with roughly a million classes) but so far I have only found 1 map that used it and it was only coverage of a specific city as an example of the "standardized" classification system.

I'm unsure about when to scale down on size, as pixels, or after converting pixels to tiles. I'll try a couple of small experiments.

Image
EDIT2: I forgot that GProjector has built-in overlays. The above image is with the built-in rivers overlay in GProjector.

Image
This one is from the "world rivers" dataset (as an overlay in GProjector): http://ihp-wins.unesco.org/layers/geonode:world_rivers
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: maps with different projection ?

Post by meynaf »

Molo_Parko wrote:The 14th tile type is the "inaccessible" tile which might have some value for features such as "bottomless" pits on land, or the inside of an active volcano, or the vertical edges of a canyon or tall cliff, or any rock feature which wouldn't be scalable by standard Freeciv units, etc., although a cosmetic make-over of the tile graphic when used for such purposes might be nice, which would then require a custom tile set (which I avoid).
I have never seen that in any freeciv game (or any civ game at all, actually). But the features you describe here being small enough to disappear at a scale of several km per cell, i think we can just skip that part.

Molo_Parko wrote: In my opinion, some areas which actually are "flooded vegetation" (wetlands) but which aren't actually "swamp" (forested wetlands) might best be represented as irrigated grassland from the start -- because the irrigation is naturally occurring rather than a product of terrain alteration by units. The definitions of terms such as swamp, bog, and marsh differ -- they aren't identical and translating them all as "swamp" tiles isn't quite accurate. Boston, Massachusetts is in some areas on a "fen", which is a wetland but is not a swamp (not forested), and is not highly acidic (not a bog), as an example. It's land that is chronically wet due to low elevation, but that's all it is -- naturally irrigated land. Using irrigation as a starting terrain feature in such places extends the flexibility of standard Freeciv without creating custom tile sets. http://www.nps.gov/piro/learn/nature/wetlands.htm
Graphically, irrigation is clearly of artificial nature (very regular with straight lines). It is also very easy to destroy (remove), unlike normal terrain.
It would give players the false impression the area has already been settled.

Molo_Parko wrote: There is data regarding "land use", natural resources, and so on but I don't know of any combined lists except the CIA World Factbook which is not in an easily extracted "data" format. https://www.cia.gov/the-world-factbook/ ... resources/

^ That would work for determining where Freeciv's "coal" resource belongs, or doesn't.
It seems resources that are exhausted (f.e Lorraine coal in France) aren't on such maps. But for a fciv game we need everything that was there in prehistoric times...

Molo_Parko wrote: For rivers... 594 MB data set downloading now from: https://www.hydrosheds.org/page/hydrorivers
EDIT: Completely different data set structures etc. Trying another set now...
It seems only the biggest ones have to figure on the final map ;)

Molo_Parko wrote: -We- could standardize land cover values from multiple sets. Where one set uses 10 for grassland, the other uses 14 for grassland, change both to a standard value, 101 for instance. Same for each classification type from both sets - hardwood forest values from both sets become 102, jungle values become 103, and so on. There actually is a standardized class system (with roughly a million classes) but so far I have only found 1 map that used it and it was only coverage of a specific city as an example of the "standardized" classification system.
Well, but then our way to "standardize" would actually be "converting to freeciv"...

Molo_Parko wrote: I'm unsure about when to scale down on size, as pixels, or after converting pixels to tiles. I'll try a couple of small experiments.
Rather than when, my problem is how.
Currently, out of e.g. 5x5 area i just take the point at 0,0 in the block...

For land conversion i have :

Code: Select all

0	  south pole	(1)
11	 grassland
14	 grassland
20	 grassland
30	 plain
40	 jungle
50	 forest
60	 plain
70	 forest
90	 forest
100	forest
110	plain
120	plain
130	mountain
140	plain
150	tundra (maybe desert or plain, depending on latitude)     (2)
160	swamp
170	swamp
180	swamp
190	plain
200	desert (maybe tundra or plain, depending on latitude)     (2)
210	ocean		(3)
220	arctic
230	same as 150
(1) value not in map - used internally to represent missing area from land cover - arctic if bathymetry value is hex ff, else ocean like 210
(2) not done yet ; currently experimenting wih temperature and land elevation
(3) bathymetry hex range 00-df indicate deep ocean, e0-fe is normal (safe for triremes), ff is normal like e0-fe except when land elevation is 0 (-> lake)

While it seems i did not miss lakes, a few ocean tiles are mismatched and converted to lake because too shallow.
Many mountains are just not there.
There is absolutely nothing to produce hills, my biggest issue.

EDIT:
Temperature data i got is WRONG !
There are spots in Siberia that are hotter than the desert in Africa !
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

I've used the "inaccessible" tile in scenarios, but none are Earth / whole-planet. It's the cave walls in "The Hunted". Originally the caves were a labyrinth but I had to dumb-it-down repeatedly or the "A.I." players would wander around in the maze for awhile and many would give-up trying to find the way out. Also used in "Turing Test 3x3+1" to prevent contact (and fighting) between players because it's a test of adaptability to circumstance rather than a contest of warfare. I've tried a few times to make an "arena" scenario within Freeciv using inaccessible tiles for the arena walls, but so far I have failed to get the "A.I." to do anything challenging at all, it doesn't adapt well to unusual circumstances despite that such are valid within Freeciv.

Pre-irrigated grassland would look odd because the built-in map generator never does it, but that wouldn't stop me from doing it. :D I've used jungle tiles to represent scrub areas in desert - cactus, tumbleweeds, etc, despite that it makes no sense if one regards them as jungle (wet forest areas) in a desert. I've also used desert tiles to represent beaches. I like creating scenarios which the built-in generator wouldn't make, for variety and novel situations.
meynaf wrote:Temperature data i got is WRONG !
There are spots in Siberia that are hotter than the desert in Africa !
^ Different map projection maybe?
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: maps with different projection ?

Post by meynaf »

Molo_Parko wrote:I've used the "inaccessible" tile in scenarios, but none are Earth / whole-planet. It's the cave walls in "The Hunted". Originally the caves were a labyrinth but I had to dumb-it-down repeatedly or the "A.I." players would wander around in the maze for awhile and many would give-up trying to find the way out. Also used in "Turing Test 3x3+1" to prevent contact (and fighting) between players because it's a test of adaptability to circumstance rather than a contest of warfare. I've tried a few times to make an "arena" scenario within Freeciv using inaccessible tiles for the arena walls, but so far I have failed to get the "A.I." to do anything challenging at all, it doesn't adapt well to unusual circumstances despite that such are valid within Freeciv.

Pre-irrigated grassland would look odd because the built-in map generator never does it, but that wouldn't stop me from doing it. :D I've used jungle tiles to represent scrub areas in desert - cactus, tumbleweeds, etc, despite that it makes no sense if one regards them as jungle (wet forest areas) in a desert. I've also used desert tiles to represent beaches. I like creating scenarios which the built-in generator wouldn't make, for variety and novel situations.
Then this becomes a different game. I like custom games like this, but it is not the goal here. So we have 13 tile types, unless you can force the dev team and graphicians to add new ones. ;)

Molo_Parko wrote: ^ Different map projection maybe?
Considering the locations of the errors, it would be a very weird one :lol:
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

I think that using image software to resize / scale-down your tst.png image does a better job of it than anything that I have tried manually. With interpolation disabled, the pixel colors don't change at all.

Are you using the lake tile as inland water bodies (lake) or as a third water depth (lake, ocean, deep ocean)? I don't see any reason that it wouldn't work as a third depth type provided "lake flooding" is disabled in the scenario file. It would affect which specials can appear on the tile though.

The tst.png file has 30 colors, 8 are water, the 1 red color is city areas which you said to convert to plains tiles. There are so many green shades that it's not easy to convert to tiles visually by color. So I went looking for a list of only distinct web colors and found this: https://sashamaps.net/docs/resources/20-colors/

^ Which is pretty good! Select "convenient" and RGB values. It's 20 colors + black and white. The picture wouldn't be as pretty but it would be easier to distinguish terrain types visually if they were each distinct.

Image
Image
Gringorten map projection from your tst.png image, then converted to Freeciv map. That's the north pole at the bottom, south pole at the top and the Americas.

:P

Image
^ Original Adams world-in-a-square 2 from Gprojector.

Image
^ Modified by adding north pole, extending both poles horizontally, filling ocean at corners, cropped image to rectangle

Image
^ Freeciv mini-map centered

Image
^ Western North America.

I think that I have found my favorite map projection for Freeciv. I used Adams World-in-a-square 2, then modified it to a rectangular format, added north pole and it's very nice with WrapX only. Might be able to tighten-up the sides a bit by angling islands East of Australia downward to SE and moving Hawaii NE, then crop with less ocean on the sides to make Russia and Alaska closer to the (new) horizontal edges.
Attachments
Earth - modified Adams World in a Square 2 369x240.sav.zip
(24.14 KiB) Downloaded 113 times
Earth - Gringorten 100x100.sav.zip
(11.53 KiB) Downloaded 124 times
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: maps with different projection ?

Post by meynaf »

Molo_Parko wrote:I think that using image software to resize / scale-down your tst.png image does a better job of it than anything that I have tried manually. With interpolation disabled, the pixel colors don't change at all.
I wouldn't trust image software for that task without knowing the algorithm it uses. And if i know it, then i can of course do it myself.
Besides, this closes the door to adaptative scaling, i.e. scaling based on priorities setup for the terrain types. For example if we're reluctant to remove some specific features they might receive a greater priority. I know, this will not make things simpler :)
Note that of course my tst.png image is already a scaled-down version by itself.

Molo_Parko wrote: Are you using the lake tile as inland water bodies (lake) or as a third water depth (lake, ocean, deep ocean)? I don't see any reason that it wouldn't work as a third depth type provided "lake flooding" is disabled in the scenario file. It would affect which specials can appear on the tile though.
I don't see a reason to do anything but inland water bodies that can get flooded.

Molo_Parko wrote: The tst.png file has 30 colors, 8 are water, the 1 red color is city areas which you said to convert to plains tiles. There are so many green shades that it's not easy to convert to tiles visually by color. So I went looking for a list of only distinct web colors and found this: https://sashamaps.net/docs/resources/20-colors/

^ Which is pretty good! Select "convenient" and RGB values. It's 20 colors + black and white. The picture wouldn't be as pretty but it would be easier to distinguish terrain types visually if they were each distinct.
I don't do it this way. Whenever i want to see some specific terrain type of interest, i just temporarily change its color, usually to black or magenta.
If necessary i would even be able to make them blink.
Thus distinctive colors are for me a non-issue. Please concentrate on the real problems, like how to produce hills. ;)

Molo_Parko wrote: Gringorten map projection from your tst.png image, then converted to Freeciv map. That's the north pole at the bottom, south pole at the top and the Americas.
I can only say : aaarghh.

Molo_Parko wrote: ^ Original Adams world-in-a-square 2 from Gprojector.
Makes me want to reduce the south pole, which is too big for my taste. Mixing projection systems could be a solution to get a smaller, centered one.
And, of course, adding north pole as well.
Do you have shapes (compatible with 21600x10800) that i could use ?
Post Reply