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

TilesXYZ ignores selected layer CRS #43904

Closed
frafra opened this issue Jun 24, 2021 · 8 comments
Closed

TilesXYZ ignores selected layer CRS #43904

frafra opened this issue Jun 24, 2021 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@frafra
Copy link

frafra commented Jun 24, 2021

I have two layers: a vector layer (EPSG:25833) and a OpenStreetMap silly map raster tile (EPSG:3857). QGIS project CRS is set to match the raster tile (EPSG:3857).

When I run "Generate XYZ tiles (MBTiles)" from the graphical user interface, I can select the map canvas extent to generate the tiles, which works as expected, or the vector tile, which produces tiles in the wrong position.

I see the extent as xmin,xmax,ymin,ymax [EPSG:3857] if I use the map canvas extent, while I see the extent as xmin,xmax,ymin,ymax [EPSG:3857] if I select the vector layer. CRSs are then correctly specified, but TilesXYZ does not convert the coordinates into the project coordinates, producing incorrect results sometimes.

Setting the project CRS to match the vector layer CRS works.

@frafra frafra added the Won't fix By design, or won't be fixed for some other reason label Jun 24, 2021
@gioman gioman added Processing Relating to QGIS Processing framework or individual Processing algorithms Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers and removed Won't fix By design, or won't be fixed for some other reason labels Jun 24, 2021
@gioman
Copy link
Contributor

gioman commented Jun 24, 2021

a vector layer (EPSG:25833)

@frafra can you attach it?

@frafra
Copy link
Author

frafra commented Jun 24, 2021

@gioman I am sorry, it contains sensible information I cannot share. It contains some areas near Oslo, Norway, but when I generate the tiles it produces images located in northern France.

I have the same problem when I use Python and I use a simple layer.extent() as extent instead of QgsReferencedRectangle(layer.extent(), layer.crs()). It looks like TilesXYZ just reads the bbox coordinates from the vector layer without considering its CRS.

@gioman
Copy link
Contributor

gioman commented Jun 24, 2021

I am sorry, it contains sensible information I cannot share.

@frafra it is just needed a rectangle with the bbox of your layer.

@frafra
Copy link
Author

frafra commented Jun 24, 2021

@frafra it is just needed a rectangle with the bbox of your layer.

Sure, that should work as well :)

195250.0000,292500.0000,6550500.0000,6654750.0000 [EPSG:25833]

@gioman
Copy link
Contributor

gioman commented Jun 24, 2021

@frafra what QGIS version are you using? and on what operating system?

@frafra
Copy link
Author

frafra commented Jun 24, 2021

@gioman 3.16.4-Hannover, revision 654e76b, Windows 10.

@gioman
Copy link
Contributor

gioman commented Jun 24, 2021

I think the problem is that mbtiles are (by design) always generated in 3857, and the tool do not reprojects the chosen extent if this is not in 3857 and the project is (because if the project and extent are both the same and not in 3857 it seems to work ok).

@gioman gioman removed the Feedback Waiting on the submitter for answers label Jun 24, 2021
@alexbruy
Copy link
Contributor

alexbruy commented Oct 5, 2023

I'd say this is a won't fix, as MBTiles is always in EPSG:3857.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

3 participants