Comments (13)
I think this nginx block should take care of it, but I need a bit more testing:
location /.../ {
alias ...;
try_files $uri $uri/ @empty;
}
location @empty {
default_type text/plain; # TODO
return 200 "''";
}
from planetiler.
I'm not sure how browsers, proxies, CloudFlare, etc. handle 204 requests.
I'd like to replicate the behaviour of the reference implementation
The reference implementation + https://github.com/consbio/mbtileserver returns 200 with content-type: application/x-protobuf
(tested on /14/0/16284.pbf and /14/0/16247.pbf)
from planetiler.
It's interesting that these number are more or less consistent between a run today and one done 2 months ago.
sqlite> select count(*) from tiles_shallow where zoom_level = 1;
4
sqlite> select count(*) from tiles_shallow where zoom_level = 2;
16
sqlite> select count(*) from tiles_shallow where zoom_level = 3;
64
sqlite> select count(*) from tiles_shallow where zoom_level = 4;
256
sqlite> select count(*) from tiles_shallow where zoom_level = 5;
1024
sqlite> select count(*) from tiles_shallow where zoom_level = 6;
4096
sqlite> select count(*) from tiles_shallow where zoom_level = 7;
13986
sqlite> select count(*) from tiles_shallow where zoom_level = 8;
55100
sqlite> select count(*) from tiles_shallow where zoom_level = 9;
217779
sqlite> select count(*) from tiles_shallow where zoom_level = 10;
853600
from planetiler.
In the openmaptiles profile, "land" is indicated by absence of any data, and planetiler doesn't empty tiles so the counts dropping starting at z7 are from entire tiles being excluded from the output (probably starting in antarctica).
Also FYI you should upgrade to java 21 - newer versions of planetiler won't work with java 17 anymore.
from planetiler.
So with a decent client lib it should just work correctly, right? Thanks for the java 21 hint, I didn't see the update 2 month ago.
from planetiler.
In the openmaptiles profile, "land" is indicated by absence of any data
Land and the absence of data would be a zero-byte tile, not the absence of a tile.
from planetiler.
Right, the translation from "no data" to zero-byte tile needs to happen at some point in the stack. A tile server like tileserver-gl will return a 204 response when the tile is missing from the underlying data source. The pmtiles javascript client passes an empty byte array to maplibre when the tile is missing from the index, and maplibre-gl handles a 404 as no data.
from planetiler.
Do you mean what's missing is a zero byte file? I'll be serving this directly, from the filesystem, without any tile server.
So basically I need to make sure that all 404s are returned as an empty string and 200?
from planetiler.
What client are you be using?
from planetiler.
I want to make it compatible with every client which works with the reference implementation (for example Mapbox GL JS 1.x, etc.). So I need to do this server side.
from planetiler.
Would return 204;
work?
from planetiler.
Do you mean what's missing is a zero byte file? I'll be serving this directly, from the filesystem, without any tile server. So basically I need to make sure that all 404s are returned as an empty string and 200?
Directly from the filesystem? If so, then you actually need the 0 byte files. If you're serving it not directly, but with a HTTP server between the tiles and the client, then you could transform missing files into zero byte 2xx responses. You'll just have to be careful about distinguishing between tiles that are missing because they're really 0-byte tiles, tiles that are missing because they're invalid (e.g. 0/1/2 or 0/1/-1), URLs that aren't tiles at all, and tiles outside your zoom range and bounding box.
returns 200 with
content-type: application/x-protobuf
As per the specification, the MIME type SHOULD be application/vnd.mapbox-vector-tile
from planetiler.
Yes, I meant that nginx will be serving them directly from the filesystem, without any tile server running. Thank you for the explanation, I understand it now and will update the MIME type.
from planetiler.
Related Issues (20)
- [FEATURE] Log problematic geometry causing JTS exceptions HOT 22
- [FEATURE] Min polygon area for including center point
- [FEATURE] Expose OSM entity metadata in the process feature context HOT 2
- [FEATURE] Lua profile followups
- [BUG] US admin level 4 boundary lines appear incomplete HOT 3
- Tilejson attributes missing attributes added or removed during post-processing
- [FEATURE] Log planet version being used HOT 2
- [BUG] Charging stations won't be exported HOT 4
- [FEATURE] Add arbitrary extra metadata using the Profile interface
- [BUG] GeoPackageReader with EPSG:3067 results in swapped lat & lng
- [BUG] IOException/GOAWAY happening in parseResults()
- [FEATURE] Speed-up Planetiler by skipping OSM reads when generating only layers which do not need OSM data HOT 2
- Derive progress % from logs
- [FEATURE] Clarify documentation on CLI function arguments HOT 2
- Use google/cel-java ?
- [FEATURE] OSM multiline relation handling HOT 9
- [FEATURE] Please clarify what triggers "match_key" in YAML configurations
- [FEATURE] Expose OSM feature type HOT 1
- [FEATURE] Line-to-point geometry transformations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from planetiler.