Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
APIつくってみた
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Satoshi Gachi Fujimoto
March 12, 2020
Technology
95
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
APIつくってみた
熊本GTFS-JP活用勉強会 vol.2の資料です。
https://kumamcn.connpass.com/event/169877/
Satoshi Gachi Fujimoto
March 12, 2020
More Decks by Satoshi Gachi Fujimoto
See All by Satoshi Gachi Fujimoto
忘年会LT(2025)
satoshirobatofujimoto
0
70
バスあと何分ミニサイネージ
satoshirobatofujimoto
0
150
高専で制御を、大学でセンシングを学び、次は脳みそ
satoshirobatofujimoto
0
340
画像生成AIを使って勝負しよう
satoshirobatofujimoto
1
190
ガチマナ会 vol.1
satoshirobatofujimoto
0
300
画像生成AIを使って勝負しよう
satoshirobatofujimoto
0
350
画像からプロンプトを考えて最も似ている画像を生成した人が勝ちのゲーム@AIミーティング
satoshirobatofujimoto
0
240
VPS研究者が語る”VPS概論”
satoshirobatofujimoto
0
520
画像からプロンプトを考えて最も似ている画像を生成した人が勝ちのゲーム
satoshirobatofujimoto
0
260
Other Decks in Technology
See All in Technology
購入ドメインでの課題と取り組み
ykagano
0
150
SREでアラート疲れを 解決しよう!
kairim0
1
210
データ品質を壊しながらSnowflakeのAIに分析させてみた
kawanago
0
540
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
200
メルペイ 会計システム概要と歴史
mewuto
0
190
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
220
More Freedom on the Same Shared GPU Cluster: A Small Team’s Experience with vCluster
nttcom
0
140
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
0
140
The seven pitfalls of AI (revised version)
ufried
0
290
使いこなすために知っておきたい Azure SRE Agent アンチパターン
torumakabe
2
410
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
私の推しは「聞いてから進む」AIです -AI-DLCに一人でアプリを作らせた話
yama3133
1
180
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
590
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Chasing Engaging Ingredients in Design
codingconduct
0
350
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
560
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Ruling the World: When Life Gets Gamed
codingconduct
0
390
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Statistics for Hackers
jakevdp
799
230k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
910
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
2020/03/12 熊本GTFS-JP活⽤勉強会 vol.2 APIつくってみた
⾃⼰紹介 ガチ本 です co-founder KumaMCN ナレッジコミュニケーション R&D戦略チーム AWS ML コンピテンシーパートナー
Microsoft Mixed Reality Partner CV / SLAM / WHILL / Python satoshi.gachi.fujimoto @sotongshi
API(Application Programming Interface)とは︖ • アプリケーションの⼀部を外部に公開して、 他のアプリケーションと繋ぐもの • データはjson形式でやりとり https://flow.microsoft.com/ja-jp/connectors/
Kuma GTFS API v1.0.2 • 仕様書 • http://ec2-18-180-6-76.ap-northeast-1.compute.amazonaws.com/ • 主な機能(※現在は産交バスのデータのみ対応)
• フィード情報取得 • 事業者情報取得 • 事業者追加情報取得 • 運⾏区分情報取得 • 運⾏⽇情報取得 • 営業所情報取得 • 経路情報取得 • 経路追加情報取得 • 停留所・標柱情報取得 • 翻訳情報取得 • 便情報取得
APIのつくり⽅ • AWS(Amazon Web Services) • Lambda • API Gateway
• DynamoDB • Step Functions • S3 AWS Cloud AWS Lambda Amazon API Gateway AWS Step Functions AWS Lambda AWS Lambda Amazon DynamoDB
DBの作成 • 12個のDBを作成するLambda関数(gtfs-create) • sankobus-feed-info • sankobus-agency • sankobus-agency-jp •
sankobus-calendar • sankobus-calendar-dates • sankobus-office-jp • sankobus-routes • sankobus-routes-jp • sankobus-stop-times • sankobus-translations • sankobus-trips
データの更新 • DBを更新するLambda関数(gtfs-update) • feed_info.txtからfeed_versionを取ってきて、DBの値と異なっていたら、更新する仕組み • データの⼤きいstops/stop_times/translations/tripsは1000件ずつ分けて保存 • 1回のLambdaの実⾏時間は15分まで、DynamoDBの書き込み速度(キャパシティ)も制限がある •
15分で5000件くらい書き込める • 並列実⾏はDBのキャパシティを超えるため不可能(※お⾦をかければ制限を超えられる • APIの応答時間は29秒なので、それを超えるような処理を実⾏したい場合はStepFunctionsを⽤いる • stop_timesは70万件ほどあるので1⽇かかるw
毎⽇更新されている︕
今後の展望 • DBをやめようかな • S3にデータを毎⽇ためる • データを差分とるやつを作ってみる
イベント告知 Kumamoto HoloLens ミートアップ vol.6 ⽇時︓2020/4/6(⽉)19:00-21:00 場所︓オンライン 参加費︓無料 登壇者︓@chomado @HoloMotoRanger
@sotongshi @Shota7Y
ご清聴ありがとうございました