{"id":6004,"date":"2018-05-21T19:34:12","date_gmt":"2018-05-21T10:34:12","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=6004"},"modified":"2018-05-23T17:20:33","modified_gmt":"2018-05-23T08:20:33","slug":"%e3%83%89%e3%83%8a%e3%83%ab%e3%83%89%e3%81%ae%e3%81%84%e3%81%aa%e3%81%84%e8%a1%97%e3%82%92%e5%8f%af%e8%a6%96%e5%8c%96%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f%e3%80%82","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/leaflet-js\/6004","title":{"rendered":"\u30c9\u30ca\u30eb\u30c9\u306e\u3044\u306a\u3044\u8857\u3092\u53ef\u8996\u5316\u3057\u3066\u307f\u305f\u3002"},"content":{"rendered":"<p>\u5e02\u533a\u753a\u6751\u3054\u3068\u306e\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u6570\u3067\u8272\u4ed8\u3051\u3057\u3066\u3044\u307e\u3059\u3002\u8272\u304c\u6fc3\u3044\u5730\u57df\u307b\u3069\u5e97\u8217\u304c\u591a\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\n\u767d\u304f\u5857\u3089\u308c\u305f\u5730\u57df\u304c\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u304c\u4e00\u5e97\u8217\u3082\u306a\u3044\u300c\u30c9\u30ca\u30eb\u30c9\u306e\u3044\u306a\u3044\u8857\u300d\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/shimz.me\/datavis\/mcdonaldsMaps\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macMaps.png\" alt=\"\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u6570\u30b3\u30ed\u30d7\u30ec\u30b9\u30de\u30c3\u30d7\" width=\"1315\" height=\"867\" class=\"aligncenter size-full wp-image-6007 border\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macMaps.png 1315w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macMaps-228x150.png 228w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macMaps-768x506.png 768w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macMaps-1024x675.png 1024w\" sizes=\"auto, (max-width: 1315px) 100vw, 1315px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/shimz.me\/datavis\/mcdonaldsMaps\/\">DEMO<\/a><\/p>\n<p><a href=\"https:\/\/giphy.com\/gifs\/mcdonalds-chicken-mcnuggets-vm7QUqCxvQrVm\"><\/p>\n<p><iframe src=\"https:\/\/giphy.com\/embed\/vm7QUqCxvQrVm\" width=\"100%\"  frameBorder=\"0\" class=\"giphy-embed\" allowFullScreen><\/iframe><\/p>\n<p><\/a><\/p>\n<h3>\u7d4c\u7def<\/h3>\n<p>Geo\u30af\u30e9\u30b9\u30bf\u3067\u306f\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u306e\u5e97\u8217\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u305f\u5206\u6790\u304c\u6d41\u884c\u3063\u3066\u3044\u308b\u3089\u3057\u3044\u306e\u3067\u3001\u5468\u56de\u9045\u308c\u306a\u304c\u3089\u3053\u306e\u30d3\u30c3\u30b0\u30a6\u30a7\u30fc\u30d6\u306b\u4e57\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/qiita.com\/j_catfish\/items\/0d36a21b4744aa3e4870\">\u65e5\u672c\u4e00\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u304b\u3089\u9060\u3044\u5834\u6240 &#45; Qiita<\/a><br \/>\n<a href=\"https:\/\/note.mu\/ynunokawa\/n\/ndcc27f8872cb\">\u300c\u672c\u5f53\u306b\u300d\u65e5\u672c\u4e00\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u304b\u3089\u9060\u3044\u5834\u6240\uff5c\u30cc\u30ce\u30ab\u30ef \u30e6\u30a6\u30b9\u30b1\uff5cnote<\/a><br \/>\n<a href=\"https:\/\/qiita.com\/qoAop\/items\/5b5c07530690938f63fe\">\u65e5\u672c\u4e00\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u304b\u3089\u9060\u3044\u5834\u6240\u306fPostGIS\u3067\u6c42\u3081\u3089\u308c\u308b\u304b\u306a\uff1f &#45; Qiita<\/a><br \/>\n<a href=\"https:\/\/qiita.com\/330k\/items\/a2cf16ab67fac6ab314e\">\u65e5\u672c\u4e00\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u304b\u3089\u9060\u3044\u5834\u6240\u3000\u3092\u3088\u308a\u7cbe\u78ba\u306b\u6c42\u3081\u3066\u307f\u305f &#45; Qiita<\/a><\/p>\n<p>\u3068\u306f\u3044\u3048\u3001\u4e00\u756a\u9060\u3044\u5834\u6240\u3092\u898b\u3064\u3051\u308b\u5225\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3082\u601d\u3044\u3064\u304b\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u4eca\u56de\u306f\u3001GIS\u3092\u4f7f\u3063\u305f\u5206\u6790\u306e\u57fa\u672c\u3001\u300c\u30dd\u30ea\u30b4\u30f3\u3054\u3068\u306b\u542b\u307e\u308c\u308b\u30dd\u30a4\u30f3\u30c8\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u3066\u5857\u308a\u5206\u3051\u5730\u56f3\u3092\u4f5c\u308b\u300d\u3092\u3059\u308b\u3053\u3068\u306b\u3002<\/p>\n<h3>\u30c7\u30fc\u30bf<\/h3>\n<p>\u30fb\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u30c7\u30fc\u30bf<br \/>\n<a href=\"https:\/\/map.mcdonalds.co.jp\/\">\u5e97\u8217\u691c\u7d22 &#124; \u304a\u5e97\u3092\u3055\u304c\u3059 &#124; McDonald&#8217;s<\/a>\u306e\u30da\u30fc\u30b8\u3088\u308a\u3001\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u5e97\u8217\u60c5\u5831\u3092\u53d6\u5f97\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30fb\u5e02\u533a\u753a\u6751\u30dd\u30ea\u30b4\u30f3<br \/>\n<a href=\"https:\/\/www.esrij.com\/products\/japan-shp\/\">\u5168\u56fd\u5e02\u533a\u753a\u6751\u754c\u30c7\u30fc\u30bf &#124; ESRI\u30b8\u30e3\u30d1\u30f3<\/a>\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fshape\u30d5\u30a1\u30a4\u30eb\u3092GeoJSON\u306b\u5909\u63db\u3057\u3066\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u5e02\u533a\u753a\u6751\u3054\u3068\u306e\u5e97\u8217\u6570\u3092\u6c42\u3081\u308b<\/h3>\n<p>\u4e0b\u8a18\u753b\u50cf\u306e\u3088\u3046\u306b\u30dd\u30a4\u30f3\u30c8\u30c7\u30fc\u30bf\u3068\u30dd\u30ea\u30b4\u30f3\u30c7\u30fc\u30bf\u3092\u7528\u610f\u3057\u3001\u5404\u30dd\u30ea\u30b4\u30f3\u306b\u542b\u307e\u308c\u308b\u30dd\u30a4\u30f3\u30c8\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macDotMaps.png\" alt=\"\" width=\"1321\" height=\"801\" class=\"aligncenter size-full wp-image-6008 border\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macDotMaps.png 1321w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macDotMaps-247x150.png 247w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macDotMaps-768x466.png 768w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/macDotMaps-1024x621.png 1024w\" sizes=\"auto, (max-width: 1321px) 100vw, 1321px\" \/><\/p>\n<p>QGIS\u306a\u3069\u3092\u4f7f\u3046\u3053\u3068\u3067\u7c21\u5358\u306b\u8a08\u7b97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u4eca\u56de\u306fTurf.js\u3092\u4f7f\u3063\u3066\u8a08\u7b97\u3057\u307e\u3057\u305f\u3002<br \/>\nTurf.js\u306f\u3001\u5730\u7406\u60c5\u5831\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306e\u69d8\u3005\u306a\u6a5f\u80fd\u3092\u3082\u3064JavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d6\u30ed\u30b0\u3067\u3082\u3044\u304f\u3064\u304b\u30b5\u30f3\u30d7\u30eb\u3092\u8f09\u305b\u3066\u3044\u308b\u306e\u3067\u8208\u5473\u304c\u3042\u308b\u304b\u305f\u306f\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\uff08\u4e00\u90e8\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306b\u3088\u308a\u4f7f\u3048\u306a\u304f\u306a\u3063\u305f\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\uff09<\/p>\n<p><a href=\"https:\/\/gunmagisgeek.com\/blog\/category\/turf-js\">Turf&#46;js \u2013 GUNMA GIS GEEK<\/a><\/p>\n<p>Turf.js\u306f\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3060\u3051\u3067\u306a\u304fnode.js\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u3057\u3066\u3082\u5b9f\u884c\u3067\u304d\u308b\u306e\u3067\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3084\u30ed\u30fc\u30ab\u30eb\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u30c7\u30fc\u30bf\u91cf\u304c\u591a\u3044\u306e\u3067\u30ed\u30fc\u30ab\u30eb\u3067\u8a08\u7b97\u3057\u307e\u3057\u305f\u3002<\/p>\n<h4>turf.js\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>turf.js\u306fnpm\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >$ npm install @turf\/turf<\/pre>\n<h4>pointsWithinPolygon<\/h4>\n<p>turf.js\u3067\u306f\u3001\u8907\u6570\u306e\u30dd\u30a4\u30f3\u30c8\u30c7\u30fc\u30bf\u306e\u4e2d\u304b\u3089\u3001\u7279\u5b9a\u306e\u30dd\u30ea\u30b4\u30f3\u5185\u306b\u542b\u307e\u308c\u308b\u30dd\u30a4\u30f3\u30c8\u3060\u3051\u3092\u62bd\u51fa\u3059\u308b <a href=\"http:\/\/turfjs.org\/docs#pointsWithinPolygon\">pointsWithinPolygon<\/a> \u3068\u3044\u3046\u95a2\u6570\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u306e\u95a2\u6570\u3092\u3064\u304b\u3063\u3066\u5e02\u533a\u753a\u6751\u3054\u3068\u306e\u5e97\u8217\u6570\u3092\u6c42\u3081\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >var points = turf.points([\n    [-46.6318, -23.5523],\n    [-46.6246, -23.5325],\n    [-46.6062, -23.5513],\n    [-46.663, -23.554],\n    [-46.643, -23.557]\n]);\n\nvar searchWithin = turf.polygon([[\n    [-46.653,-23.543],\n    [-46.634,-23.5346],\n    [-46.613,-23.543],\n    [-46.614,-23.559],\n    [-46.631,-23.567],\n    [-46.653,-23.560],\n    [-46.653,-23.543]\n]]);\n\nvar ptsWithin = turf.pointsWithinPolygon(points, searchWithin);<\/pre>\n<h4>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h4>\n<pre class=\"lang:js decode:true \" title=\"addMacCountData.js\">const fs = require('fs');\nconst turf = require('@turf\/turf');\n\n\/\/\u5e02\u533a\u753a\u6751\u30dd\u30ea\u30b4\u30f3\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\nconst geojson = JSON.parse(fs.readFileSync('japan_ver81.geojson', 'utf8')); \n\/\/\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\nconst macdonald = JSON.parse(fs.readFileSync('macdonald.json', 'utf8')); \n\n\n\/\/\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u30c7\u30fc\u30bf\u3092geojson\u5f62\u5f0f\u306b\u5909\u63db\nconst points = turf.featureCollection( macdonald.map(function(d){\n    const p = turf.point([d.longitude, d.latitude], d);\n    return p\n}) );\n\n\n\/\/\u5e02\u533a\u753a\u6751\u5883\u754c\u30c7\u30fc\u30bf\u306e\u5404\u30dd\u30ea\u30b4\u30f3\u5185\u306b\u542b\u307e\u308c\u308b\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u3092\u62bd\u51fa\u3057\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u8ffd\u52a0\ngeojson.features.forEach(function(feature){\n    if(!feature.geometry) return null;\n    try {\n        var ptsWithin = turf.pointsWithinPolygon(points, feature);   \/\/\u30dd\u30ea\u30b4\u30f3\u5185\u306b\u542b\u307e\u308c\u308b\u30dd\u30a4\u30f3\u30c8\u3092\u62bd\u51fa      \n    }\n    catch(e){\n        console.log(e);\n        console.log(feature);\n    }\n    \n    feature.properties.mac_count = ptsWithin.features.length; \/\/\u5e97\u8217\u6570\u3092\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u8ffd\u52a0\n    feature.properties.mac_data = ptsWithin.features; \/\/\u5e97\u8217\u60c5\u5831\u3092\u8ffd\u52a0\n});\n\n\nconsole.log(JSON.stringify(geojson)); \/\/\u30b3\u30f3\u30bd\u30fc\u30eb\u306bGeoJSON\u3092\u51fa\u529b\u3059\u308b\n\n<\/pre>\n<h4>\u5b9f\u884c<\/h4>\n<pre class=\"lang:js decode:true \" >$ node addMacCountData.js &gt; macMap.geojson<\/pre>\n<h3>\u5730\u56f3\u306b\u8f09\u305b\u3066\u898b\u305f<\/h3>\n<p>\u4f5c\u6210\u3057\u305fGeoJSON\u30c7\u30fc\u30bf\u306f\u3001GeoJSON\u306b\u5bfe\u5fdc\u3057\u305f\u5730\u56f3\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u5730\u56f3\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u306b\u8aad\u307f\u3053\u307e\u305b\u3066\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u3001\u4ee5\u524d\u8a18\u4e8b\u306b\u3057\u305f\u3001<a href=\"https:\/\/gunmagisgeek.com\/blog\/leaflet-js\/5574\">GeoJSON\u3092\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u30d9\u30af\u30c8\u30eb\u30bf\u30a4\u30eb\u5316\u3057\u3066\u8868\u793a\u3059\u308b<\/a>\u300d\u65b9\u6cd5\u3067\u5730\u56f3\u3092\u3064\u304f\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/shimz.me\/datavis\/mcdonaldsMaps\/\">\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u6570\u5857\u308a\u5206\u3051\u5730\u56f3<\/a><\/p>\n<h3>\u304a\u307e\u3051<\/h3>\n<p>\u5e97\u8217\u6570\u306e\u591a\u3044\u5730\u57df\u306e\u30e9\u30f3\u30ad\u30f3\u30b0\u306a\u3069\u3092\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:tex highlight:0 decode:true \" >\u30de\u30c3\u30af\u6709\u308a\u5730\u57df 939\n\u30de\u30c3\u30af\u7121\u3057\u5730\u57df 971\n\u30de\u30c3\u30af\u6709\u308a\u5730\u57df\u306e\u5272\u5408 49.16%\n\n\u5e97\u8217\u6570TOP10\n1\u4f4d \u6771\u4eac\u90fd  \u516b\u738b\u5b50\u5e02        18\u5e97\u8217\n2\u4f4d \u6771\u4eac\u90fd  \u8db3\u7acb\u533a     17\u5e97\u8217\n3\u4f4d \u5175\u5eab\u770c  \u5c3c\u5d0e\u5e02     16\u5e97\u8217\n4\u4f4d \u5343\u8449\u770c  \u67cf\u5e02      16\u5e97\u8217\n5\u4f4d \u6803\u6728\u770c  \u5b87\u90fd\u5bae\u5e02        15\u5e97\u8217\n6\u4f4d \u795e\u5948\u5ddd\u770c \u85e4\u6ca2\u5e02     15\u5e97\u8217\n7\u4f4d \u6771\u4eac\u90fd  \u6c5f\u6238\u5ddd\u533a        14\u5e97\u8217\n8\u4f4d \u6771\u4eac\u90fd  \u7df4\u99ac\u533a     14\u5e97\u8217\n9\u4f4d \u9e7f\u5150\u5cf6\u770c \u9e7f\u5150\u5cf6\u5e02        14\u5e97\u8217\n10\u4f4d \u6771\u4eac\u90fd \u5927\u7530\u533a     14\u5e97\u8217\n\n\u4e00\u4eba\u5f53\u305f\u308a\u5e97\u8217\u6570TOP10\n1\u4f4d \u6771\u4eac\u90fd  \u516b\u738b\u5b50\u5e02        18\u5e97\u8217    \u4eba\u53e3\uff1a562795\u4eba\n2\u4f4d \u6c96\u7e04\u770c  \u5cf6\u5c3b\u90e1\u516b\u91cd\u702c\u753a     1\u5e97\u8217 \u4eba\u53e3\uff1a30093\u4eba\n3\u4f4d \u5175\u5eab\u770c  \u5c3c\u5d0e\u5e02     16\u5e97\u8217    \u4eba\u53e3\uff1a463940\u4eba\n4\u4f4d \u5343\u8449\u770c  \u67cf\u5e02      16\u5e97\u8217    \u4eba\u53e3\uff1a409001\u4eba\n5\u4f4d \u6803\u6728\u770c  \u5b87\u90fd\u5bae\u5e02        15\u5e97\u8217    \u4eba\u53e3\uff1a521820\u4eba\n6\u4f4d \u795e\u5948\u5ddd\u770c \u85e4\u6ca2\u5e02     15\u5e97\u8217    \u4eba\u53e3\uff1a426024\u4eba\n7\u4f4d \u6771\u4eac\u90fd  \u6c5f\u6238\u5ddd\u533a        14\u5e97\u8217    \u4eba\u53e3\uff1a686387\u4eba\n8\u4f4d \u6771\u4eac\u90fd  \u7df4\u99ac\u533a     14\u5e97\u8217    \u4eba\u53e3\uff1a719109\u4eba\n9\u4f4d \u9e7f\u5150\u5cf6\u770c \u9e7f\u5150\u5cf6\u5e02        14\u5e97\u8217    \u4eba\u53e3\uff1a607382\u4eba\n10\u4f4d \u6771\u4eac\u90fd \u5927\u7530\u533a     14\u5e97\u8217    \u4eba\u53e3\uff1a712057\u4eba\n\n\u5e97\u8217\uff10\u5730\u57df\u4eba\u53e3TOP10\n1\u4f4d \u5e83\u5cf6\u770c  \u5e83\u5cf6\u5e02\u5b89\u82b8\u533a      0\u5e97\u8217 \u4eba\u53e3\uff1a80830\u4eba\n2\u4f4d \u5bae\u57ce\u770c  \u6817\u539f\u5e02     0\u5e97\u8217 \u4eba\u53e3\uff1a71748\u4eba\n3\u4f4d \u9999\u5ddd\u770c  \u4e09\u8c4a\u5e02     0\u5e97\u8217 \u4eba\u53e3\uff1a68084\u4eba\n4\u4f4d \u5bae\u57ce\u770c  \u6c17\u4ed9\u6cbc\u5e02        0\u5e97\u8217 \u4eba\u53e3\uff1a66733\u4eba\n5\u4f4d \u798f\u5cf6\u770c  \u5357\u76f8\u99ac\u5e02        0\u5e97\u8217 \u4eba\u53e3\uff1a63930\u4eba\n6\u4f4d \u57fc\u7389\u770c  \u84ee\u7530\u5e02     0\u5e97\u8217 \u4eba\u53e3\uff1a62481\u4eba\n7\u4f4d \u718a\u672c\u770c  \u5408\u5fd7\u5e02     0\u5e97\u8217 \u4eba\u53e3\uff1a59702\u4eba\n8\u4f4d \u65b0\u6f5f\u770c  \u65b0\u6f5f\u5e02\u897f\u84b2\u533a      0\u5e97\u8217 \u4eba\u53e3\uff1a59482\u4eba\n9\u4f4d \u5317\u6d77\u9053  \u5317\u5e83\u5cf6\u5e02        0\u5e97\u8217 \u4eba\u53e3\uff1a59348\u4eba\n10\u4f4d \u65b0\u6f5f\u770c \u4f50\u6e21\u5e02     0\u5e97\u8217 \u4eba\u53e3\uff1a58527\u4eba\n<\/pre>\n<p>\u3084\u306f\u308a\u95a2\u6771\u570f\u306b\u5e97\u8217\u306e\u591a\u3044\u5730\u57df\u304c\u96c6\u307e\u3063\u3066\u3044\u308b\u611f\u3058\u3067\u3059\u3002<br \/>\n\u5e02\u533a\u753a\u6751\u3054\u3068\u306e\u4eba\u53e3\u306e\u30c7\u30fc\u30bf\u304c\u3042\u3063\u305f\u306e\u3067\u300c\u4e00\u4eba\u5f53\u305f\u308a\u5e97\u8217\u6570\u304c\u591a\u3044\u5730\u57df\u300d\u3067\u8a08\u7b97\u3057\u3066\u307f\u305f\u3051\u3069\u9806\u4f4d\u306f\u3042\u307e\u308a\u5909\u308f\u3089\u305a\u3002\u305f\u3060\u4e00\u70b9\u3001\u6c96\u7e04\u770c\u5cf6\u5c3b\u90e1\u516b\u91cd\u702c\u753a\u306e\u5e97\u8217\uff08\u6771\u98a8\u5e73\u5e97\uff09\u304c\u7a81\u5982\u30e9\u30f3\u30af\u30a4\u30f3\u3057\u307e\u3059\u3002<br \/>\n\u516b\u91cd\u702c\u753a\u306f\u3082\u3068\u3082\u3068\u306f\u3001\u6771\u98a8\u5e73\u753a\u3092\u542b\u30804\u753a\u6751\u304c\u5408\u4f75\u3059\u308b\u306f\u305a\u3060\u3063\u305f\u306e\u304c\u3001\u3044\u308d\u3044\u308d\u3042\u3063\u30662\u753a\u6751\u306e\u307f\u306e\u5408\u4f75\u306b\u306a\u3063\u305f\u3068\u306e\u3053\u3068\u3067\u3001\u4ed6\u306e\u30de\u30c3\u30af\u6709\u308a\u5730\u57df\u3088\u308a\u4eba\u53e3\u304c\u5c11\u306a\u3044\u306e\u3067\u4e00\u4eba\u5f53\u305f\u308a\u306e\u5e97\u8217\u6570\u304c\u591a\u304f\u306a\u3063\u305f\u3063\u307d\u3044\u3067\u3059\u3001<\/p>\n<p>\u9006\u306b\u4eba\u53e3\u304c\u591a\u3044\u5730\u57df\u3067\u30de\u30c3\u30af\u304c\u306a\u3044\u5730\u57df\u3092\u8abf\u3079\u3066\u307f\u308b\u3068\u3001\u4e5d\u5dde\u30fb\u56db\u56fd\u304c\u5c11\u306a\u3044\u307f\u305f\u3044\u3002<br \/>\n\uff11\u4f4d\u306e\u5e83\u5cf6\u5e02\u5b89\u82b8\u533a\u306f\u98db\u5730\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u5206\u65ad\u3055\u308c\u305f\u3061\u3087\u3046\u3069\u9699\u9593\u306b\u5e97\u8217\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/tobichi20180521.png\" alt=\"\u5b89\u82b8\u533a\u98db\u5730\" width=\"678\" height=\"584\" class=\"alignnone size-full wp-image-6025 border\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/tobichi20180521.png 678w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2018\/05\/tobichi20180521-174x150.png 174w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<pre class=\"lang:js decode:true \" title=\"clac.js\" >const fs = require('fs');\nconst turf = require('@turf\/turf');\nconst geojson = JSON.parse(fs.readFileSync('html\/japan.geojson', 'utf8')); \n\n\nconst data = geojson.features.map(d =&gt; {\n    return d.properties;\n});\n\n\nconst haveMac = data.filter(d =&gt; d.mac_count &gt; 0);\nconst noMac = data.filter(d =&gt; !d.mac_count &gt; 0);\n\n\nconsole.log(\"\u30de\u30c3\u30af\u6709\u308a\u5730\u57df\", data.length);\nconsole.log(\"\u30de\u30c3\u30af\u7121\u3057\u5730\u57df\", data.length);\n\nconsole.log(\"\u30de\u30c3\u30af\u6709\u308a\u5730\u57df\u306e\u5272\u5408\", ~~((haveMac.length\/data.length) * 10000) \/100 + \"%\") \n\n\n\n\nconst output = function(arg ,flag){\n    arg.forEach( (d, i) =&gt; {\n        const ranking = i +1;\n        let address = [d[\"KEN\"],\"t\", d[\"GUN\"], d[\"SEIREI\"], d[\"SIKUCHOSON\"]].join(\"\"); \/\/null\u6d88\u3057\n        let str = `${ranking}\u4f4d ${address}tt${d.mac_count}\u5e97\u8217`;\n        if(flag) str += `t\u4eba\u53e3\uff1a${d.P_NUM}\u4eba`;\n        console.log(str);\n    })    \n}\n\n\nconsole.log(\"n\u5e97\u8217\u6570TOP10\")\nhaveMac.sort((a,b) =&gt; b.mac_count - a.mac_count)\nconst top10 = haveMac.slice(0, 10);\noutput(top10, false);\n\n\nconsole.log(\"n\u4e00\u4eba\u5f53\u305f\u308a\u5e97\u8217\u6570TOP10\")\nhaveMac.sort((a,b) =&gt; (b.mac_countd\/b.P_NUM) - (a.mac_count\/a.P_NUM) )\nconst top10perP = haveMac.slice(0, 10);\noutput(top10perP, true);\n\n\n\nconsole.log(\"n\u5e97\u8217\uff10\u5730\u57df\u4eba\u53e3TOP10\")\nnoMac.sort((a,b) =&gt; b.P_NUM - a.P_NUM )\nconst noMacTop10perP = noMac.slice(0, 10);\noutput(noMacTop10perP, true);\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5e02\u533a\u753a\u6751\u3054\u3068\u306e\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u5e97\u8217\u6570\u3067\u8272\u4ed8\u3051\u3057\u3066\u3044\u307e\u3059&hellip;<\/p>\n","protected":false},"author":1,"featured_media":6007,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,62],"tags":[],"class_list":["post-6004","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-leaflet-js","category-turf-js","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/6004","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=6004"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/6004\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/6007"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=6004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=6004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=6004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}