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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
690
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
大 AI 時代におけるC# の事情 ~ぶっちゃけトークを交えながら~
nenonaninu
1
180
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
2
290
Aurora MySQL 8.4リリース! Rubyistが備えること / what-rubyist-should-prepare-for-aurora-mysql-8-4
fkmy
0
1.2k
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
1
380
穢れた技術選定について
watany
20
6.2k
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
270
ファミコンでPHPを動かす / PHP on the Famicom
tomzoh
2
640
AWS環境のセキュリティ不安を解消した企業事例 ~よくある課題と対策を一挙公開~
asanoharuki
0
160
StepFunctionsとGraphRAGを活用した暗黙知活用のためのRAG基盤
yakumo
0
170
AI時代の開発生産性を捉え直す — 経営と現場をつなぐ「開発組織のオブザーバビリティ」— / AI Dev Ex Conference 2026
tkyowa
1
1.5k
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
250
SRENEXT_2026_Chairs__Talks_in_Tamachi.sre.pdf
srenext
1
160
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
sira's awesome portfolio website redesign presentation
elsirapls
0
310
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Tell your own story through comics
letsgokoyo
1
1k
Producing Creativity
orderedlist
PRO
348
40k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
The Language of Interfaces
destraynor
162
27k
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/