Geohashを使用したテストデータ。 nearly 

業務でgeohashを使ったシステムを作ってテストすることに。
誰もテストデータを作りたがらないので勉強がてら作成。

_APIの詳細_　
起点となるGeohashから距離の近い順のGeohashを５つ取得する。


_ゴール_
このAPIの動作を担保出来るテストデータの作成


_TOOL_
起点から対象のGeo周り２つ分の Geohashを取得するツールを作成
→ここは時間があれば記載。

一旦下記のTOOLを使用して対象のGeohashを確認

https://geohashsite.app/

https://geohash.softeng.co/xn6uxvxv


_テスト観点_
1. 起点内のGeohashに5件のデータを持つ。
別エリアのGeohashの方が、起点とから距離が近い。
    ![Viber_画像_2024-03-19_01-17-23-360.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3747836/0afb078f-4d40-6827-2a90-2b1d337b2737.jpeg)
    
    | latitude | longitude | Geohash | Property |
    |:---------|----------:|:-------:|:--------:|
    | 36.0252  | 139.89025 | xn7kz   | 3.00 km  |
    | 36.01989 | 139.89664 | xn7kz   | 2.76 km  |
    | 36.00902 | 139.90557 | xn7kz   | 3.19 km  |
    | 35.99729 | 139.87931 | xn7kz   | 5.63 km  |
    | 35.99177 | 139.87909 | xn7kz   | 6.10 km  |
    | 36.04158 | 139.91123 | xn7mp   | 1.20 km  |
    | 36.07554 | 139.88205 | xn7mp   | 5.79 km  |
    | 36.04297 | 139.93063 | xn7t0   | 1.24 km  |
    | 36.02641 | 139.93218 | xn7sb   | 1.34 km  |
    | 35.99447 | 139.83811 | xn7ky   | 8.73 km  |





2. 起点内のGeohashに5件のデータを持つ。
エリアが離れたGeohashの方が、起点と同じGeohash内の対角線のピンより距離が近い。
    ![Viber_画像_2024-03-19_01-52-01-886.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3747836/5cbcf35d-47f7-6365-0d14-abf2d76af7c5.jpeg)

    | latitude | longitude | Geohash | Property |
    |:---------|----------:|:-------:|:--------:|
    | 36.0252  | 139.89025 | xn7kz   | 3.00 km  |
    | 36.01989 | 139.89664 | xn7kz   | 2.76 km  |
    | 36.00902 | 139.90557 | xn7kz   | 3.19 km  |
    | 35.99729 | 139.87931 | xn7kz   | 5.63 km  |
    | 35.99177 | 139.87909 | xn7kz   | 6.10 km  |
    | 36.03419 | 139.96685 | xn7sc   | 4.09 km  |
    | 36.0792  | 139.92149 | xn7mr   | 4.97 km  |



3. 起点の5桁のGeohash内に対象のデータが5件以上あるが
3桁のGeohash内のポイントの方が距離が近い。
    ![Viber_画像_2024-03-19_01-53-07-601.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3747836/8b7dc119-af7b-35d1-a33a-bcd5c0232cbd.jpeg)

    | latitude | longitude | Geohash | Property   |
    |:---------|----------:|:-------:|:----------:|
    | 36.02543 | 139.90813 | xn7kz   | 1.00 km    |
    | 35.89006 | 139.76219 | xn7kh   | 21.6 km    |
    | 36.12335 | 139.7718  | xn7ms   | 16.7 km    |
    | 36.1264  | 140.02792 | xn7td   | 14.0 km    |
    | 35.18096 | 140.37677 | xn7h8   | 104.00 km  |
    | 36.03144 | 138.86639 | xn6sz   | 95.00 km   |


_Google my map_
今回Google my mapを使用して、実際の地図上にピンを打った。
何故Google my mapを使用したかと説明すると
まず、このテストデータを単純な英数字のGeohashから計算することが不可能だった。（人間の脳ではおそらく不可能）
また、独自のツールを作成を試みたがGoogle map上に任意のオブジェクトを置くのは
有料のKeyを持っていないと出来なかった為、断念。
おそらく作成できていてもGoogl my mapのUIには敵わなかったので結果よしとした。
今回データ作成に試行錯誤を色々して１週間ほどかかってしまったが
この記事を呼んでいる方の為に（未来の自分の為にも）
Google my map上で読み込めるcsvファイルを記載します。
ここにはGoogle my map上にGeohashのデータとピンが埋め込まれているので自由に使って下さい。


