Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GeoLocationAnchor and MKTileOverlay
Search
Tachibana Kaoru
June 22, 2022
Technology
400
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GeoLocationAnchor and MKTileOverlay
Tachibana Kaoru
June 22, 2022
More Decks by Tachibana Kaoru
See All by Tachibana Kaoru
Custom Group Activities
toyship
3
1.5k
Synchronized iPhones, Again!
toyship
2
1.7k
ARKit4.pdf
toyship
1
2.3k
Custom Gesture Recognizer on iOS
toyship
3
1.5k
HEVC Video with Alpha Channel
toyship
1
1.3k
RealityKit & Reality Composer
toyship
3
680
ARKit3
toyship
4
7.6k
UIViewPropertyAnimator and Easing
toyship
2
1.2k
Synchronized iPhones!
toyship
3
5k
Other Decks in Technology
See All in Technology
秘密度ラベル初心者が第1歩でつまづかないための「設計・運用」ポイント
seafay
PRO
0
200
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
13
5.1k
2026TECHFRESH畢業分享會 - Lightning Talk - 打造精準高效的 MCP 設計模式與測試實務
line_developers_tw
PRO
0
1.3k
Kubernetesにおける学習基盤とLLMOpsの概要
ry
1
320
【2026年版】 ベクトル検索とEmbedding最前線
mocobeta
16
4.1k
2026TECHFRESH畢業分享會 - Lightning Talk - E起 See See : 電商推薦讀心術? 數據說了算
line_developers_tw
PRO
0
1.3k
200個のGitHubリポジトリを横断調査したかった
icck
0
140
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
170
現地で盛り上がった WWDC26 Keynote
zozotech
PRO
1
270
20260619 私の日常業務での生成 AI 活用
masaruogura
1
230
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
8
1.9k
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
300
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
Optimizing for Happiness
mojombo
378
71k
Mobile First: as difficult as doing things right
swwweet
225
10k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
250
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
140
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
Git: the NoSQL Database
bkeepers
PRO
432
67k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
400
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
370
Transcript
GeoLocationAnchor and MKTileOverlay @TachibanaKaoru 2022/6/22 #potatotips 78
About Me @TachibanaKaoru Freelance iOS Engineer
What's new ARKit 6 4K Video Mode RoomPlan Location Anchor
RoomPlan ެࣜαϯϓϧίʔυ͋Γ
GeoLocation (AR Anchor) Introduced 2020 (ARKit 4) ൃදॳ͑ͨॴ αϯϑϥϯγείɺγΧΰɺϚΠΞϛɺχϡʔ ϤʔΫɺϩαϯθϧεͷΈɻ
ରҬΛ૿͢༧ఆͱ͍͍ͳ͕ΒɺʢCovid19ͷӨڹ͋Γʣͳ͔ ͳ͔૿͑·ͤΜͰͨ͠ɻ
AR Anchor Available Place WWDC 2022Ͱɺେ෯ʹରҬΛ֦େ͠ɺͬͱຊʹରԠҬ͕ ͖·ͨ͠ɻ Ԭɺౡɺେࡕɺژɺ໊ݹɺԣɺ౦ژ
AR Anchorͱ ҐஔʢҢ/ܦʣΛࢦఆͯ͠ΞϯΧʔΛ͓͘͜ͱ͕ Ͱ͖Δ ࣮ࡍͷݐͷ3DใͱɺΧϝϥը૾͔Βੳͨ͠3D ใͱɺͷGPSใΛΈ߹ΘͤͨΈ ඇৗʹਖ਼֬ͳҐஔଌఆ͕Մೳ ARҐஔܥήʔϜɺಓҊͳͲ͕؆୯ʹ࣮Մೳ
GeoLocation : check availability var targetLocation = CLLocationCoordinate2D() targetLocation.latitude =
lat targetLocation.longitude = long ARGeoTrackingConfiguration.checkAvailability( at: targetLocation, completionHandler: { (available, error) in // check available })
GeoLocation : check availability available ͕ trueͷ߹ʹ༻Մೳɻ available ͕ falseͷ߹ʹ༻ෆՄೳ͕ͩɺΤϥʔίʔυͰཧ༝Λ֬ೝ
͢Δ͜ͱ Error Code = 201 "Geo tracking is not available at this location." Error Code = 501 "Request failed." ʢϦΫΤετස͕ߴ͍ͱൃੜʣ
zoom 10 ௐࠪ : 2022/6/22 ௐࠪϙΠϯτɿ֤άϦουͷதԝ Latitude : 34.710809-37.050435 Longitude:
137.726092-140.887614
zoom 11 ௐࠪ : 2022/6/22 ௐࠪϙΠϯτɿ֤άϦουͷதԝ Latitude : 34.710809-37.050435 Longitude:
137.726092-140.887614
zoom 12 ௐࠪ : 2022/6/22 ௐࠪϙΠϯτɿ֤άϦουͷதԝ Latitude : 34.710809-37.050435 Longitude:
137.726092-140.887614
Available Place in Kanto Area ͬ͘͟Γݍԝಓɾࠃಓ468ͷଆͷࢢ֗ https://ja.wikipedia.org/wiki/टݍதԝ࿈བྷࣗಈंಓ
MKTileOverlay ~iOS 7.0 MKMapViewʹใΛΦʔόʔϨΠͰ දࣔ͢Δ͜ͱ͕Ͱ͖Δɻ
MKTileOverlay TileʹରԠͨ͠ใGoogle MapࠃཧӃͳͲ͔Βఏڙ͞Ε͍ͯ Δɻ MKTileOverlayʹɺTileରԠͨ͠API pathΛ͚ͩ͢ͰλΠϧΛදࣔ͢Δ͜ ͱՄೳ ྫɿࠃཧӃʢ୶৭ਤʣ https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png
λΠϧͱʁ ਤΛ zoom level ʹԠׂͯ͡͠ɺͦΕΛඞཁʹԠͯ͡৴ɾར༻͢Δɻ zoom level 0 -> 1
tile zoom level 1 -> 4 tiles zoom level 2 -> 16 tiles ... zoom level 10 -> 1048576 tiles zoom level n -> (2^n)^2
Tile Position ٿ্ͷಛఆͷ࠲ඪ͕ɺͲͷλΠϧʹҐஔ͢Δͷ͔ longitude = 135.0 latitude = 35.0
Longitude to x ܦͰTileͷx͕ܾ·Δ zoom level 2 -> 16 tiles
longitude = 135.0 ܦ0Λج४ͱ͠ɺٿ໘Λ 8ׂ͢Δ 0 long = 0 1 2 3 4 5 6 7 long = 135 ͔ΒΈͨٿ
Latitude to y ҢͰTileͷy͕ܾ·Δ zoom level 2 -> 16 tiles
latitude = 35.0 ۃΛج४ͱ͠ɺٿ໘Λ8 ׂ͢Δ 5 1 2 3 4 0 6 7 lat = 35 ԣ͔ΒΈͨٿ
let res = initialResolution / pow(2,zoom) let originShift = 2
* Double.pi * 6378137 / 2.0 var my = log( tan((90 + lat) * Double.pi / 360.0 )) / (Double.pi / 180.0) let py = (my + self.originShift) / res let tms_y = Int( ceil( py / Double(self.tileSize) ) - 1 ) let google_y = Int(pow(2, zoom) - 1 ) - tms_y ignore y = Rln(tan( π 4 + ϕ 2 )) 85.1°
Reference ࠃཧӃɹཧӃλΠϧʹ͍ͭͯ https://maps.gsi.go.jp/development/siyou.html ਤӨ๏ֶशͷͨΊͷਤը૾ૉࡐू https://user.numazu-ct.ac.jp/~tsato/tsato/graphics/map_projection/ άʔάϧϚοϓͷλΠϧ https://maptiler.jp/google-maps-coordinates-tile-bounds-projection/