Upgrade to Pro — share decks privately, control downloads, hide ads and more …

マピオン、ベクタータイルはじめました

 マピオン、ベクタータイルはじめました

FOSS4G 2017 Hokkaido の発表資料です

Dfa36f596af5e15d0b28bac7516b1f81?s=128

One compath

July 01, 2017
Tweet

More Decks by One compath

Other Decks in Technology

Transcript

  1. ϚϐΦϯ ϕΫλʔλΠϧ ͸͡Ί·ͨ͠ גࣜձࣾϚϐΦϯɹਗ਼ਫचཬ FOSS4G 2017 HOKKAIDO

  2. ਗ਼ਫचཬʢ͠Έͣ͡ΎΓʣ ৽ଔͰ๭ෆಈ࢈ձࣾʹೖࣾ ɹ→͍Ζ͍Ζ͋ͬͯ̍೥Ͱୀ৬ ๭SIerʹస৬ ɹ→͍Ζ͍Ζ͋ͬͯ̔೥Ͱୀ৬ גࣜձࣾϚϐΦϯೖࣾ̐೥໨ ओʹ஍ਤλΠϧͷੜ੒ͱ഑৴Λ୲౰ ࣗݾ঺հ

  3. ϚϐΦϯͱ͸

  4. 1996೥ʹ೔ຊॳͷ஍ਤΠϯλʔωοταʔϏεΛ։࢝

  5. ໊শɹɹɹ ɿ גࣜձࣾϚϐΦϯ ઃཱɹɹɹ ɿ 1997೥ 1݄ 20೔ ࢿຊۚɹɹ ɿ

    6ԯԁ ैۀһ਺ ɿ 97໊ʢ2017೥6݄ݱࡏʣ גओɹɹɹ ɿ ತ൛ҹ࡮ ʢ100%ʣ εϩʔΨϯ ɿʮίίϩ΋ɺΧϥμ΋ɺಈ͔͢ϚϐΦϯʯ ࢀՃஂମ ɿOSGeoࡒஂ೔ຊࢧ෦ ๏ਓձһ Ԋֵ 20प೥Λܴ͑·ͨ͠ʂ
  6. ࣄۀ಺༰

  7. ஍ਤϚϐΦϯ ೔ͷग़೔ͷೖΓ ࠃ౪Γ߹ઓ ͓Ͱ͔͚ΞϧόϜ ΩϣϦଌ ϚϐΦϯ·ͱΊ ௒ϐϯϙΠϯτఱؾ ܙํϚϐΦϯ ͪΜ͋ͳ͝ υίστολʔ

    ίίστολʔ ΞϓϦ͍Ζ͍Ζ BSVLV
  8. ϚϐΦϯ ϕΫλʔλΠϧ ͸͡Ίͯ·ͨ͠

  9. 2016/10 ϥϘαΠτʹͯ ϚϐΦϯϕΫλʔެ։

  10. า͚ͩ͘ͰϓϨθϯτ͕΋ Β͑ΔɺҰาઌߦ͘΢Υʔ ΩϯάΞϓϦ 2016/11 aruku&ʢ͋Δ͘ͱʣϦϦʔε

  11. ܙํרΛ৯΂Δํ͕֯෼͔ Δɺ೥ʹҰ౓஫໨͞ΕΔΞ ϓϦ 2017/1 ܙํϚϐΦϯ(iOS൛)ͷ஍ਤΛ ϥελʔ͔ΒϕΫλʔʹมߋ

  12. ϕΫλʔλΠϧ ׬੒·ͰͷಓͷΓ

  13. 2013೥ࠒ ɹϥϘ׆ಈͱͯ͠ʢࡉʑͱʣ ɹϕΫλʔλΠϧͷ։ൃʹணख

  14. 2014೥ࠒ ɹಠࣗγεςϜʢ΄΅ʣ׬੒ʂ

  15. ಠࣗγεςϜͷߏ੒ ϕΫλʔλΠϧ Protocol Buffers ܗࣜ ϑΥʔϚοτ͸ಠࣗ࢓༷ ϨϯμϦϯά Android/OpenGL ES 2.0Ͱ

    ಠࣗʹ։ൃ ελΠϧϑΝΠϧ XMLܗࣜ
  16. ஍ਤͷඳը͕஗͍ɺiPhone൛͕ผ్ඞཁ… ͳͲͷ՝୊͕ൃੜ ϨϯμϦϯάΤϯδϯΛωΠςΟϒʢC++ʣ Ͱθϩ͔Β࡞Δ͔͠ͳ͍͔΋… Mapbox͕ϕΫλʔλΠϧ Mapbox Vector Tile ͱϨϯμϦϯάΤϯδϯ Mapbox

    GL Native ΛΦʔϓϯʹ։ൃ͍ͯ͠Δ͜ͱΛൃݟʂʂʂ
  17. 2014೥ࠒ ɹಠࣗγεςϜΛ΍Ίɺ ɹMapbox Vector Tile ͷ ɹ࠾༻ΛܾΊΔ

  18. ݱࡏͷϚϐΦϯͷߏ੒ ϕΫλʔλΠϧ Mapbox Vector Tile ϨϯμϦϯά Mapbox GL Native ελΠϧϑΝΠϧ

    Mapbox Style
  19. ౰࣌͸ɺ Mapbox GL Native ʹඞཁͳػೳ ʢminzoom,maxzoomͷࢦఆͳͲʣ͕ͳ͍͜ ͱ΋ଟ͘ɺΧελϚΠζͯ͠ิ͍ͬͯͨ ͦΕ͔ΒɺͲΜͲΜػೳ௥Ճ͞ΕɺݱࡏͰ͸ ଍Γͳ͍ػೳ͸΄΅ͳ͘ͳͬͨ ݱࡏɺMapbox

    Vector Tile ͸ esri Ͱ΋࠾༻͞ ΕɺσϑΝΫτελϯμʔυʹͳΓͭͭ͋Δ
  20. ݱࡏʹࢸΔ

  21. .BQCPY(-/BUJWF ʹ͍ͭͯ

  22. ɾϕΫλʔ஍ਤΛෳ਺ͷϓϥοτϑΥʔϜ্ ͷωΠςΟϒΞϓϦέʔγϣϯʹຒΊࠐΉͨ ΊͷϥΠϒϥϦ ɹJS൛ɺUnity൛΋ผ్༻ҙ͞Ε͍ͯΔ ɾΦʔϓϯιʔεɺBSDϥΠηϯε ɾ։ൃ͕͔͞ΜͰɺͲΜͲΜόʔδϣϯΞο ϓ͞Ε͍ͯΔʢલόʔδϣϯͱޓ׵ੑ͕ͳ͍ ͜ͱ΋ଟ͍ͨΊɺ஫ҙ͕ඞཁʣ .BQCPY(-/BUJWFͱ͸

  23. ɾMapboxͷ஍ਤΛදࣔͤ͞Δʹ͸ΞΫηε τʔΫϯͷൃߦ͕ඞཁ ɹαʔυύʔςΟ੡ͷ஍ਤΛදࣔ͢Δ৔߹͸ ΞΫηετʔΫϯෆཁ ϚϐΦϯͰ͸ΧελϚΠζΛߦ͍ɺ ΞΫηετʔΫϯʹରԠ͍ͯ͠Δ .BQCPY(-/BUJWFͱ͸

  24. Mapbox GL NativeͰ ஍ਤΛඳը͢ΔͨΊʹ ඞཁͳ΋ͷ

  25. ϕΫλʔλΠϧ εϓϥΠτ ϑΝΠϧ ϑΥϯτ ϑΝΠϧ ελΠϧ ϑΝΠϧ ϕΫλʔλΠϧʹ͸Geometryͷσʔλͱଐੑ৘ใ͕ ೖ͍ͬͯΔ͚ͩͳͷͰɺGeometry͝ͱͷදࣔͷ༗ແɺ σβΠϯɺϑΥϯτɺΞΠίϯͳͲ͸ελΠϧϑΝΠϧ

    Ͱઃఆ͢Δ
  26. ɾϕΫλʔλΠϧ ɹʢMapbox Vector Tileʣ ɾελΠϧϑΝΠϧ ɹʢMapbox Styleʣ ɾεϓϥΠτϑΝΠϧ ɾϑΥϯτϑΝΠϧ

  27. ɾϕΫλʔλΠϧ ɹʢMapbox Vector Tileʣ ɾελΠϧϑΝΠϧ ɹʢMapbox Styleʣ ɾεϓϥΠτϑΝΠϧ ɾϑΥϯτϑΝΠϧ

  28. ϕΫλʔλΠϧ ʢMapbox Vector Tileʣ ɾMapbox͕ఆΊͨϕΫλʔλΠϧͷΦʔϓ ϯͳ࢓༷ ɾProtocol Buffers ܗࣜ ɾGeometryͷ૬ର࠲ඪΛΤϯίʔυͨ͠΋

    ͷͱଐੑ৘ใͷू·Γ
  29. sample MBZFST\ OBNFYYYY GFBUVSFT\ UBHT UBHT UZQF10-:(0/ HFPNFUSZ HFPNFUSZ ʜ

    ^ LFZTDPEF WBMVFT\ JOU@WBMVF ^ WFSTJPO ^ ʜ Geometryͷ ૬ର࠲ඪ ଐੑ৘ใ
  30. ɾϕΫλʔλΠϧ ɹʢMapbox Vector Tileʣ ɾελΠϧϑΝΠϧ ɹʢMapbox Styleʣ ɾεϓϥΠτϑΝΠϧ ɾϑΥϯτϑΝΠϧ

  31. ελΠϧϑΝΠϧ ʢMapbox Styleʣ ɾ஍ਤͷσβΠϯΛܾΊΔϑΝΠϧ ɾjsonܗࣜ ɾϚϐΦϯͰ͸ MVT Styler Λ࢖ͬͯɺ࡞੒/ ฤूΛߦ͍ͬͯΔ

  32. ʜ MBZFST<  \   JETBNQMF   

    UZQFpMM    TPVSDFTBNQMF    TPVSDFMBZFSTBNQMF    pMUFS<         DPEF        >    QBJOU\    pMMDPMPSCF   ^  ^  >  ʜ sample
  33. ׬શGUIͷϕΫλʔλΠϧελΠϧΤσΟλ MVT Styler

  34. MVT Styler ɾϦΞϧλΠϜͰσβΠϯͷมߋ ͕֬ೝͰ͖Δ ɾγϯϓϧͳػೳͰɺ௚ײతʹૢ ࡞Ͱ͖Δ ɾ஍ਤ্ͰϨΠϠʔΛ֬ೝͰ͖Δ ͷͰศར ɾϚϐΦϯͰ͸ΧελϚΠζͯ͠ɺ ϑΝΠϧग़ྗ

    / ը૾ग़ྗͳͲͷػ ೳΛ௥Ճ͍ͯ͠Δ
  35. ɾϕΫλʔλΠϧ ɹʢMapbox Vector Tileʣ ɾελΠϧϑΝΠϧ ɹʢMapbox Styleʣ ɾεϓϥΠτϑΝΠϧ ɾϑΥϯτϑΝΠϧ

  36. εϓϥΠτϑΝΠϧ ɾ஍ਤ্ͷΞΠίϯΛ·ͱΊͨεϓϥΠτϑΝΠϧ ɾpngϑΝΠϧͱjsonϑΝΠϧͰߏ੒͞ΕΔ ɾMVT Styler Ͱ࡞੒Ͱ͖Δ

  37. \lTBNQMFTWH\XJEUI IFJHIU  Y Z QJYFM3BUJP^  lTBNQMFTWH\XJEUI IFJHIU 

    Y Z QJYFM3BUJP^  ʜ KTPO QOH sample
  38. ɾϕΫλʔλΠϧ ɹʢMapbox Vector Tileʣ ɾελΠϧϑΝΠϧ ɹʢMapbox Styleʣ ɾεϓϥΠτϑΝΠϧ ɾϑΥϯτϑΝΠϧ

  39. ϑΥϯτϑΝΠϧ ɾϑΥϯτϑΝΠϧʢttfͳͲʣ͔ΒglyphΛ 256୯ҐͰ෼ׂͯͦ͠ΕΛpbfԽͨ͠΋ͷ ɹttfϑΝΠϧ ɹ→ 0-255.pbf, 256-511.pbf ... 256ݸ ɾMVT

    Styler Ͱ࡞੒Ͱ͖Δ
  40. ϚϐΦϯͷ ϕΫλʔλΠϧͷ ੜ੒/഑৴ͷ͘͠Έ

  41. ϨϯμϦϯά ɹ஍ਤσβΠϯ λΠϧੜ੒ σʔλ ४උ ϑΝΠϧ ετϨʔδ 4IBQF pMF %#

    1PTUHSFT  1PTU(*4 ετϨʔδ ΫϥΠΞϯτ ੜ੒༻ αʔό ϕΫλʔλΠϧ ʢQCG .75 4UZMFS εϓϥΠτ ϑΝΠϧ ʢQOH KTPO ϑΥϯτ ϑΝΠϧ ʢQCG ελΠϧ ϑΝΠϧ ʢKTPO ४උɾੜ੒ ໿24࣌ؒ
  42. ϥϘαΠτ BSVLV ಉ͡ϕΫλʔλΠϧΛ ࢖͍ͬͯΔ

  43. ϚϐΦϯͷʮඒ͍͠ʯʮ໎Θͳ͍ʯ஍ਤ ελΠϧϑΝΠϧɿ25000ߦҎ্ ϨΠϠʔ਺ɿ691

  44. ϕΫλʔλΠϧͷ ͭ͘Γ͔ͨ

  45. ਺஋஍ਤʢࠃ౔جຊ৘ใʣͷαϯϓϧσʔλ ͔ΒϦΞϧλΠϜͰϕΫλʔλΠϧΛੜ੒ 4IBQF pMF %# 1PTUHSFT  1PTU(*4 ελΠϧ ϑΝΠϧ

    ʢKTPO SQLͰϦΞϧλΠϜʹ ϕΫλʔλΠϧΛੜ੒
  46. ࣄલʹؔ਺Λ࡞੒ map.tile_to_box(bigint, bigint, integer, integer) ɹλΠϧ৘ใ͔ΒBoundingBoxΛٻΊΔ map.pixel_at_zoom(integer) ɹͦͷζʔϜʹ࠷దͳ܎਺ΛٻΊΔ ɹST_Simplify΍ST_SnapToGridͰར༻ map.safe_intersection(geometry,

    geometry) ɹηʔϑςΟͳST_Intersectionɻ ɹST_IntersectionͰException͕ൃੜͨ͠৔߹ ɹਫ਼౓ΛԼ͛ͯST_IntersectionΛߦ͏
  47. ಓ࿏ΛϕΫλʔλΠϧԽ͢Δαϯϓϧ 4&-&$5 SEDUH  45@"T(FP+40/  45@5SBOTGPSN  45@4JNQMJGZ 

    45@-JOF.FSHF  45@$PMMFDU HFPN    NBQQJYFM@BU@[PPN \[^        "4HFPN@HFPKTPO '30.  4&-&$5 SEDUH   45@%VNQ  NBQTBGF@JOUFSTFDUJPO  HFPN  NBQUJMF@UP@CPY \Y^ \Z^ \[^      HFPNHFPN '30. SEDM 8)&3& HFPNNBQUJMF@UP@CPY \Y^ \Z^ \[^   B(3061#:BSEDUH αΠζΛ཈͑ΔͨΊʹϥΠϯΛܨ ͛ͯؒҾ͘ ର৅ͷλΠϧ಺ʹ׬શʹऩΊΔͨΊ λΠϧ֎ʹ͸Έग़ͨ͠෦෼ΛΧοτ ର৅ͷλΠϧ಺ʹؚ·ΕΔ geometryͷΈΛநग़
  48. ׬੒ਤ

  49. ղઆ http://qiita.com/honjo/items/ 8ea61f5a9c1bbaa669c0 ιʔείʔυ https://github.com/mapion/simple- vectorizer ͥͻ͓ͨΊ͍ͩ͘͠͞ʂ

  50. ࠓޙͷల๬

  51. ɾMapbox Vector Tile ͸σϑΝΫτελϯ μʔυʹͳΓͭͭ͋ΔΦʔϓϯͳ࢓༷ ɾMapbox Vector TileʹରԠͨ͠πʔϧ͸਺ ଟ͋͘Γɺ͜Ε͔Β΋૿͍͑ͯ͘ͱࢥΘΕΔ ex)

    Mapzen, Klokan Technologies, MVT Styler, Maputnik etc… ͍ΖΜͳՄೳੑ͕޿͕ͬͨʂ
  52. ϚϐΦϯͰ΋ ɾ஍ਤͷ഑৴ ɾ஍ਤAPIͷఏڙ ɾ஍ਤSDKͷఏڙ ɾ஍ਤσβΠϯπʔϧͷఏڙ ɾ஍ਤ഑৴γεςϜͷఏڙ ͳͲͷGIS։ൃࢧԉαʔϏεΛߏ૝தʂʂʂ

  53. ৽αʔϏεͷλʔήοτ͸ ɹҐஔ৘ใΛ׆༻͍ͨ͠શͯͷਓ ɹҐஔ৘ใΛఏڙ͍ͨ͠શͯͷਓ ͭ·Γ͜͜ʹ͍Δօ͞ΜͰ͢ʂ

  54. ޤ͏͝ظ଴ʂʂ

  55. ࢀߟURL ɹ˙ϚϐΦϯϕΫλʔ IUUQTNBQJPOHJUIVCJPNBQJPOWFDUPS ˙BSVLV IUUQTXXXBSVLVUPKQ ˙ܙํϚϐΦϯ J04൛  IUUQTJUVOFTBQQMFDPNKQBQQܙํϚϐΦϯJE NU

    ˙.BQCPY(-/BUJWF IUUQTHJUIVCDPNNBQCPYNBQCPYHMOBUJWF ˙.BQCPY(-+4 IUUQTHJUIVCDPNNBQCPYNBQCPYHMKT ˙.BQCPYVOJUZTEL IUUQTHJUIVCDPNNBQCPYNBQCPYVOJUZTEL ˙.BQCPY7FDUPS5JMF4QFDJpDBUJPO IUUQTXXXNBQCPYDPNWFDUPSUJMFTTQFDJpDBUJPO ˙.BQCPY4UZMF4QFDJpDBUJPO IUUQTXXXNBQCPYDPNNBQCPYHMKTTUZMFTQFD ˙.754UZMFS IUUQTTQVUOJLNBQTHJUIVCJPNWUTUZMFS ˙εϓϥΠτϑΝΠϧΛ࡞Δπʔϧ IUUQTHJUIVCDPNNBQCPYTQSJUF[FSP IUUQTHJUIVCDPNNBQCPYTQSJUF[FSPDMJ ˙ϑΥϯτϑΝΠϧΛ࡞Δπʔϧ IUUQTHJUIVCDPNNBQCPYOPEFGPOUOJL ˙ࠃ౔਺஋৘ใʢߦ੓۠Ҭσʔλɺమಓσʔλʣ͔ΒϕΫλʔλΠϧΛ࡞ͬͨαϯϓϧ IUUQTNZHTJIFSPLVBQQDPNɹ
  56. ͓ΘΓ