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
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
420
Flow 不死:AI 時代 DevOps 的不變本質
cheng_wei_chen
2
320
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
1
2.5k
【NRUG vol.18】KubernetesにおけるNew Relicデータ取得量削減の考え方
nrug_member
0
170
2026年6月23日 Syncable Tech + Start Python Club にて
hamukazu
0
140
iAEONの段階的リアーキテクト戦略 / iAEON's_Gradual_Re-architecture_Strategy
aeonpeople
0
230
Oracle Cloud Infrastructure:2026年6月度サービス・アップデート
oracle4engineer
PRO
0
130
日本 Fintech 未来予測レポート 2027〜2028年(オリジナル版)
8maki
0
2.3k
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
3k
AIはどのように 組織のアジリティを変えるのか?
junki
4
1k
アジャイルな経理と Claude Code と経営の未来
kawaguti
PRO
3
160
2026TECHFRESH畢業分享會 - 原生還是跨平台? App 開發踩坑實錄
line_developers_tw
PRO
0
1.3k
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
240
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Code Reviewing Like a Champion
maltzj
528
40k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
Context Engineering - Making Every Token Count
addyosmani
9
970
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/