Issue rendering tiles in non Spherical Mercator projection
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- cpp
- Ambito
- backend, computer-graphics
Direzione di ricerca
Inizia dal calcolo del bounding box indicato in src/gen_tile.cpp, quindi confrontalo con le impostazioni di proiezione caricate da renderd.conf e mapnik-bng.xml. Riproduci la richiesta a /tile/0/0/0.png usando il dataset del Wales e analizza il metatile generato. Il lavoro è completato quando la richiesta BNG restituisce il tile contenente l’estensione dei dati senza compromettere il comportamento esistente del rendering dei tile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I'm attempting to generate a slippy map tiles in a specific projection system (EPSG:27700, British National Grid), for a specific subset of OSM data covering Wales, using this pbf file.
I am using the switch2osm stack, and am running their docker container on Ubuntu 20.04 just on localhost, following these instructions.
To attempt to generate tiles in EPSG:27700, I've made a minor edit to my mapnik xml stylesheet, specifying the epsg:27700 map projection string:
<Map srs="+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs" background-color="#f2efe9">
After editing this style sheet, I've checked that mapnik can generate a BNG tile and correctly transform the osm postgis source data (in EPSG:3857), this is the python snippet:
import mapnik
m = mapnik.Map(256,256)
mapnik.load_map(m, '/home/renderer/src/openstreetmap-carto/mapnik-bng.xml')
extent_uk_tile_s_bng = mapnik.Box2d(0, 0, 700000, 700000)
m.zoom_to_box(extent_uk_tile_s_bng)
mapnik.render_to_file(m, 'output.png')

The output draws a tile in EPSG:27700 and correctly displays my data (in EPSG:3857), so this tells me my mapnik stylesheet appears to be correctly configured.
This is my renderd.conf (only changing the XML path from the default shipped with switch2osm:
$ cat /usr/local/etc/renderd.conf
[renderd]
num_threads=4
tile_dir=/var/lib/mod_tile
stats_file=/var/run/renderd/renderd.stats
[mapnik]
plugins_dir=/usr/lib/mapnik/3.0/input
font_dir=/usr/share/fonts/truetype
font_dir_recurse=1
[ajt]
URI=/tile/
TILEDIR=/var/lib/mod_tile
XML=/home/renderer/src/openstreetmap-carto/mapnik-bng.xml
HOST=localhost
TILESIZE=256
MAXZOOM=20
The following log entries are generated from request http://localhost/tile/0/0/0.png.
renderd[2313]: Using bng projection settings
renderd[2313]: Using bng projection settings
renderd[2313]: Using bng projection settings
renderd[2313]: Using bng projection settings
renderd[2313]: DEBUG: Got incoming connection, fd 7, number 1
renderd[2313]: DEBUG: Got incoming request with protocol version 2
renderd[2313]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(0), x(0), y(0), mime(image/png), options()
renderd[2313]: DEBUG: START TILE ajt 0 0-0 0-0, new metatile
renderd[2313]: Rendering projected coordinates 0 0 0 -> 0.000000|0.000000 700000.000000|1400000.000000 to a 1 x 2 tile
renderd[2313]: DEBUG: DONE TILE ajt 0 0-0 0-0 in 1.705 seconds
debug: Creating and writing a metatile to /var/lib/mod_tile/ajt/0/0/0/0/0/0.meta
renderd[2313]: DEBUG: Sending render cmd(3 ajt 0/0/0) with protocol version 2 to fd 7
renderd[2313]: DEBUG: Connection 0, fd 7 closed, now 0 left
The log entry Rendering projected coordinates 0 0 0 -> 0.000000|0.000000 700000.000000|1400000.000000 to a 1 x 2 tile.
Since the bounding box is not a square, which would explain why mod_tile is rendering two tiles instead the single tile. I can see that gen_tile.cpp is responsible for setting this non-square bounding box on this line https://github.com/openstreetmap/mod_tile/blob/f28cda992077c38684628cd764742223ab10a3ec/src/gen_tile.cpp#L148
My problem.
When requesting http://localhost/tile/0/0/0.png this only delivers the "northernmost" of the two tiles ie bbox(0 700000,700000 14000000). However, my actual data extent (Wales) is located in the southernmost of the two tiles within bbox(0 0, 700000 700000).

Forgive me, I'm new to map tiling, with webmercator, the bbox is a square, ie x axis and y axis are equal, but the BNG extent is not a square, therefore, two queries:
-
Is there anything in the configuration somewhere that I can change to deliver a 1x1 tile when http://localhost/tile/0/0/0.png is made?
-
If there's no configuration option, would editing the gen_tile.cpp source be enough to deliver a square tile, see below example. Or am I missing something?
prj->bound_x0 = 0;
prj->bound_y0 = 0;
prj->bound_x1 = 1400000;
prj->bound_y1 = 1400000;
prj->aspect_x = 1;
prj->aspect_y = 1;
Thanks for any tips on where to go next.
- Lingua principale
- C++
- Stelle
- 318
- Fork
- 200
- Merge medio
- 2g 22h
- PR unite (30g)
- 22
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openstreetmap/mod_tile
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
openstreetmap/mod_tile#292 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
openstreetmap/mod_tile#477 · 7 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
openstreetmap/mod_tile#466 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
openstreetmap/mod_tile#462 · 7 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
openstreetmap/mod_tile#447 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di openstreetmap/mod_tile
Issue simili
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusForse già presa @leizhiyuan l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/rocketmq-clients#1465 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
KhronosGroup/Vulkan-Tutorial#534 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 2 giorni
-
bug IO
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MrNeRF/LichtFeld-Studio#3824 ·
I maintainer di solito rispondono entro 1 giorno
-
pnnx: manual tanh GELU fusion loses the approximation modeForse già presa @ktz03 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Tencent/ncnn#7175 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno