- GeoJSONのPointを指定半径(例:500m)の円で表示したい。
- このためだけのツールを作るより、GeoJSONファイルを指定して表示するサイトにしたい。
- https://geojson.io では、PointはMarkerで表示される。
- (draw toolで円を作るとPolygonが生成される)
- https://kepler.gl では半径指定はpixel単位?
- LeafletのL.Circleを使えばメートル単位で半径指定可能。
- deck.glのGeoJsonLayerのpointRadiusUnitsはデフォルトでmeters。
- foliumのTimestampedGeoJsonでは、
{{"properties": {"icon": "circle","iconstyle":{"radius":10}}},"geometry":{"type":"Point",...}}は、L.CircleMarkerで表示される。半径はpixel単位。
- foliumのTimestampedGeoJsonをベースに、メートル単位での半径指定用プロパティ
"radiusUnit":"meter"を追加:{{"properties": {"icon": "circle","iconstyle":{"radius":500,"radiusUnit":"meter"}}},"geometry":{"type":"Point",...}} - https://deton.github.io/HeatMapWithTime/MarkerStyleWithTime.html に、
"radiusUnit": "meter"の場合はL.Circleを使って円を表示する処理を追加。
- Pointを円相当のポリゴンに変換するツール。
- 今回は表示したいだけだったので不採用。
https://github.com/MIERUNE/japan-mesh-tool
poetry run python src/japanmesh/main.py 3 -e 142.2,44.0 142.3,44.1 -d ./jq -s '{type:"FeatureCollection",features:.}' mesh_3.geojsonl > mesh_3.geojsonjq -c '{type,properties:{code:.properties.code,icon:"circle",iconstyle:{radius:500,radiusUnit:"meter"},popup:.properties.code|tostring},geometry:{type:"Point",coordinates:.geometry.coordinates[0][0]}}' mesh_3.geojsonl \
| jq -s '{type:"FeatureCollection",features:.}' > mesh_3circle.geojson