diff --git a/README.md b/README.md
index 14024f9d..8ef18d14 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ Options
* -n name: Human-readable name (default file.json)
* -z zoom: Base zoom level (default 14)
* -Z zoom: Lowest zoom level (default 0)
- * -d detail: Detail at base zoom level (default 12, for tile resolution of 4096)
+ * -d detail: Detail at base zoom level (default 26-basezoom, ~0.5m, for tile resolution of 4096 if -z14)
* -D detail: Detail at lower zoom levels (default 10, for tile resolution of 1024)
* -x name: Exclude the named properties from all features
* -X: Exclude all properties and encode only geometries
diff --git a/geojson.c b/geojson.c
index 40371e84..2320482e 100644
--- a/geojson.c
+++ b/geojson.c
@@ -20,7 +20,7 @@
#include "projection.h"
int low_detail = 10;
-int full_detail = 12;
+int full_detail = -1;
#define GEOM_POINT 0 /* array of positions */
#define GEOM_MULTIPOINT 1 /* array of arrays of positions */
@@ -581,6 +581,13 @@ int main(int argc, char **argv) {
}
}
+ if (full_detail <= 0) {
+ // ~0.5m accuracy at whatever zoom
+ // 12 bits (4096 units) at z14
+
+ full_detail = 26 - maxzoom;
+ }
+
if (outdir == NULL) {
fprintf(stderr, "%s: must specify -o out.mbtiles\n", argv[0]);
exit(EXIT_FAILURE);