Code Monkey home page Code Monkey logo

Comments (10)

pka avatar pka commented on May 28, 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?

from t-rex.

damiendevienne avatar damiendevienne commented on May 28, 2024

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

from t-rex.

simonpenel avatar simonpenel commented on May 28, 2024

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

from t-rex.

pka avatar pka commented on May 28, 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".

from t-rex.

simonpenel avatar simonpenel commented on May 28, 2024

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

from t-rex.

simonpenel avatar simonpenel commented on May 28, 2024

OK,
I get it
I use

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

thanks again
Simon

from t-rex.

pka avatar pka commented on May 28, 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.

from t-rex.

pka avatar pka commented on May 28, 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

from t-rex.

damiendevienne avatar damiendevienne commented on May 28, 2024

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

from t-rex.

pka avatar pka commented on May 28, 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?

from t-rex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.