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

T-Rex version for higher zoom levels (up to 42)? #316

Open
damiendevienne opened this issue Apr 3, 2024 · 10 comments
Open

T-Rex version for higher zoom levels (up to 42)? #316

damiendevienne opened this issue Apr 3, 2024 · 10 comments

Comments

@damiendevienne
Copy link

Hello,

First, thanks for the great tool.
For updating our visualization tool from raster tiles to vector tiles (with T-rex), we need to be able to go to zoom levels up to 42.
This implies quite a lot of changes in the code, including some variables that must be changed from u32 to u64, which does not go smoothly until now.
Before going further, we wondered whether such a "deepzoom" versions of T-Rex had been (by chance) developed already? If not, would it be a useful feature for next versions of T-Rex?

All the best,

@pka
Copy link
Member

pka commented Apr 3, 2024

Hi Damien,
Please have a look at https://github.com/bbox-services/bbox/tree/main/bbox-tile-server the successor of T-Rex. BBOX uses Xyz of https://github.com/pka/tile-grid/blob/main/src/tile.rs#L44 which is already using u64 for x/y. So maybe your use case is already covered?

@damiendevienne
Copy link
Author

Oh great, we'll give it a look. Thanks!

@simonpenel
Copy link

Hi, thanks a lot for your help!
I planned to use bbox with the previous t-rex configuration file. I am using a user defined grid:

 [grid.user]
width = 256
height = 256
extent = { minx = -20037508.3427892480, miny = -20037508.3427892480, maxx = 20037508.3427892480, maxy = 20037508.3427892480 }
srid = 3857
units = "m"

However I got

Error during initialization: 3857.json: No such file or directory (os error 2)

I was wondering what should be the contents of the 3857.json file?

If I remove the line srid = 3857 the following error is returned

Error during initialization: bbox-tile-server/config_lifemap.bbox - missing field `srid`
in `grid.user`

Best, thanks again

Simon

@pka
Copy link
Member

pka commented Apr 5, 2024

Hi Simon,

I've added a guide for creating OGC conformant custom grid spec files and referenced it in the t-rex migration guide.

For your case here's the output of
morecantile custom --epsg 3857 --extent -20037508.3427892480 -20037508.3427892480 20037508.3427892480 20037508.3427892480 --name "CustomWebMercator" --title "Web Mercator with custom extent" | jq . >CustomWebMercator.json

CustomWebMercator.json

Use this instead of 3857.json and reference it with tms="CustomWebMercator".

@simonpenel
Copy link

Thanks for your help Pirmin,

sorry I didn't understand which value should take the "srid" parameter then?

I though I should use CustomWebMercator instead 3857

[[datasource]]
dbconn = "postgresql://lm:gvC5b78Ch9nDePjF@localhost/tree"
name = "dbconn"
default = true

#[grid]
#predefined = "web_mercator"

[grid.user]
width = 256
height = 256
extent = { minx = -20037508.3427892480, miny = -20037508.3427892480, maxx = 20037508.3427892480, maxy = 20037508.3427892480 }
#srid = 3857
srid = "CustomWebMercator"
tms = "CustomWebMercator"
units = "m"
...

but I got

Error during initialization: bbox-tile-server/config_lifemap.bbox - invalid type: string "CustomWebMercator", expected i32
in `grid.user.srid`

PS I copied the CustomWebMercator.json in the assets directory, this is correct?

Sorry again to bother you
Best,
Simon

@simonpenel
Copy link

OK,
I get it
I use

[grid]
json = "../assets/CustomWebMercator.json"
tms = "CustomWebMercator"

thanks again
Simon

@pka
Copy link
Member

pka commented Apr 8, 2024

In BBOX, the tms name is part of the tileset configuration, so you can have tilesets with differenct tile grids:

[[grid]]
json = "../assets/CustomWebMercator.json"
[[tileset]]
name = "my tileset"
tms = "CustomWebMercator"

This is not directly translatable from a t-rex configuration file. You have to create a bbox configuration file from the converted t-rex configuraton output and apply the changes above.

@pka
Copy link
Member

pka commented Apr 8, 2024

Since you're mentioning zoom level 42, here's the command for creating a grid with max level 42:

morecantile custom --epsg 3857 --maxzoom 42 --extent -20037508.3427892480 -20037508.3427892480 20037508.3427892480 20037508.3427892480 --name "CustomWebMercator" --title "Web Mercator with custom extent" | jq . >CustomWebMercator.json

CustomWebMercator.json

@damiendevienne
Copy link
Author

Hi Pirmin,
First, thanks a lot for your help. And sorry for this long message. We tried with @simonpenel to prepare a small example showing the bug we are facing when zooming in the map, and for which we are struggling finding a solution. If it is obvious for you what happens an how to solve it, it would be great !

The symptom : if you zoom in the simple map (only black) we prepared at this url: http://134.214.213.45/assets/html/index_test42.html, you will see that starting from zoom 27, some tiles do not display correctly, creating some kind of irregular checkerboard
image

The reproducible example: To make the problem very simple and easily reproducible we decided that the map only displays one tile (always the same, named 1.pbf).
The server configuration file was this one this one :

[[datasource]]
#will not be used 
name = "gebco"
[datasource.wms_proxy]
baseurl = "https://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv?version=1.3.0"
format = "image/jpeg"


[[assets.static]]
dir = "./assets"
path = "/assets"

[[tilestore]]
name = "tilecache"    
[tilestore.files]
#base_dir = "../tiles"
base_dir = "/tmp/mvtbench"

[[tilestore]]
name = "mbtilecache"
[tilestore.mbtiles]
path = "/tmp/tilecache.mbtiles"

[[tilestore]]
name = "pmtilecache"
[tilestore.pmtiles]
path = "/tmp/tilecache.pmtiles"

[[tileset]]
name = "gebco"
wms_proxy = { source = "gebco", layers = "gebco_latest" }

and the configuration json files used are available here:
mystyle_test42.json
lines_test42.json

Do you have any idea where the problem could come from?

All the best, and thanks again for your time,

Damien

@pka
Copy link
Member

pka commented Apr 22, 2024

Back from holidays. Will try to reproduce this problem with bbox test data and the custom Mercator TMS.

Could you open an issue in the bbox Repo?

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

3 participants