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

Out of bounds tile coordinates produced #2142

Closed
pnorman opened this issue Mar 4, 2024 · 3 comments
Closed

Out of bounds tile coordinates produced #2142

pnorman opened this issue Mar 4, 2024 · 3 comments
Labels

Comments

@pnorman
Copy link
Collaborator

pnorman commented Mar 4, 2024

What version of osm2pgsql are you using?

2024-03-04 18:37:49 osm2pgsql version 1.11.0 (1.11.0)
Build: RelWithDebInfo
Compiled using the following library versions:
Libosmium 2.20.0
Proj [API 6] 9.1.1
Lua 5.3.6

What did you do exactly?

When running my update script I got an error with a tile coordinate not between 0 and 2^z-1.

#!/bin/bash
set -e
while :
do
date
SEQUENCE=$(osm2pgsql-replication status -d flex --json | jq '.local.sequence')
LUA_PATH="$HOME/osm2pgsql-themepark/lua/?.lua;;" osm2pgsql-replication update -d flex --once -- --expire-tiles=10-14 -o "expire_files/$SEQUENCE.txt"
cat  "expire_files/$SEQUENCE.txt" | tilekiln/bin/tilekiln generate tiles --source-dbname flex --storage-dbname tiles --config shortbread.yaml -n1
sleep 60
done

Upon inspection, SEQUENCE=5986020 and the last lines of the file are

14/701/16384
13/350/8192
12/175/4096
11/87/2048
10/43/1024

These appear to be the only tiles out of bounds.

The in-DB metadata is

flex=# select * from osm2pgsql_properties ;
          property           |                        value
-----------------------------+-----------------------------------------------------
 attributes                  | false
 db_format                   | 2
 flat_node_file              | /home/pnorman/spirit/nodes.bin
 import_timestamp            | 2024-02-12T01:00:00Z
 output                      | flex
 prefix                      | planet_osm
 style                       | /home/pnorman/spirit/shortbread.lua
 updatable                   | true
 version                     | 1.11.0
 current_timestamp           | 2024-03-02T01:01:57Z
 replication_base_url        | https://planet.openstreetmap.org/replication/minute
 replication_sequence_number | 5986023
 replication_timestamp       | 2024-03-02T01:01:57Z
(13 rows)

This means that the diff that causes the problem is > 5986020 and <= 5986023. I have not yet inspected the diffs.

@joto
Copy link
Collaborator

joto commented Mar 6, 2024

Seems to be a really old off-by-one error. @pnorman Can you check the PR fixes this for you?

@pnorman
Copy link
Collaborator Author

pnorman commented Mar 6, 2024

I've put it on my server but had to advance past this diff, so I'll see if it comes up again. It has happened more than once, but less often than once a day.

@lonvia
Copy link
Collaborator

lonvia commented Mar 23, 2024

Fixed in #2143.

@lonvia lonvia closed this as completed Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants