mapbox / tippecanoe

Build vector tilesets from large collections of GeoJSON features.
BSD 2-Clause "Simplified" License
2.74k stars 432 forks source link

Not able to generate .mbtiles on mac m1 #960

Closed krishnaglodha closed 1 year ago

krishnaglodha commented 1 year ago

I'm trying to create .mbtile for a simple geojson which has 2 features only

{
"type": "FeatureCollection",
"name": "sample",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.556125796759764, 0.361017135115639 ], [ -0.533356269760191, 0.359677751174488 ], [ -0.533356269760191, 0.330211304469157 ], [ -0.557465180700915, 0.320835616881098 ], [ -0.556125796759764, 0.361017135115639 ] ] ] } },
{ "type": "Feature", "properties": { "id": 2 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.502550439113709, 0.318156848998795 ], [ -0.481120296055287, 0.324853768704552 ], [ -0.48379906393759, 0.30342362564613 ], [ -0.502550439113709, 0.30342362564613 ], [ -0.502550439113709, 0.318156848998795 ] ] ] } }
]
}

using following command

tippecanoe -z4 --projection=EPSG:4326 -o poly.mbtiles -l poly.json but for some reason it's not creating mbtiles. I tried waiting till 10 minutes

Screenshot 2023-01-13 at 7 53 06 PM

these 2 files are created. I also tried with bigger data set and still I got 2 files with same size.

acalcutt commented 1 year ago

Does the generated mbtiles file not work? have you loaded it in something like tileserver-gl to see what it generated?

I do something like this in my project.

In my Wireless database I have a process that exports geojson daily https://github.com/acalcutt/WifiDB/blob/master/wifidb/tools/daemon/geojsond.php

Then, on a different server, I pull that data and process it with tippecanoe in a similar way to what you are doing. https://github.com/acalcutt/wifidb-tileserver-gl/blob/master/convert/convert.sh

acalcutt commented 1 year ago

Maybe a zoom level thing? at zoom 4 I wouldn't expect that big of a file

krishnaglodha commented 1 year ago

I tried same command without -l and it worked

e-n-f commented 1 year ago

Oh, the problem is that -l takes a layer name argument. You could do -l poly poly.json to specify that the layer name is poly and that the input file is poly.json. As it is, it is trying to use your input file poly.json as the layer name and to read input from a pipe (or from the terminal).

(Tippecanoe is now maintained at https://github.com/felt/tippecanoe.)

krishnaglodha commented 1 year ago

thanks for the input @e-n-f