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 »

There are no polar issues in Freeciv maps which don't depict an entire planet. A map of only the British isles, for instance, without WrapY has no problems regarding which way is north or south. Top is always north, bottom is always south (within the Freeciv game.)

The "GreenMarble" color image has the north pole sea ice constructed from MODIS data -- it's accurate. You can copy the white shaded pixels to a new PNG for use as an Arctic ice overlay in your image (scaled up to size.) The base GreenMarble image is created by NASA. The north pole was added by the guy who controls the web site at the link.

Arctic overlay layer at 21600 pixel width --> https://www.sendspace.com/file/xkwy81

For the GEBCO bathy/elev 8 bit image, you could treat the one byte values as a range (0-255 meters), then using pixel x,y from your tst.png image file, determine if the pixel at x,y is water or land in your image. If land, convert 1 byte value from the depth/elevation image pixel at same x,y to elevation. If the pixel in your image is water, convert the 1 byte value to depth. There are only 2 ocean depths in Freeciv, so perhaps convert to only 2 values such as anything less than 100 meters depth is "ocean" and the rest are "deep ocean". Same with land for elevation as one of 3 or 4 levels. Freeciv depth/elevation is so coarse that this method would probably work out the same as actual values from a 2 byte per pixel image.

Or try this:
https://www.gebco.net/data_and_products ... sion=1.3.0
^ That is depth/elevation using current data from GEBCO. Unfortunately maximum width is 4096 (and equirectangular aspect ratio is 2:1) so you'd have to enlarge this to 21600x10800 to be at 1:1 pixel ratio with your image. I *ASSume* that pixel values represent # of meters as either depth or elevation.

https://www.gebco.net/data_and_products ... rtical.jpg
^ GEBCO depth key/legend for bathymetric data.

That's getting closer to what I want -- the link below gives a 512x256 depth/elevation map image which would easily convert to Freeciv map, but no land cover data. At least the tile-to-pixel ratio is 1:1. Still no north pole though.
https://www.gebco.net/data_and_products ... sion=1.3.0
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:There are no polar issues in Freeciv maps which don't depict an entire planet. A map of only the British isles, for instance, without WrapY has no problems regarding which way is north or south. Top is always north, bottom is always south (within the Freeciv game.)
Local maps aren't the point here, are they ?

Molo_Parko wrote: The "GreenMarble" color image has the north pole sea ice constructed from MODIS data -- it's accurate. You can copy the white shaded pixels to a new PNG for use as an Arctic ice overlay in your image (scaled up to size.) The base GreenMarble image is created by NASA. The north pole was added by the guy who controls the web site at the link.
Now define "white shaded" on an image obviously full of intermediate hues due to antialias and/or size reduction. No thanks.

Molo_Parko wrote: Arctic overlay layer at 21600 pixel width --> https://www.sendspace.com/file/xkwy81
Nope -- this is 4320x2160 image - and 24-bit on top of this. And no, color reduction algorithms won't recover from that.
But we're getting closer.

Molo_Parko wrote: For the GEBCO bathy/elev 8 bit image, you could treat the one byte values as a range (0-255 meters), then using pixel x,y from your tst.png image file, determine if the pixel at x,y is water or land in your image. If land, convert 1 byte value from the depth/elevation image pixel at same x,y to elevation. If the pixel in your image is water, convert the 1 byte value to depth. There are only 2 ocean depths in Freeciv, so perhaps convert to only 2 values such as anything less than 100 meters depth is "ocean" and the rest are "deep ocean". Same with land for elevation as one of 3 or 4 levels. Freeciv depth/elevation is so coarse that this method would probably work out the same as actual values from a 2 byte per pixel image.
My file is land elevation only, it does not contain ocean depth. The bathymetry information comes from another file.
But this is not the problem - i am already doing something like this. The thing here is to know how many meters that byte indicates. I wanted to put the mountain threshold at 800m - i know mountain roughly starts here from experience - but what is the corresponding byte value ?
I could've done this like i did for oceans, i.e. visually checking various results until something "good" is seen but it didn't work for mountains.

Molo_Parko wrote: Or try this:
https://www.gebco.net/data_and_products ... sion=1.3.0
^ That is depth/elevation using current data from GEBCO. Unfortunately maximum width is 4096 (and equirectangular aspect ratio is 2:1) so you'd have to enlarge this to 21600x10800 to be at 1:1 pixel ratio with your image. I *ASSume* that pixel values represent # of meters as either depth or elevation.
It is obvious from the colors of the image that it's not simple elevation data. As this is 24-bit image even if "jpeg" is replaced by "png" in the query (never use jpeg images for that kind of work, they have lots of pixel mixing and visual artifacts !), pixel values don't represent anything useful. And don't ask me to reduce the color number. It won't help.

Molo_Parko wrote: https://www.gebco.net/data_and_products ... rtical.jpg
^ GEBCO depth key/legend for bathymetric data.
It doesn't help -- still 24-bit image with lots of land hues.

Molo_Parko wrote: That's getting closer to what I want -- the link below gives a 512x256 depth/elevation map image which would easily convert to Freeciv map, but no land cover data. At least the tile-to-pixel ratio is 1:1. Still no north pole though.
https://www.gebco.net/data_and_products ... sion=1.3.0
For me this is still useless jpeg image.
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

The point I was trying to make regarding local vs. global maps is that only global maps have polar issues. In Freeciv the top edge of the map is always north, the bottom edge is always south. A full Earth map which does not show polar regions across the entire width of the top and bottom rows will seem weird because it's an attempt to constrain "north" to a subsection of the topmost row of the map despite that the entire topmost row of the map is north within the game. Traveling to the top/north end of a Freeciv Earth map should result in encountering ice or it wouldn't be Earth-like.

Sorry about the wrong description for the Arctic overlay file, that was the original width. I'm assembling layers for a 512 width map and saved the Arctic layer as bitmap with all whites as pure white (255) and the rest black (to be ignored when combining the layers into a Freeciv map.) Link to 21600 width version of bitmap Arctic (white pixels translate to "a" arctic/glacier tiles in Freeciv. Ignore black pixels.) https://www.sendspace.com/file/qp8sxd

The GEBCO web map service has several layers available. "gebco_latest" layer includes sea floor imagery. To get the bathy/elev layer without sea floor imagery, request layer "gebco_latest_2". Link to GEBCO image without sea floor: https://www.gebco.net/data_and_products ... sion=1.3.0
^ Change width and height values in URL to whatever you want.

GEBCO web map capabilities / options for map requests listed at this link:
https://www.gebco.net/data_and_products ... sion=1.3.0
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 point I was trying to make regarding local vs. global maps is that only global maps have polar issues. In Freeciv the top edge of the map is always north, the bottom edge is always south. A full Earth map which does not show polar regions across the entire width of the top and bottom rows will seem weird because it's an attempt to constrain "north" to a subsection of the topmost row of the map despite that the entire topmost row of the map is north within the game. Traveling to the top/north end of a Freeciv Earth map should result in encountering ice or it wouldn't be Earth-like.
Freeciv can generate maps where both poles are round areas. Remember, it supports wrapping. So this point about top edge always being north is moot.

Molo_Parko wrote: Sorry about the wrong description for the Arctic overlay file, that was the original width. I'm assembling layers for a 512 width map and saved the Arctic layer as bitmap with all whites as pure white (255) and the rest black (to be ignored when combining the layers into a Freeciv map.) Link to 21600 width version of bitmap Arctic (white pixels translate to "a" arctic/glacier tiles in Freeciv. Ignore black pixels.) https://www.sendspace.com/file/qp8sxd
As this file starts with 00 and ends with FF, it's more antarctic than arctic, isn't it ?

Molo_Parko wrote: The GEBCO web map service has several layers available. "gebco_latest" layer includes sea floor imagery. To get the bathy/elev layer without sea floor imagery, request layer "gebco_latest_2". Link to GEBCO image without sea floor: https://www.gebco.net/data_and_products ... sion=1.3.0
^ Change width and height values in URL to whatever you want.
From this link only another tiff can be obtained or, if changing the file format, a color image which isn't a layer.

Molo_Parko wrote: GEBCO web map capabilities / options for map requests listed at this link:
https://www.gebco.net/data_and_products ... sion=1.3.0
And ?
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

The point of the top of the map being north is that to move northward, travel is in the direction of the top of the map. With WrapY not enabled, and the north pole at the top of the map, then it would be impossible to continue traveling north from the north pole! -- just like on Earth! I don't see any way of depicting a realistic global world within Freeciv if Wrap Y is on. It makes it possible to move north from the north pole and magically appear on the south pole in one turn. WrapY on an Earth map is cray-cray. If one or both poles are relocated to another area of the map that is neither top nor bottom edge, the problem of being able to move south from the south pole, or north from the north pole still occurs, which is also cray-cray if the map is supposed to be Earth. A map can have an ice area in the middle, even with a label of "North pole", but it in actual play, the player's units can move north to the centrally located "north pole" and then still continue north to the top of the map. What's north of the north pole on Earth??? Aurora Polaris?

Bitmap file, white=0, black=255. Only two colors in the file (which is why I saved as bitmap, converted from grayscale where white is 255 not 0.) Standardization, who needs it! Am-I-Right?! :D

The GEBCO wms web map service has the older versions too. They call each version a "layer" despite that those which I have tried weren't overlays. You could download the presumably 2-byte version of the depth/elev png that you already have (from the same year's dataset.) My only complaint with their depth data is that there is too much of it. Freeciv only has 2 ocean depths, and shallow ocean (maybe less than 500 feet or so deep) would be a very small data set compared to the GEBCO image files but there is no option to tell it "Just give me a list of the two most shallow ocean depth tint/color pixels."

I'm having a similar problem regarding rivers and coasts. I do not want an entire Earth image of 80 bajillion bytes. I only want the rivers, and/or coasts but the only overlays I've found are not great quality (too many blurry shades of pixels along the rivers.) I also downloaded some (land only) data from https://data.apps.fao.org/map/catalog/s ... 559c4bff38 I like their classifications for land cover better than the GlobCover ambiguity (>15% something.) The FAO site has separated datasets for each type of land cover, forests in one set, grassland in another and so on. I got their snow and ice data to test with, it's a 10 MB LZW compressed GeoTiff with pixel values ranging from 0 to 100 which represent the percentage at which the pixel's area is covered in snow/ice, which is nice ( >60% or so = arctic tile in Freeciv.) BUT, instead of making the file an overlay, or a text data list of just the pixels with snow/ice, the download is the whole damn world image again. As you could probably guess, 900,000,000 of the pixels in the image are ocean which make them useless since the dataset is only LAND cover of snow and ice.
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 point of the top of the map being north is that to move northward, travel is in the direction of the top of the map. With WrapY not enabled, and the north pole at the top of the map, then it would be impossible to continue traveling north from the north pole! -- just like on Earth!
If you go to max possible north on physical Earth, there will not be an invisible wall preventing you from advancing more. In Freeciv there is. You find THAT logic ??
IOW in real life you can go north from north pole - it's just that you don't know it's not north anymore.
If you use WrapY, there is no true north. Type numpad 8 on your keyboard - that could well advance you southwards.

Molo_Parko wrote: I don't see any way of depicting a realistic global world within Freeciv if Wrap Y is on. It makes it possible to move north from the north pole and magically appear on the south pole in one turn.
If you generate a map with WrapY on, you'll get round poles that are at max possible distance from each other. I can't imagine applying that to Earth map, though it might be possible with one of these strange projections.

Molo_Parko wrote: WrapY on an Earth map is cray-cray. If one or both poles are relocated to another area of the map that is neither top nor bottom edge, the problem of being able to move south from the south pole, or north from the north pole still occurs, which is also cray-cray if the map is supposed to be Earth. A map can have an ice area in the middle, even with a label of "North pole", but it in actual play, the player's units can move north to the centrally located "north pole" and then still continue north to the top of the map. What's north of the north pole on Earth??? Aurora Polaris?
North of the north pole on Earth is south. It is round, remember ;)

Molo_Parko wrote: Bitmap file, white=0, black=255. Only two colors in the file (which is why I saved as bitmap, converted from grayscale where white is 255 not 0.) Standardization, who needs it! Am-I-Right?! :D
What are you talking about ? What is that file ?

Molo_Parko wrote: The GEBCO wms web map service has the older versions too. They call each version a "layer" despite that those which I have tried weren't overlays. You could download the presumably 2-byte version of the depth/elev png that you already have (from the same year's dataset.) My only complaint with their depth data is that there is too much of it. Freeciv only has 2 ocean depths, and shallow ocean (maybe less than 500 feet or so deep) would be a very small data set compared to the GEBCO image files but there is no option to tell it "Just give me a list of the two most shallow ocean depth tint/color pixels."
You needn't complaint. Ocean depth is handled already, i can produce images with only 2 colors -- what i need is land elevation for mountains.

Molo_Parko wrote: As you could probably guess, 900,000,000 of the pixels in the image are ocean which make them useless since the dataset is only LAND cover of snow and ice.
Not a problem, as LAND cover of snow and ice is actually useless. South pole is known already and north pole is sea ice - not land.
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

There is no invisible wall in Freeciv with WrapY disabled either - the entire surface of the planet is displayed in the map's columns and rows of tiles. Every possible route is -already- displayed on the map. In Freeciv, if you travel up north to the center of the north pole (at the top edge of the map), then all land routes, every row and column of tiles lead south -- there is no route to continue north from the north pole with WrapY disabled (units can only move down, or left/right, but not North (up) from the top edge). However with WrapY enabled and the north pole at the top edge of map, if you continue pressing the "up" key despite that all routes lead south (down), then your unit will ascend above Earth's north pole, enter a wormhole, and be magically transported to the southmost (bottom) of the map because of WrapY - it places the bottom of the map "above" (north of) the north pole despite that the entire surface of the planet is already displayed and all routes (every column and row of tiles) already lead south! To put it another way, every latitude line of the Earth map already exists on the map with WrapY disabled. WrapY creates additional routes that don't actually exist on Earth - as new lines of latitude.

With WrapY disabled, travel north from North America over the north pole, then south to Russia is already possible - the route is already on the map! WrapY adds another route which doesn't exist on Earth (and which is already depicted on the map!)

If WrapY is enabled, with north pole at the top edge of the map, and south pole placed at vertical center of the map, then WrapY makes more sense, or makes less non-sense. But even then, a unit moving only horizontally from the north pole will never actually leave the north pole despite that from the north pole, all routes lead south. It's cray-cray! :shock:

The bitmap file I mentioned is the Arctic sea ice image. I also found an Antarctic sea ice image yesterday.

For my map, I have completed separate image/data @ 512x256 for: absolute elevation @ 4 levels, ocean depth @ 2 levels, sea ice for both poles.

I am still assembling land cover data and have not finalized it yet due to dissatisfaction with various sets. I'm looking for the simplest set which easily translates to Freeciv tile types.
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:There is no invisible wall in Freeciv with WrapY disabled either - the entire surface of the planet is displayed in the map's columns and rows of tiles.
Yes of course there is. As long as you cannot move in some direction, there has to be some kind of obstacle preventing it.

Molo_Parko wrote: Every possible route is -already- displayed on the map. In Freeciv, if you travel up north to the center of the north pole (at the top edge of the map), then all land routes, every row and column of tiles lead south -- there is no route to continue north from the north pole with WrapY disabled (units can only move down, or left/right, but not North (up) from the top edge).
That's the point - there is a direction that becomes blocked.

Molo_Parko wrote: However with WrapY enabled and the north pole at the top edge of map, if you continue pressing the "up" key despite that all routes lead south (down), then your unit will ascend above Earth's north pole, enter a wormhole, and be magically transported to the southmost (bottom) of the map because of WrapY - it places the bottom of the map "above" (north of) the north pole despite that the entire surface of the planet is already displayed and all routes (every column and row of tiles) already lead south! To put it another way, every latitude line of the Earth map already exists on the map with WrapY disabled. WrapY creates additional routes that don't actually exist on Earth - as new lines of latitude.

With WrapY disabled, travel north from North America over the north pole, then south to Russia is already possible - the route is already on the map! WrapY adds another route which doesn't exist on Earth (and which is already depicted on the map!)
But as i already told, this is not what happens. If you generate a map with WrapY enabled, north pole will be round and far away from south pole.

Molo_Parko wrote: If WrapY is enabled, with north pole at the top edge of the map, and south pole placed at vertical center of the map, then WrapY makes more sense, or makes less non-sense. But even then, a unit moving only horizontally from the north pole will never actually leave the north pole despite that from the north pole, all routes lead south. It's cray-cray! :shock:
Again, with both poles being round, this will not happen. "Traditional" civ maps indeed don't allow leaving poles by going either east or west.
But with a pole not covering all width, at least you can reach the ocean.

Molo_Parko wrote: The bitmap file I mentioned is the Arctic sea ice image. I also found an Antarctic sea ice image yesterday.
An arctic sea image with only two possible pixel values ? Which is not a tiff file ? If so, i want to see the link (if it's one you gave before, i think i told you it wasn't that).
Molo_Parko
Hardened
Posts: 158
Joined: Fri Jul 02, 2021 4:00 pm

Re: maps with different projection ?

Post by Molo_Parko »

Image
^ Bitmap (2 color black and white) Image mask showing Arctic sea ice as white, black is not ice (change black to transparent for overlay.)

All 360 degrees of longitude are already displayed in a Freeciv world map without WrapY. What additional degrees of longitude does WrapY add beyond 360?
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: ^ Bitmap (2 color black and white) Image mask showing Arctic sea ice as white, black is not ice (change black to transparent for overlay.)
This is ok. I have to see how it goes on top of current map.

Molo_Parko wrote: All 360 degrees of longitude are already displayed in a Freeciv world map without WrapY. What additional degrees of longitude does WrapY add beyond 360?
There is nothing additionnal, what a strange question.
Post Reply