1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

wslでnervesAdvent Calendar 2023

Day 3

wslでnerves その30

Last updated at Posted at 2023-11-22

概要

wsl(wsl2じゃない)でnervesやってみる。
qemu(x86_64エミュレータ、ラズパイじゃない)でやってみた。
生成したnerves_livebook.imgを、quemで起動してテストしてみた。
練習問題、やってみた。

練習問題

geoを使え。

写真

image.png

セットアップ

Mix.install([
  {:jason, "~> 1.4"},
  {:geo, "~> 3.4"}
])

サンプルコード

geojson
|> Jason.decode!() 
|> then(fn x ->
  x
  |> Map.get("features")
  |> Enum.map(fn i ->
    i
    #|> Map.get("geometry")
    |> Geo.JSON.decode!()
    |> IO.inspect()
  end)
end)

実行結果

%Geo.Point{
  coordinates: {140.151111, 37.929687},
  srid: nil,
  properties: %{"name" => "オートショップユニット"}
}
%Geo.Point{
  coordinates: {140.109344, 37.92922},
  srid: nil,
  properties: %{"name" => "(株)エイジュウプロ"}
}
%Geo.Point{
  coordinates: {140.093108, 37.923453},
  srid: nil,
  properties: %{"name" => "(株)ホンダウイングロードショウ"}
}
%Geo.Point{
  coordinates: {140.112004, 37.911333},
  srid: nil,
  properties: %{"name" => "(有)カーセンター葵商会"}
}
%Geo.Point{
  coordinates: {140.108036, 37.907591},
  srid: nil,
  properties: %{"name" => "塚本サイクル"}
}
%Geo.Point{
  coordinates: {140.114247, 37.928429},
  srid: nil,
  properties: %{"name" => "サイクルショップ川口"}
}
%Geo.Point{
  coordinates: {140.099879, 37.916279},
  srid: nil,
  properties: %{"name" => "サイクルショップ中村"}
}
%Geo.Point{
  coordinates: {140.101416, 37.917854},
  srid: nil,
  properties: %{"name" => "菅原商会"}
}
%Geo.Point{
  coordinates: {140.108688, 37.912485},
  srid: nil,
  properties: %{"name" => "サイクルセンター卯月"}
}
%Geo.Point{
  coordinates: {140.105914, 37.912049},
  srid: nil,
  properties: %{"name" => "ホンダ野村モータース"}
}
%Geo.Point{
  coordinates: {140.103534, 37.869915},
  srid: nil,
  properties: %{"name" => "モーターハウスK"}
}
%Geo.Point{
  coordinates: {140.109289, 37.918955},
  srid: nil,
  properties: %{"name" => "ライダースサロン・ヤマカ"}
}
%Geo.Point{
  coordinates: {140.108313, 37.915746},
  srid: nil,
  properties: %{"name" => "中央ホンダ"}
}
%Geo.Point{
  coordinates: {140.107225, 37.905011},
  srid: nil,
  properties: %{"name" => "香澄ホンダ"}
}
%Geo.Point{
  coordinates: {140.123328, 37.912663},
  srid: nil,
  properties: %{"name" => "佐藤オート商会"}
}
%Geo.Point{
  coordinates: {140.121636, 37.910789},
  srid: nil,
  properties: %{"name" => "香坂輪店"}
}
%Geo.Point{
  coordinates: {140.125682, 37.958525},
  srid: nil,
  properties: %{"name" => "斎藤モータース"}
}
%Geo.Point{
  coordinates: {140.11782, 37.956678},
  srid: nil,
  properties: %{"name" => "ニューホンダ石山"}
}
%Geo.Point{
  coordinates: {140.131694, 37.903901},
  srid: nil,
  properties: %{"name" => "二輪屋たかはし"}
}
%Geo.Point{
  coordinates: {140.104554, 37.886019},
  srid: nil,
  properties: %{"name" => "夢工場"}
}
%Geo.Point{
  coordinates: {140.103239, 37.874814},
  srid: nil,
  properties: %{"name" => "あべ輪店"}
}
%Geo.Point{
  coordinates: {140.137379, 37.905055},
  srid: nil,
  properties: %{"name" => "レッドバロン米沢"}
}

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?