iOS

위치정보를 읽어와서 geohash로 가공 하기(geohash-2)

@서비 2022. 1. 18. 01:37

우선 info.plist에 위치정보 권한을 추가합니다.

사용하는 조건에 따라 몇 가지가 있는데 필요에 따라 맞추어 추가하면 됩니다.

info.plist
info.plist

 

지난번 작성했던 geohash 에 위치정보 가져오는 코드를 작성하여 이어 붙이면 

나의 위치는 37.785...,-122.406... 로 나오고 geohash는 9q8yywdq7 로 나옵니다.

source code

 

내 위치가 어디 인지 찾아보면 나는 샌프란 시스코에 있습니다. 

 

 

내가 찾은 위도가 맞나 검색 해보니 스텍오버플로우에 simulator는 default 가 san fran 이고 설정에서 변경 가능하다고 하다.

 

 

 

 

참고

지오헤시 검색을 제공하는 사이트

https://www.movable-type.co.uk/scripts/geohash.html

 

Geohash encoding/decoding

Movable Type Scripts Geohashes A geohash is a convenient way of expressing a location (anywhere in the world) using a short alphanumeric string, with greater precision obtained with longer strings. A geohash actually identifies a rectangular cell: at each

www.movable-type.co.uk

 

검색해보았던 스텍오버플로우

https://stackoverflow.com/questions/25460438/wrong-location-located-in-san-francisco-and-not-in-france

 

ios코드 참고

https://velog.io/@sso0022/iOS-%EC%9C%84%EC%B9%98%EC%A0%95%EB%B3%B4-%EC%95%8C%EC%95%84%EB%B3%B4%EA%B8%B0-%EC%9C%84%EB%8F%84%EA%B2%BD%EB%8F%84

 

 

2022.01.17 - [iOS] - Geohash-1

 

Geohash-1

위치정보를 표시할 때, 보통 위도, 경도를 표시하는데, 이것을 해시해서 일련의 문자열로 바꾼 게 geohash이다. 재밌는 것은 글자 길이가 분해능 (얼마나 자세히 표시하는지)이고, 앞의 해시 글자

iosdevhistory.tistory.com