Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome or Safari browser. Firefox 10 (to be released soon) will also handle it.

Scripting GIS with LUA

Hiroshi Miura @miurahr

OpenStreetMap Foundation Japan

Problem

GIS configurations

組み合わせ問題

組み合わせ爆発

CSSが提唱される

OSMデータのDBインポート

組み合わせ爆発

なにか良い方法は?

Lua

Lua

Lua

lua.org

Why Lua

LUA example

print("Hello World")

OSM2PgSqlとLUA(1)

style.luaによりインポートのフィルター指定

OSM2PgSqlとLUA(2)

function add_z_order(keyvalues)
   z_order = 0
   if (keyvalues["layer"] ~= nil ) then
      z_order = 10*keyvalues["layer"]
   end
   zordering_tags = {{ 'railway', nil, 5, 1},
       { 'boundary', 'administrative', 0, 1}, 
      .....

OSM2PgSqlとLUA(3)

続き
   for i,k in ipairs(zordering_tags) do -- イテレーション
     if ((k[2] 
          and keyvalues[k[1]] == k[2]) -- Key合致
      or (k[2] == nil 
          and keyvalues[k[1]] ~= nil)) then -- Key/Value合致
        if (k[4] == 1) then
           roads = 1
        end
        z_order = z_order + k[3]   -- 重み付け
     end

Another Use Case

Another Use Case

Another Use Case

Build Tile serving service - TileMan

11/2 AM 講演でご紹介

Credit

introduction to Lua

Use a spacebar or arrow keys to navigate