Closed arashgh-gh closed 4 years ago
I have the same problem and I'm trying to understand what is going on. While reading the source code I noticed this line which confuses me:
https://github.com/t-rex-tileserver/t-rex/blob/master/t-rex-service/src/mvt_service.rs#L293
Doesn't this mean that the Y always gets flipped, regardless of the origin?
@stvno
Thanks for your reply. I don't know, if I understood the code correctly but I think something misses at the function pub fn generate()
because prior to this in the function pub fn tile_cached()
which fetches or creates the tile, the srid of the grid is controlled:
https://github.com/t-rex-tileserver/t-rex/blob/c2e9202212115d9cb71331f02df2edda3cb6cbbf/t-rex-service/src/mvt_service.rs#L134
and then it puts the path like this in line 139 by using:
let path = format!("{}/{}/{}/{}.pbf", tileset, zoom, xtile, ytile);
but in generate
the path is defined like this:
let y = self.grid.ytile_from_xyz(ytile, zoom);
let path = format!("{}/{}/{}/{}.pbf", &tileset.name, zoom, xtile, y);
I think you are right and it reverses the Y always by generating caches!
This is a bug, indeed. Live tiles have an XYZ scheme for Mercator grids and a TMS scheme for other grids. But tiles are always cached in XYZ scheme.
@pka
Thanks for your feedback. Another thing that I noticed is that if I open the seeded .pbf data in QGIS, they are in "EPSG:3857" but if I download the same .pbf from browser then it is in "EPSG:25832". Is it also related to this bug? Is the final transformation of user grid done in the map application?
Fixed in e18c8b6
@arashgh-gh: I don't see any relation with your last observation. Could you please open a new issue and describe how you open a .pbf with QGIS?
Hello,
I use OpenLayers to visualize my vector tiles in "EPSG:25832" just the way as the provided example.
Here is my user grid in config.toml:
The generated cache files on the fly, which are produced by moving around in the map, works fine. But if I use
t_rex generate --config config.toml
, the tiles will be shown messy and in wrong positions in OpenLayers. I figured out if I change the origin fromTopLeft
toBottomLeft
, the generated tiles byt_rex generate
command would be visualized perfectly by OpenLayers. Afterwards I removed the cache files and tried withorigin="BottomLeft"
to produce the cache files on the fly, this time the tiles are in wrong positions. It means, I have to change betweenorigin="TopLeft"
for live caching via OpenLayers andorigin="BottomLeft"
fort_rex generate
.Any idea or explanation for this problem? Many thanks.