Is there really this much water here.????????

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #21by cartrite » 17.06.2006, 19:09

Antartica is cured!!!!!!!
I'm not sure what did it. I compiled 2 changes.

Code: Select all

return (short) (((int) c[0] << 8) | (int) c[1]);


Code: Select all

if (a == 0 || (y > 0.83252f * height && a <= 30))


All my efforts are going to extracting lakes and rivers now.

EDIT: This is the one that did it,

Code: Select all

return (short) (((int) c[0] << 8) | (int) c[1]);


cartrite
Last edited by cartrite on 26.06.2006, 11:48, edited 1 time in total.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #22by cartrite » 25.06.2006, 05:39

This SRTM map is @#$%. to work with. So I decided to give up and cheat. This is all I can come up with. The inland waters are from the landcover files from the old Blue Marble.

Image

This shows that the old file is not aligned so ..... I'm gonna have to live with it.

Image

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #23by t00fri » 25.06.2006, 14:44

cartrite wrote:This SRTM map is @#$%. to work with. So I decided to give up and cheat. This is all I can come up with. The inland waters are from the landcover files from the old Blue Marble.
...
cartrite

I'have done that already since a while. I have combined the ocean boundaries (elevation=0) from BMNG with the 16bit raw 64k watermask from BMNG-arctic server.

So what exactly did you do while cheating? ;-)

How did you merge the new BMNG ocean boundary (elevation=0) with the inland waters from the old BM?
Why did you take the OLD BM data??

Anyhow, it's very easy...

Bye Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #24by cartrite » 26.06.2006, 02:56

I used the inland waters from the old lancover files because I thought they were a closer match.

Anyhow first I converted them to bmps with IM Windows version. For some reason I could not do the following steps with the linux version of IM because they came out completely black. I opened the bmp with the gimp, changed it to rgb, did a filters -> colors -> value invert. Then did a brightness -127 & contrast +127. Then select by color threshold 1 from mid ocean. bucket filled white. Inverted the selection then bucket filled black.

Then I took the file created by my tool and selected by color the oceans. Then I grew the selection by 6 pixels and bucketfilled black. I copied and pasted onto the landcover file. All that was left was inland waters. Everything else was black. I was then able to select the inland waters and paste them onto the file created by my tool without affecting the coastlines.

The reason I said I cheated is because I tried in vain to extract inland waters from the SRTM map. And there is No way to do it. Not for me anyway. The lakes are not a "single flat value".Some rivers are extracted but there is a lot of white noise always there like the Pics I posted above a couple of days ago.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #25by cartrite » 26.06.2006, 11:42

I'm trying a different method. I created a tool that crops the SRTM map into 16 bit signed integer 86400x5400 slices. Then I use IM to further crop them into 5400x5400. This is because of memory issues with 3dem. I can load these files into 3dem and modify the color scale by increasing the sea level and the rivers that flow into the ocean get traced out . I can also modify the colors per height range to trace out lakes. Mabey this may work. Of course rivers with high elevations would require too much work. I'd probally be better off using the 12,000 tiles from the SRTM water body set.:wink: Just kidding.

Are there any other programs out there that can modify dems to trace out rivers and lakes :?: I tried Wilbur.exe. Wilbur can't do it. At least I don't know how to get Wilbur to do it. I tried to create a drainage map. But no go.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #26by t00fri » 26.06.2006, 12:00

cartrite wrote:I used the inland waters from the old lancover files
because I thought they were a closer match.


Anyhow first I converted them to bmps with IM Windows version. For
some reason I could not do the following steps with the linux version
of IM because they came out completely black. I opened the bmp with
the gimp, changed it to rgb, did a filters -> colors -> value invert.
Then did a brightness -127 & contrast +127. Then select by color
threshold 1 from mid ocean. bucket filled white. Inverted the selection
then bucket filled black.

Then I took the file created by my tool and selected by color the
oceans. Then I grew the selection by 6 pixels and bucketfilled black. I
copied and pasted onto the landcover file. All that was left was inland
waters. Everything else was black. I was then able to select the inland
waters and paste them onto the file created by my tool without
affecting the coastlines.

The reason I said I cheated is because I tried in vain to extract inland
waters from the SRTM map. And there is No way to do it. Not for me
anyway. The lakes are not a "single flat value".Some rivers are
extracted but there is a lot of white noise always there like the Pics I
posted above a couple of days ago.

cartrite


Cartrite,

that procedure of yours is faaaar too complicated! All you got to do to
appropriately combine the new custom map [with the smooth oceanic
boundaries obtained from the elevation=0 request] and the latest 84k
BMNG watermask is this:


