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

With mvt_postgis data provider tegola returns mvt file with size 0 byte if the tile have no data #788

Open
F-15023 opened this issue Jul 5, 2021 · 5 comments

Comments

@F-15023
Copy link

F-15023 commented Jul 5, 2021

Hello, I have encountered with a problem.
If the tile have no data inside of its BBOX tegola with postgis data provider will returns mvt file wich will contains names of layers at least. But with new mvt_postgis data provider tegola will returns empty file with 0 byte size. And the problem is, the caching server can't use this file (because of its size, I think) and returns 404. Is it possible to make this type of files not totally empty and remain names of layers for example?

@pnorman
Copy link
Contributor

pnorman commented Jul 5, 2021

A zero byte file where there's no data is correct.

@F-15023
Copy link
Author

F-15023 commented Jul 6, 2021

The problem is that nginx returns 404 if file 0 bytes and this files can't be cached also. Can you add parameter that make tegola
returns the same file as with postgis data provider for this type of mvt?

@ARolek
Copy link
Member

ARolek commented Jul 7, 2021

@F-15023

Can you add parameter that make tegola returns the same file as with postgis data provider for this type of mvt

Can you expand on this? Are you saying that PostGIS is returning a non 0-byte tile, but tegola is returning a 0-byte tile?

@F-15023
Copy link
Author

F-15023 commented Jul 8, 2021

For example, we have tile which have no data. With postgis data provider (I mean type = postgis in tegola config in [[providers]] section) tegola returns mvt file which will contains all layers names from tegola config even if layers have no objects. You can see something like this inside of mvt file for empty tile:
layers {
name: "rivers"
extent: 4096
version: 2
}
layers {
name: "buildings"
extent: 4096
version: 2
}
...etc.
And this mvt file will not have 0 byte size.
But with new mvt_postgis data provider tegola will return absolutely empty file without layers names and it will be 0 byte size. And this leads to some problems as I say before. Now I had to add a useless layer containing the BBOX borders, just to avoid 0 byte files. Maybe there are better solutions exists?

@ARolek
Copy link
Member

ARolek commented Jul 8, 2021

@F-15023 Ah yes, I'm thinking that's potentially a bug in tegola as it should probably be returning 0 byte tiles if no data exists. I need to look into this a bit.

Can you share any of your nginx config? I'm surprised that it's returning a 404 even though tegola is not. I could maybe understand a 204 No Content, but I'm surprised that changing the status code to 404 on a 0-byte body would be the default behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants