Closed zacdav closed 1 year ago
Oh good one, that was a totally arbitrary check I put in. I think file size is a poor thing to use. That size came from a download resulting in a text file with an error message that was a constant size - I'll see if I can make it use the jpeg/png magic number detection instead.
ceramic needs an update soonish for the new mapbox api anyway, so glad it's working for you using the gh source
Ah that makes sense, magic number seems like a good idea.
This is the reason, the dud files were 34 bytes:
"{\"message\":\"Tile does not exist\"}"
That is really tiny, can you share one of these minimal tiles? I'm getting a bit confused
Let me get the files, the example above was giving the error.
Well this is odd - I can't seem to get the behaviour on either CRAN version or an older commit. I wonder if somehow I had a bad file stuck in the cache that was the same as the dud one?
I'll keep investigating to see if i can recreate it again, It does seem weird that removing the check made it work last night.
I may have fixed in dev before today and not realized. Thanks for following up!
Maybe you saw an example just under 100b? I'll change this to 35, can you try? Committed from
Here was another test on file size: https://github.com/hypertidy/ceramic/blob/089f1f2df69f51af214c22aa6c81762cd64e4a5c/R/cache.R#L65
I have tried a few more times now and haven't had any issues on dev branch. I think it must have been related to me updating the same style and having something stuck in cache.
Thanks for helping and being so prompt!
note that cc_location no longer interacts with the tiles, you can use custom styles with get_tiles()
but we no longer support reading them atm
I've been playing with ceramic and so far enjoying it as a replacement for ggmap.
This issue arises when trying to use a "label only" style so that I can have labels on top of polygons. This style produces tiles that are very very small file sizes which are getting rejected due to a file size check in the package. I've been able to circumvent this by adjusting the file size check in a fork of the repo.
This is the file size check I adjusted: https://github.com/hypertidy/ceramic/blob/089f1f2df69f51af214c22aa6c81762cd64e4a5c/R/get_tiles.R#L94
Example: working example using forked repo, fails in current development version.
Is there a more robust check that can take place? I am not sure for what situations the current check is for.
Thanks