First one realizes that the awkward effects are mainly due to the white
reflective boundaries being /smaller/ than the true water/land border
such that one can see a few pixels of the dark blue water without any
reflections! If the white part of the spec map is rather a couple of
pixels larger than the oceans here and there, this is not so bad.


So here is the extremely simple rule: just logically OR the pixels of the
two black&white maps. In more detail: let white=w, black=b

Code: Select all

w|w = w
w|b = w
b|b = b

++++++++++++++++++++++++++
In simple words, this means if both maps want an area black
(unreflective) make it black. If either both maps or already one of the
two wants it reflective make it white! This way, in case of "doubt" =
"disagreement among the two maps", we go for reflective rather than
unreflective.
++++++++++++++++++++++++++

You may either hack some simple code where you read in row by row
from these two files and OR them, or you use GIMP in ADD mode,
loading the second map as a layer, connecting the two with
ADD. Since at the 8bit b/w level

Code: Select all

w +  w  => w
w +  b  => w
b +  b  => b

In case of GIMP, you need lots of RAM like I have (3GB) to manipulate
both these fullsize layers.

Just make yourself a little drawing of the (imperfectly) overlapping two
textures and realize what the logical OR means.

Either way is quick and utterly simple. In my case the 64k result looks
pretty good. Certainly WAY better than the original 64k watermap.

Bye Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #27by cartrite » 26.06.2006, 14:24

I tend to agree that when using the 84k watermask that your simple approach works fine. This is because the coastline from the water mask is masked out by the elevation = 0 map in most areas. But the landcover-x-21600x216000.gz maps are a closer match and the coastlines are not masked out with addition method.

To preserve the coastline data from the elevation = 0 map the landcover coastline data must be discarded.


These steps are to create a spec map from the landcover files. I just want inland water data. No coastline data.
Anyhow first I converted them to bmps with IM Windows version. For
some reason I could not do the following steps with the linux version
of IM because they came out completely black. I opened the bmp with
the gimp, changed it to rgb, did a filters -> colors -> value invert.
Then did a brightness -127 & contrast +127. Then select by color
threshold 1 from mid ocean. bucket filled white. Inverted the selection
then bucket filled black.

This is all I did to combine the 2 files. This is discarding the coastline data from the lancover spec maps.
Then I took the file created by my tool and selected by color the
oceans. Then I grew the selection by 6 pixels and bucketfilled black. I
copied and pasted onto the landcover file. All that was left was inland
waters. Everything else was black. I was then able to select the inland
waters and paste them onto the file created by my tool without
affecting the coastlines.


I am using the landcover files because they are more accurate then the 84k watermask as far as rivers are concerned. But I was using the png watermasks as a comparison. Mabey the raw file is more accurate? I thought they were basicly the same.

I still must shift the inland water data to the west by a pixel or 2 to properly fine align.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #28by cartrite » 26.06.2006, 14:50

I wrote
I'm trying a different method. I created a tool that crops the SRTM map into 16 bit signed integer 86400x5400 slices. Then I use IM to further crop them into 5400x5400. This is because of memory issues with 3dem. I can load these files into 3dem and modify the color scale by increasing the sea level and the rivers that flow into the ocean get traced out . I can also modify the colors per height range to trace out lakes.


This addition method may be what I was looking for to isolate the river data from the 3dem images. At first I created 20 bmp files from 3dem that had an increasing sealevel by 5 meters. In file 20 the Susquehanna river was traced back as far as the Harrisburg Pa area. The Delaware river as far as the WaterGap area. But the coastlines are flooded. I need a way to extract the latest river data per sealevel rise and combine so only the rivers are flooded. And the land is left dry.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #29by cartrite » 26.06.2006, 19:25

It looks like I can use the magic wand from the gimp to select the rivers and lakes from heightmaps like this one. It's going to be a lot of work though.

Image

I can't even open the 2k one so here is a scaled down pic.
Image
cartrite
Last edited by cartrite on 26.06.2006, 20:06, edited 1 time in total.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #30by t00fri » 26.06.2006, 19:43

cartrite wrote:It looks like I can use the magic wand
from the gimp to select the rivers and lakes from
heightmaps like this one. It's going to be a lot of work
though.

...
Cartrite,


it may always happen that you forget to select (at
least) one river, hence it's NOT a scientifically valid
method. But of course, if you don't care about this, it's
a way to keep you busy for weeks ;-) on a 84k
texture...It may be a good idea to estimate beforehand
(on the back of an envelope) the number of rivers on
our planet. ;-)

Bye Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #31by cartrite » 26.06.2006, 19:58

Of course your right and I'll probally never do the whole map. But I can enhance(add to the exsisting map) some areas of interest. Like the Delaware and Susquehanna rivers which can clearly be traced back into NY state.

