[GRASS-SVN] r60368 - grass-addons/grass6/raster/r.out.mbtiles

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 20 01:18:30 PDT 2014


Author: hamish
Date: 2014-05-20 01:18:30 -0700 (Tue, 20 May 2014)
New Revision: 60368

Modified:
   grass-addons/grass6/raster/r.out.mbtiles/r.out.mbtiles
Log:
write out json metadata file for MBUtil encoder

Modified: grass-addons/grass6/raster/r.out.mbtiles/r.out.mbtiles
===================================================================
--- grass-addons/grass6/raster/r.out.mbtiles/r.out.mbtiles	2014-05-20 06:52:27 UTC (rev 60367)
+++ grass-addons/grass6/raster/r.out.mbtiles/r.out.mbtiles	2014-05-20 08:18:30 UTC (rev 60368)
@@ -385,7 +385,7 @@
    rm -f "$file"
 done
 
-#### write out .mapurl file
+#### write out metadata files
 
 # get max extent bbox in lat/lon 
 eval `g.region -bgu` 
@@ -399,6 +399,7 @@
    ext=png
 fi
 
+# .mapurl file for Geopaparazzi and uDig
 cat << EOF > "$URLFILE"
 url=$OUTFILE/ZZZ/XXX/YYY.$ext
 minzoom=$minzoom
@@ -414,6 +415,23 @@
 request_type=run,fill,load
 EOF
 
+# json file for MBUtil
+cat << EOF > "$OUT_DIR/metadata.json"
+{
+    "version": "1.1",
+    "name": "$TITLE",
+    "description": "Exported zoom level(s) $ZOOM from GRASS GIS r.out.mbtiles",
+    "format": "$ext",
+    "center": "$ll_clon,$ll_clat",
+    "bounds": "$ll_w,$ll_s,$ll_e,$ll_n",
+    "minzoom": "$minzoom",
+    "maxzoom": "$maxzoom",
+    "type": "baselayer",
+    "tile_row_type": "tms"
+}
+EOF
+
+
 cd "$OUT_DIR"
 
 g.message "Scanning for blank tiles ..."



More information about the grass-commit mailing list