{"id":5465,"date":"2017-08-29T10:26:22","date_gmt":"2017-08-29T01:26:22","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=5465"},"modified":"2017-08-29T10:59:44","modified_gmt":"2017-08-29T01:59:44","slug":"%e3%83%90%e3%82%a4%e3%83%8a%e3%83%aa%e3%83%99%e3%82%af%e3%83%88%e3%83%ab%e3%82%bf%e3%82%a4%e3%83%ab%e3%81%ae%e3%83%87%e3%83%90%e3%83%83%e3%82%b0%e3%83%84%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/leaflet-js\/5465","title":{"rendered":"\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u306e\u30c7\u30d0\u30c3\u30b0\u30c4\u30fc\u30eb"},"content":{"rendered":"<h2>\u6982\u8981<\/h2>\n<p>\u4ee5\u524d\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u306e\u4f5c\u6210\u5de5\u7a0b\u3092\u8a18\u4e8b\u3057\u307e\u3057\u305f\u3002<br \/>\n\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u306f\u305d\u306e\u540d\u306e\u901a\u308a\u30d0\u30a4\u30ca\u30ea\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u306a\u306e\u3067GeoJSON\u306e\u3088\u3046\u306a\u30c6\u30ad\u30b9\u30c8\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u306e\u3088\u3046\u306b\u958b\u3044\u3066\u7c21\u5358\u306b\u4e2d\u8eab\u3092\u898b\u308b\u3068\u3044\u3063\u305f\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5de5\u7a0b\u306e\u5404\u30dd\u30a4\u30f3\u30c8\u3067\u5909\u63db\u7b49\u304c\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3067\u304d\u308b\u30c4\u30fc\u30eb\u985e\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/gunmagisgeek.com\/blog\/leaflet-js\/5354\">\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u306e\u4f5c\u308a\u65b9<\/a><\/p>\n<h2>mbtiles\u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b<\/h2>\n<p><a href=\"https:\/\/github.com\/mojodna\/tessera\">mojodna\/tessera: A tilelive-based tile server.<\/a><\/p>\n<p><a href=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/tessera.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/tessera-217x150.png\" alt=\"\" width=\"217\" height=\"150\" class=\"alignnone size-medium wp-image-5467\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/tessera-217x150.png 217w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/tessera-768x532.png 768w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/tessera-1024x709.png 1024w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/tessera.png 1903w\" sizes=\"auto, (max-width: 217px) 100vw, 217px\" \/><\/a><\/p>\n<p>tippecanoe\u3092\u4f7f\u3063\u3066GeoJSON\u3092mbtiles\u306b\u5909\u63db\u3057\u307e\u3059\u304c\u3001\u6b63\u3057\u304f\u5909\u63db\u3067\u304d\u3066\u3044\u306a\u3051\u308c\u3070\u3053\u306e\u5f8c\u306e\u5de5\u7a0b\u304c\u305d\u3082\u305d\u3082\u7121\u99c4\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\ntessera\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u4f7f\u3046\u3068mbtiles\u306e\u30c7\u30fc\u30bf\u3092\u5730\u56f3\u306b\u8868\u793a\u3057\u3066\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u3053\u306e\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066tippecane\u3092\u4f7f\u3063\u305f\u5909\u63db\u304c\u6b63\u3057\u304f\u884c\u308f\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304a\u304f\u3068\u4f59\u8a08\u306a\u624b\u623b\u308a\u3092\u9632\u3052\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre class=\"lang:js decode:true \" >npm install -g tessera<\/pre>\n<p>\u4f5c\u6210\u3057\u305fmbtiles\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >tessera mbtiles:\/\/.\/&lt;\u30d5\u30a1\u30a4\u30eb\u540d&gt;<\/pre>\n<p>\u30ed\u30fc\u30ab\u30eb\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3059\u308b\u306e\u3067\u51fa\u529b\u3055\u308c\u305furl\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u958b\u3044\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u72b6\u614b\u3067\u6b63\u3057\u304f\u30c7\u30fc\u30bf\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u3088\u3046\u3067\u3042\u308c\u3070\u3001\u5909\u63db\u306b\u5931\u6557\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>mbtiles\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3059\u308b<\/h2>\n<p><a href=\"https:\/\/github.com\/mapbox\/mbutil\">mapbox\/mbutil: Importer and Exporter of MBTiles<\/a><\/p>\n<p><a href=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/mb-util_dumps.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/mb-util_dumps-181x150.png\" alt=\"\" width=\"181\" height=\"150\" class=\"alignnone size-medium wp-image-5468\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/mb-util_dumps-181x150.png 181w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2017\/08\/mb-util_dumps.png 682w\" sizes=\"auto, (max-width: 181px) 100vw, 181px\" \/><\/a><\/p>\n<p>mbtiles\u3092\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u306b\u5909\u63db\u3059\u308bmb-util\u3092\u4f7f\u3046\u3068\u30e1\u30bf\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >mb-util hoge.mbtiles dumps<\/pre>\n<p>\u30e1\u30bf\u60c5\u5831\u306b\u306f\u30ba\u30fc\u30e0\u7bc4\u56f2\u3084bounds\u306a\u3069\u5909\u63db\u3057\u305f\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u306e\u60c5\u5831\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u7279\u306bvector_layers\u306eid\u306f\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u30bf\u30a4\u30eb\u3092\u8868\u793a\u3059\u308b\u969b\u306b\u5fc5\u8981\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001\u78ba\u8a8d\u3057\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2>mvt(pdf)\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n<p>\u4f5c\u6210\u3057\u305fmbtiles\u3092mb-util\u3092\u4f7f\u3063\u3066\u5909\u63db\u3057\u305f\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u306b\u554f\u984c\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30d5\u30a1\u30a4\u30eb\u306f\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u305d\u306e\u307e\u307e\u3067\u306f\u78ba\u8a8d\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u3053\u3067\u3001mvt(pdf)\u306e\u30d5\u30a1\u30a4\u30eb\u3092GeoJSON\u306b\u5909\u63db\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/shimizu\/vt_pbf2json\">shimizu\/vt_pbf2json<\/a><\/p>\n<p>\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b<\/p>\n<pre class=\"lang:js decode:true \" >$ npm install\r\n$ node vt_pbf2json hoge.pbf &gt; hoge.geojson<\/pre>\n<h2>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306e\u30c7\u30d0\u30c3\u30b0<\/h2>\n<p>\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u306f\u3001\u901a\u5e38\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067GeoJSON\u306b\u623b\u3055\u308c\u3066\u5229\u7528\u3055\u308c\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001L.TileLayer.MVTSource\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u5834\u5408\u3001filter\u3084style\u306b\u8a2d\u5b9a\u3057\u305f\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u306e\u5f15\u6570\u300cfeature\u300d\u306b\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u304b\u3089\u5909\u63db\u3055\u308c\u305fGeoJSON\u304c\u6e21\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u3089\u306e\u95a2\u6570\u306e\u76f4\u4e0b\u3067\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u30c7\u30d0\u30c3\u30b0\u304c\u3057\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<pre class=\"lang:js mark:4,11 decode:true \" >var mvtSource = new L.TileLayer.MVTSource({\r\n    url: \".\/tiles\/{z}\/{x}\/{y}.pbf\", \/\/\u751f\u6210\u3057\u305f\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u6240\u3092\u6307\u5b9a\r\n    filter: function(feature, context) {\r\n        console.log(feature); \/\/ \u3000&lt;- \u3061\u3083\u3093\u3068GeoJSON\u304c\u6e21\u3055\u308c\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002\r\n        if (feature.layer.name === 'gs_map') {\r\n            return true;\r\n        }\r\n        return false;\r\n    },\r\n    style: function (feature) {\r\n        console.log(feature); \/\/ \u3000&lt;- \u3061\u3083\u3093\u3068GeoJSON\u304c\u6e21\u3055\u308c\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002\r\n        return style;\r\n    }\r\n});<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u4ee5\u524d\u30d0\u30a4\u30ca\u30ea\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u306e\u4f5c\u6210\u5de5\u7a0b\u3092\u8a18\u4e8b\u3057&hellip;<\/p>\n","protected":false},"author":1,"featured_media":5355,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,66],"tags":[],"class_list":["post-5465","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-leaflet-js","category-map","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/5465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=5465"}],"version-history":[{"count":1,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/5465\/revisions"}],"predecessor-version":[{"id":5466,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/5465\/revisions\/5466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/5355"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=5465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=5465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=5465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}