Another reason I am cropping the SRTM map is to use the height maps as source files for 3d models with Blender..

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #32by t00fri » 26.06.2006, 20:07

cartrite wrote:Of course your right and I'll probally never do the whole map. But I can enhance(add to the exsisting map) some areas of interest. Like the Delaware and Susquehanna rivers which can clearly be traced back into NY state.


As long as you do this work for your own pleasure/ satisfaction, these areas are what you are probably most interested in. However, that German or French user would surely find another set of rivers more interesting...

I know, I know ;-)

Cheers,
Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #33by cartrite » 26.06.2006, 20:19

Do I hear a request list coming :wink: . Still, there must be a way of doing this for all rivers and lakes. From what I read there were other files involved to cross reference real water from low flat areas or roads, bridges, etc. I read that some of the larger lakes had barges and other large boats that had to be screened(removed). It's gets pretty complicated.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #34by t00fri » 26.06.2006, 20:26

cartrite wrote:Do I hear a request list coming :wink: .
...
cartrite


Sorry, not from my side...

Cheers,
Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #35by cartrite » 04.07.2006, 04:34

After drying out I decided to give this another try. I am using the SRTM3 files which are level 2 and 90 meter resolution. These files only cover 60N to 56 south which is most of the earths surface. Some thumbs.

Image

Image

Image

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #36by t00fri » 04.07.2006, 07:20

cartrite wrote:After drying out I decided to give this another try. I am using the SRTM3 files which are level 2 and 90 meter resolution. These files only cover 60N to 56 south which is most of the earths surface. Some thumbs.
...
cartrite


But WHAT exactly did you do?? You said that you gave "this" (??) another try...

Bye Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #37by cartrite » 04.07.2006, 13:19

Currently I used 3dem to load multible files, saved them as a dem, then I loaded multible dems and saved them as a 2 byte signed int binary to use as input to the program.
I use the 8 closest neighbors to compare the current pixel too. I am still expierimenting though. I believe the version that produced the latest thumbs uses this:

Code: Select all

For
A B C
D P E
F G H

Code: Select all

checks P || P+1 || P-1 == A && P || P-1 == H
checks P || P+1 || P-1 == B && P || P-1 == G
checks P || P+1 || P-1 == C && P || P-1 == F
if any are true add to a counter K++ if counter > x P = 0xff
where x = (1,2,3,4) The higher the number the less detail.
checks P || P+1 || P-1 == A && P || P+1 == H
checks P || P+1 || P-1 == B && P || P+1 == G
checks P || P+1 || P-1 == C && P || P+1 == F
if any are true add to a counter K++ if counter > x P = 0xff
where x = (1,2,3,4) The higher the number the less detail.
If no conditions are met reset counter and P = 0x00


The resulting file is then passed thru a custom filter to eliminate single pixels that are black or white.

Of course there has to be code to work with a directory of multible files. There are seperate directories for the different continents and one for islands.

I have not done that yet.

Also the files only cover 60N to 56S landmasses so all the missing oceans would have to be filled in. There is also missing data in the landmasses which would have to be filled in. So at some point the 90 meter data would have to be scaled down to 500 meter data so the 84k SRTM file can be used to fill voids..

I have used different check routines but they all have similar results. I have been comparing my output files to WorldWind files of similar areas.
++++++++++++++++++++++++++++++++++++++++++++++++++++
But I SHOULD check to see if all this lines up with the 500 meter BMNG files. Still haven't done that either.
++++++++++++++++++++++++++++++++++++++++++++++++++++
A work in progress 8O

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #38by t00fri » 04.07.2006, 17:46

cartrite wrote:.....
I use the 8 closest neighbors to compare the current pixel too. I am still expierimenting though.
...

cartrite

Ah, does that sound quite similar to what I proposed some time ago?

t00fri wrote:Let me start with an arbitrary pixel in the elevation
map and examine all 8 nearst neighbor pixels around
the reference pixel.
Then a reliable criterion is to
proceed towards that pixel (or those pixels) where the
gray value difference

|p - p'|

is MINIMAL! Rivers flow in
beds and the elevation increase is naturally much
higher orthogonal to the flowing direction than along it.
That allows to trace out the rivers independent of its
absolute elevation!


Good if it seems to work...

Cheers,
Bye Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #39by cartrite » 05.07.2006, 03:52

Yes, this is the way to go. Thanks for the advice. I wish it worked with the 84k file. But that file does not have flat lakes. Or rivers that ascend or descend by 1. The 90 meter files do. So does the 30 meter files. But they are only of the US.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4


Return to “Celestia Users”