- geohash-geohash_Test_.csv

```
WKT,名前,説明
"POINT (139.70214 35.66167)",35.66167 139.70214,
"POINT (139.691162 35.66167)",35.66167 139.691162,
"POINT (139.70214 35.656127)",35.656127 139.70214,
"POINT (139.691162 35.656127)",35.656127 139.691162,
"POLYGON ((139.691162 35.66167, 139.691162 35.656127, 139.70214 35.656127, 139.70214 35.66167, 139.691162 35.66167))",xn76fg,xn76fg
"POINT (139.680175 35.656127)", 35.656127 139.680175,
"POINT (139.68017 35.661621)", 35.661621, 139.68017,
"POLYGON ((139.68017 35.661621, 139.680175 35.656127, 139.691162 35.656127, 139.691162 35.66167, 139.68017 35.661621))",xn76fe,
"POINT (139.669189 35.656127)", 35.656127 139.669189,
"POINT (139.669189 35.661621)",35.661621 139.669189,
"POLYGON ((139.669189 35.661621, 139.669189 35.656127, 139.680175 35.656127, 139.68017 35.661621, 139.669189 35.661621))",xn76f7,
"POINT (139.680175 35.650634)",35.650634 139.680175,
"POINT (139.691162 35.650634)",35.650634 139.691162,
"POINT (139.669189 35.650634)",35.650634 139.669189,
"POLYGON ((139.669189 35.656127, 139.669189 35.650634, 139.680175 35.650634, 139.680175 35.656127, 139.669189 35.656127))",xn76f6,
"POINT (139.70214 35.650634)",35.650634 139.70214,
"POLYGON ((139.691162 35.650634, 139.70214 35.650634, 139.70214 35.656127, 139.691162 35.656127, 139.691162 35.650634))",xn76ff,
"POINT (139.702148 35.645141)",35.645141 139.702148,
"POINT (139.691162 35.645141)",35.645141  139.691162,
"POINT (139.680175 35.645141)",35.645141 139.680175,
"POLYGON ((139.680175 35.650634, 139.680175 35.645141, 139.691162 35.645141, 139.691162 35.650634, 139.680175 35.650634))",xn76f9,
"POINT (139.669189 35.645141)",35.645141 139.669189,
"POLYGON ((139.669189 35.650634, 139.669189 35.645141, 139.680175 35.645141, 139.680175 35.650634, 139.669189 35.650634))",xn76f3,
"POLYGON ((139.680175 35.656127, 139.680175 35.650634, 139.691162 35.650634, 139.691162 35.656127, 139.680175 35.656127))",xn76fd,
"POINT (139.658203 35.656127)",35.656127, 139.658203,
"POINT (139.6582 35.661621)",35.661621 139.6582,
"POLYGON ((139.6582 35.661621, 139.658203 35.656127, 139.669189 35.656127, 139.669189 35.661621, 139.6582 35.661621))",xn76f5,
"POINT (139.691162 35.639648)",35.639648 139.691162,
"POINT (139.702148 35.639648)",35.639648 139.702148,
"POLYGON ((139.691162 35.645141, 139.691162 35.639648, 139.702148 35.639648, 139.702148 35.645141, 139.691162 35.645141))",xn76fb,
"POLYGON ((139.70214 35.650634, 139.691162 35.650634, 139.691162 35.645141, 139.702148 35.645141, 139.70214 35.650634))",xn76fc,
"POINT (139.680175 35.639648)",35.639648 139.680175,
"POLYGON ((139.680175 35.639648, 139.691162 35.639648, 139.691162 35.645141, 139.680175 35.645141, 139.680175 35.639648))",xn76f8,
"POINT (139.669189 35.639648)",35.639648  139.669189,
"POLYGON ((139.669189 35.645141, 139.669189 35.639648, 139.680175 35.639648, 139.680175 35.645141, 139.669189 35.645141))",xn76f2,
"POINT (139.658203 35.639648)",35.639648 139.658203,
"POINT (139.658203 35.645141)",35.645141 139.658203,
"POLYGON ((139.658203 35.645141, 139.658203 35.639648, 139.669189 35.639648, 139.669189 35.645141, 139.658203 35.645141))",xn76f0,
"POINT (139.658203 35.650634)",35.650634 139.658203,
"POLYGON ((139.658203 35.650634, 139.658203 35.645141, 139.669189 35.645141, 139.669189 35.650634, 139.658203 35.650634))",xn76f1,
"POLYGON ((139.669189 35.656127, 139.658203 35.656127, 139.658203 35.650634, 139.669189 35.650634, 139.669189 35.656127))",xn76f4,
"POINT (139.702148 35.667114)", 35.667114 139.702148,
"POINT (139.691162 35.667114)", 35.667114 139.691162,
"POLYGON ((139.691162 35.667114, 139.691162 35.66167, 139.70214 35.66167, 139.702148 35.667114, 139.691162 35.667114))",xn76fu,
"POINT (139.680175 35.667114)",35.667114 139.680175,
"POLYGON ((139.68017 35.661621, 139.691162 35.66167, 139.691162 35.667114, 139.680175 35.667114, 139.68017 35.661621))",xn76fs,
"POINT (139.669189 35.667114)",35.667114 139.669189,
"POLYGON ((139.669189 35.667114, 139.669189 35.661621, 139.68017 35.661621, 139.680175 35.667114, 139.669189 35.667114))",xn76fk,
"POINT (139.658203 35.667114)",35.667114 139.658203,
"POLYGON ((139.6582 35.661621, 139.669189 35.661621, 139.669189 35.667114, 139.658203 35.667114, 139.6582 35.661621))",xn76fh,
"POINT (139.647216 35.667114)",35.667114 139.647216,
"POINT (139.647216 35.661621)",35.661621  139.647216,
"POLYGON ((139.647216 35.667114, 139.647216 35.661621, 139.6582 35.661621, 139.658203 35.667114, 139.647216 35.667114))",xn76cu,
"POINT (139.647216 35.656127)",35.656127 139.647216,
"POLYGON ((139.647216 35.661621, 139.647216 35.656127, 139.658203 35.656127, 139.6582 35.661621, 139.647216 35.661621))",xn76cg,
"POINT (139.647216 35.650634)",35.650634 139.647216,
"POLYGON ((139.647216 35.650634, 139.658203 35.650634, 139.658203 35.656127, 139.647216 35.656127, 139.647216 35.650634))",xn76cf,
"POINT (139.647216 35.645141)",35.645141 139.647216,
"POLYGON ((139.647216 35.650634, 139.647216 35.645141, 139.658203 35.645141, 139.658203 35.650634, 139.647216 35.650634))",xn76cc,
"POLYGON ((139.6471865 35.6396328, 139.658203 35.639648, 139.658203 35.645141, 139.647216 35.645141, 139.6471865 35.6396328))",xn76cb,
"POINT (139.647216 35.639648)",35.639648 139.647216,
"POINT (139.6659721 35.6706406)",ポイント 62,
"POLYGON ((139.790039 36.123046, 139.790039 36.079101, 139.833984 36.079101, 139.833984 36.123046, 139.790039 36.123046))",xn7mm,
"POLYGON ((139.833984 36.123046, 139.833984 36.079101, 139.877929 36.079101, 139.877929 36.123046, 139.833984 36.123046))",xn7mq,
"POLYGON ((139.877929 36.123046, 139.877929 36.079101, 139.921875 36.079101, 139.921875 36.123046, 139.877929 36.123046))",xn7mr,
"POLYGON ((139.921875 36.123046, 139.921875 36.079101, 139.96582 36.079101, 139.96582 36.123046, 139.921875 36.123046))",xn7t2,
"POLYGON ((139.96582 36.123046, 139.96582 36.079101, 140.009765 36.079101, 140.009765 36.123046, 139.96582 36.123046))",xn7t3,
"POLYGON ((139.790039 36.079101, 139.790039 36.035156, 139.833984 36.035156, 139.833984 36.079101, 139.790039 36.079101))",xn7mj,
"POLYGON ((139.833984 36.079101, 139.833984 36.035156, 139.877929 36.035156, 139.877929 36.079101, 139.833984 36.079101))",xn7mn,
"POLYGON ((139.877929 36.079101, 139.877929 36.035156, 139.921875 36.035156, 139.921875 36.079101, 139.877929 36.079101))",xn7mp,
"POLYGON ((139.921875 36.079101, 139.921875 36.035156, 139.96582 36.035156, 139.96582 36.079101, 139.921875 36.079101))",xn7t0,
"POLYGON ((139.96582 36.079101, 139.96582 36.035156, 140.009765 36.035156, 140.009765 36.079101, 139.96582 36.079101))",xn7t1,
"POLYGON ((139.790039 36.035156, 139.790039 35.99121, 139.833984 35.99121, 139.833984 36.035156, 139.790039 36.035156))",xn7kv,
"POLYGON ((139.833984 36.035156, 139.833984 35.99121, 139.877929 35.99121, 139.877929 36.035156, 139.833984 36.035156))",xn7ky,
"POLYGON ((139.877929 36.035156, 139.877929 35.99121, 139.921875 35.99121, 139.921875 36.035156, 139.877929 36.035156))",xn7kz,
"POLYGON ((139.921875 36.035156, 139.921875 35.99121, 139.96582 35.99121, 139.96582 36.035156, 139.921875 36.035156))",xn7sb,
"POLYGON ((139.96582 36.035156, 139.96582 35.99121, 140.009765 35.99121, 140.009765 36.035156, 139.96582 36.035156))",xn7sc,
"POLYGON ((139.790039 35.99121, 139.790039 35.947265, 139.833984 35.947265, 139.833984 35.99121, 139.790039 35.99121))",xn7kt,
"POLYGON ((139.833984 35.99121, 139.833984 35.947265, 139.877929 35.947265, 139.877929 35.99121, 139.833984 35.99121))",xn7kw,
"POLYGON ((139.877929 35.99121, 139.877929 35.947265, 139.921875 35.947265, 139.921875 35.99121, 139.877929 35.99121))",xn7kx,
"POLYGON ((139.921875 35.99121, 139.921875 35.947265, 139.96582 35.947265, 139.96582 35.99121, 139.921875 35.99121))",xn7s8,
"POLYGON ((139.96582 35.99121, 139.96582 35.947265, 140.009765 35.947265, 140.009765 35.99121, 139.96582 35.99121))",xn7s9,
"POLYGON ((139.790039 35.947265, 139.790039 35.90332, 139.833984 35.90332, 139.833984 35.947265, 139.790039 35.947265))",xn7km,
"POLYGON ((139.833984 35.947265, 139.833984 35.90332, 139.877929 35.90332, 139.877929 35.947265, 139.833984 35.947265))",xn7kq,
"POLYGON ((139.877929 35.947265, 139.877929 35.90332, 139.921875 35.90332, 139.921875 35.947265, 139.877929 35.947265))",xn7kr,
"POLYGON ((139.921875 35.947265, 139.921875 35.90332, 139.96582 35.90332, 139.96582 35.947265, 139.921875 35.947265))",xn7s2,
"POLYGON ((139.96582 35.947265, 139.96582 35.90332, 140.009765 35.90332, 140.009765 35.947265, 139.96582 35.947265))",xn7s3,
"POLYGON ((139.921875 36.123046, 139.921875 36.035156, 140.009765 36.035156, 140.009765 36.123046, 139.921875 36.123046))",xn7t,
"POLYGON ((139.790039 36.123046, 139.790039 36.035156, 139.921875 36.035156, 139.921875 36.123046, 139.790039 36.123046))",xn7m,
"POLYGON ((139.921875 36.0350172, 139.921875 35.9031812, 140.0097649 35.9031812, 140.0097649 36.0350172, 139.921875 36.0350172))",xn7s,
"POINT (139.9214315 36.0346073)",起点,
"POINT (139.762193 35.8900647)",dealer_id : 90,
"POINT (139.7718074 36.1233533)",dealer_id : 91,
"POINT (140.0279264 36.1264029)",dealer_id : 92,
"POINT (140.3767776 35.180969)",dealer_id : 93,
"POINT (139.9136788 36.0185575)",ポイント 128,
"POINT (139.9081334 36.0254392)",dealer_id : 89,
"POINT (138.86639 36.03144)",dealer_id : 94,
"POINT (139.8790955 35.9917709)",dealer_id : 5,
"POINT (139.8793101 35.9972917)",dealer_id : 4,
"POINT (139.8966481 36.0198914)",dealer_id : 2,
"POINT (139.9668574 36.0341921)",dealer_id : 43,
"POINT (139.9214962 36.0792088)",dealer_id : 44,
"POINT (139.9321818 36.0264169)",dealer_id : 9,
"POINT (139.9112391 36.0415837)",dealer_id : 6,
"POINT (139.9306369 36.0429717)",dealer_id : 8,
"POINT (139.833984 35.99121)",35.991210 139.833984,
"POINT (139.877929 36.079101)",36.079101 139.877929,
"POLYGON ((139.7900389 36.0352948, 139.7900389 35.9034588, 139.9218751 35.9034588, 139.9218751 36.0352948, 139.7900389 36.0352948))",xn7k,
"POINT (139.9055749 36.0090243)",dealer_id : 3,
"POINT (139.8902535 36.025202)",dealer_id : 1,
"POINT (139.8820567 36.0755466)",dealer_id : 7,
"POINT (139.8381114 35.9944778)",dealer_id : 10,
"POINT (139.921875 36.079101)",36.079101 139.921875,
"POINT (139.921875 36.035156)",36.035156 139.921875 ,
"POINT (139.877929 35.90332)",35.903320 139.877929,
"POINT (139.921875 35.90332)",35.903320 139.921875 ,
"POINT (139.833984 35.90332)",35.903320 139.833984,
"POINT (139.790039 35.90332)",35.903320 139.790039,
"POINT (139.96582 35.90332)",35.903320 139.965820,
"POINT (140.009765 35.90332)",35.903320 140.009765,
"POINT (140.009765 35.947265)",35.947265 140.009765,
"POINT (139.96582 35.947265)",35.947265 139.965820,
"POINT (139.921875 35.947265)",35.947265 139.921875,
"POINT (139.877929 35.947265)",35.947265 139.877929,
"POINT (139.833984 35.947265)",35.947265 139.833984,
"POINT (139.790039 35.947265)",35.947265 139.790039,
"POINT (139.790039 35.99121)",35.991210 139.790039,
"POINT (139.877929 35.99121)",35.991210 139.877929,
"POINT (139.921875 35.99121)",35.991210 139.921875,
"POINT (139.96582 35.99121)",35.991210 139.965820,
"POINT (140.009765 35.99121)",35.991210 140.009765,
"POINT (140.009765 36.035156)",36.035156 140.009765,
"POINT (139.96582 36.035156)",36.035156 139.965820,
"POINT (139.877929 36.035156)",36.035156 139.877929,
"POINT (139.833984 36.035156)",36.035156 139.833984,
"POINT (139.790039 36.035156)",36.035156 139.790039,
"POINT (139.790039 36.079101)",36.079101 139.790039,
"POINT (139.833984 36.079101)",36.079101 139.833984,
"POINT (139.96582 36.079101)",36.079101 139.965820,
"POINT (140.009765 36.079101)",36.079101 140.009765,
"POINT (140.009765 36.123046)",36.123046 140.009765,
"POINT (139.96582 36.123046)",36.123046 139.965820,
"POINT (139.921875 36.123046)",36.123046 139.921875,
"POINT (139.877929 36.123046)",36.123046 139.877929,
"POINT (139.833984 36.123046)",36.123046 139.833984,
"POINT (139.790039 36.123046)",36.123046 139.790039,

```