2018-11-29 (木)
memo
## usage # teku4map = Teku4Map.new # tile1 = teku4map.get_tile(15, 28764, 12903) # block1 = teku4map.get_block("jm_rWf6fqhMtkH9SdUMIA")['longName'] class Teku4Map def initialize @baseUrl = "https://geo-live.tectech.co.jp/v1.0/" @client = HTTPClient.new() end def get_tile(level, x, y, requirePolygons=false) JSON.parse(@client.get_content("#{@baseUrl}blocks/bytile/#{level}/#{x}/#{y}?requirePolygons=#{requirePolygons}")) end def get_block(id) JSON.parse(@client.get_content("#{@baseUrl}blocks/#{id}")) end end
レベル15のタイルが1km四方っぽい.