Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIN_VALID_M 0, or -1500 #59

Open
tyrauber opened this issue Aug 24, 2023 · 3 comments
Open

MIN_VALID_M 0, or -1500 #59

tyrauber opened this issue Aug 24, 2023 · 3 comments

Comments

@tyrauber
Copy link

Instead of processing the terrain tiles to remove the oceans, wouldn't it make more since to handle that zeroing out of the ocean in software? Couldn't we just set height-tile MIN_VALID_M to 0, or -1500 (to account for the Dead Sea), and zero out any height less than the MIN_VALID_M?

const MIN_VALID_M = -12000;

Additionally, the values could be passed as options, so that this library could work on other planets. 😂

@tyrauber
Copy link
Author

Ok. Meters not feet. Also, setting the MIN_VALID_M is not enough. You need to use that value here:

this.height = height;

For example:

 this.height =  defaultIsValid(height) ? height : 0;

Which, with 500 to account for the Dead Sea, produces the following behavior:

cat-z9 25
cat-z10
cat-z11

@msbarry
Copy link
Contributor

msbarry commented Aug 25, 2023

That would work! Want to make a PR?

@tyrauber
Copy link
Author

Actually! @msbarry, the library already supports this through filters. At least for contours!

filter: [">", ["get", "ele"], 0],.

Here is ele filter at 2200 ft.
contours

Unfortunately, this same approach doesn't work for hillshade type (ele filtered at 2200 as well in the above image). It looks like the maplibre hillshade code doesn't accommodate filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants