Comments (5)
@sikmir why are you exporting from tippecanoe to a directory? That might be part of the problem here. You can export directly to mbtiles:
$tippecanoe -o test.mbtiles -zg --drop-densest-as-needed ./src/*.geojson
You will need to delete test.mbtiles
or add the -f
option (force: delete if exists and create mbtiles file)
Watch for any errors from tippecanoe, usually it is pretty good at alerting you if there was an error creating tiles.
In your above case, your issue is most likely the *.geojson
expression - you need to reference a specific file rather than a wildcard.
If you have multiple geojson files you are trying to encode into mbtiles at once, you need to do it in a couple steps:
- create an mbtiles file for each geojson file, using the
-l
option to name the layer in the output - use
tile-join
(part of tippecanoe) to merge the mbtiles files together into a single mbtiles file; each layer in this will have the layer name you specify in the first step.
Example (untested commands):
$ tippecanoe -o a.mbtiles -l "A" ./src/a.geojson
$ tippecanoe -o b.mbtiles -l "B" ./src/b.geojson
$ tile-join -o test.mbtiles a.mbtiles b.mbtiles
from mbtileserver.
Steps to reproduce
$ docker-compose up -d
$ cp ~/broken/test.mbtiles ./mbtiles/testdata/
$ docker exec -it mbtileserver sh -c "kill -HUP 1"
$ docker-compose logs mbtileserver
...
mbtileserver | Reloading...
mbtileserver |
mbtileserver | time="2019-11-04T08:05:06Z" level=info msg="Found 3 mbtiles files in ./tilesets"
mbtileserver | time="2019-11-04T08:05:06Z" level=error msg="Unable to create service set: could not open mbtiles file \"tilesets/test.mbtiles\": sql: no rows in result set"
mbtileserver | panic: runtime error: invalid memory address or nil pointer dereference
mbtileserver | [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x891c1d]
mbtileserver |
mbtileserver | goroutine 1 [running]:
mbtileserver | github.com/consbio/mbtileserver/handlers.(*ServiceSet).Handler(0x0, 0xade120, 0x1, 0xc000337d18, 0x8)
mbtileserver | /handlers/handlers.go:480 +0x45d
mbtileserver | main.serve()
mbtileserver | /main.go:244 +0x87c
mbtileserver | main.glob..func1(0xf12740, 0xc000342660, 0x1, 0x2)
mbtileserver | /main.go:43 +0x4c
mbtileserver | github.com/spf13/cobra.(*Command).execute(0xf12740, 0xc000020190, 0x2, 0x2, 0xf12740, 0xc000020190)
mbtileserver | /go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2ae
mbtileserver | github.com/spf13/cobra.(*Command).ExecuteC(0xf12740, 0x0, 0x0, 0xf4b4c0)
mbtileserver | /go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ec
mbtileserver | github.com/spf13/cobra.(*Command).Execute(...)
mbtileserver | /go/pkg/mod/github.com/spf13/[email protected]/command.go:800
mbtileserver | main.main()
mbtileserver | /main.go:145 +0x2e
mbtileserver | EXITING (abnormal child exit: exit status 2)time="2019-11-04T08:05:13Z" level=info msg="Found 3 mbtiles files in ./tilesets"
mbtileserver | time="2019-11-04T08:05:13Z" level=error msg="Unable to create service set: could not open mbtiles file \"tilesets/test.mbtiles\": sql: no rows in result set"
mbtileserver | panic: runtime error: invalid memory address or nil pointer dereference
mbtileserver | [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x891c1d]
...
The fix is pretty simple - just ignore the error bellow (that means ignoring broken .mbtiles):
mbtileserver/handlers/handlers.go
Lines 201 to 204 in ab619df
@brendan-ward what do you think?
from mbtileserver.
Yes, I think skipping corrupt mbtiles files with a warning to the user would be reasonable.
Out of curiosity, what caused your mbtiles file to be corrupt in this case?
from mbtileserver.
Out of curiosity, what caused your mbtiles file to be corrupt in this case?
Well, I can make a PR.
Out of curiosity, what caused your mbtiles file to be corrupt in this case?
I don't know so far, I've just tried to use tippecanoe for the first time:
$ tippecanoe -e ./tiles -zg --drop-densest-as-needed ./src/*.geojson
$ mb-util ./tiles test.mbtiles
Maybe I'm doing something wrong or something wrong with my data.
from mbtileserver.
@brendan-ward Thank you for pointing out! I finally managed to get a proper result for my use case after tinkering around with tippecanoe a bit more. That's just a great tool!
from mbtileserver.
Related Issues (20)
- BUG: invalid tiles cause panic on sqlite connections
- BUG: Map preview fails when 'center' property is not present in metadata HOT 7
- caching options HOT 1
- Build Error with GCC11 HOT 5
- DOC: Add note that user needs to increase max open files limit if using several tilesets
- Deploy arm64 image to Docker Hub HOT 4
- Consider alternative basemap tile providers HOT 9
- Add multiple subdomain support HOT 1
- Missing tiles returned as 256x256 transparent tiles HOT 11
- Serve tiles from blob-storage HOT 1
- it is not support EPSG 4326 HOT 2
- Migrate from Docker Hub to Github Packages registery
- Include version in CLI
- mbtileserver vs Martin Comparison? HOT 2
- Consider adding a /metrics endpoint HOT 1
- Map preview does not work when using reverse proxy with HTTPS HOT 6
- Use of stadiamaps? HOT 9
- Docker 404 Error HOT 4
- Crash when issue with one tile HOT 4
- Enhancement: support TileJSON 3.0.0
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 mbtileserver.