01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 Highshool Tokyo Denki Univ Part time job Part time job SI Company EC engineer Georepublic Linux/Mozilla Japan Unix Society OSMFJ OSGeo.JP 4
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 Highshool Tokyo Denki Univ Part time job Part time job SI Company EC engineer Georepublic Linux/Mozilla Japan Unix Society OSMFJ OSGeo.JP I buy computer and start learning programming and Linux. 4
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 Highshool Tokyo Denki Univ Part time job Part time job SI Company EC engineer Georepublic Linux/Mozilla Japan Unix Society OSMFJ OSGeo.JP I started my first GIS programming at part time job. 4
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 Highshool Tokyo Denki Univ Part time job Part time job SI Company EC engineer Georepublic Linux/Mozilla Japan Unix Society OSMFJ OSGeo.JP But too many years, I didn’t any GIS programming. 4
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 Highshool Tokyo Denki Univ Part time job Part time job SI Company EC engineer Georepublic Linux/Mozilla Japan Unix Society OSMFJ OSGeo.JP I became GIS programmer again. 4
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 Highshool Tokyo Denki Univ Part time job Part time job SI Company EC engineer Georepublic Linux/Mozilla Japan Unix Society OSMFJ OSGeo.JP I join in OSS community over 17 years. 4
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 Highshool Tokyo Denki Univ Part time job Part time job SI Company EC engineer Georepublic Linux/Mozilla Japan Unix Society OSMFJ OSGeo.JP 4
people • Supports both Outdoor and Indoor (Game map). • Voice navigation enabled for blind users • The map is designed by Kobe city’s Universal design guideline. 10
postgis' psql --dbname xxx_production -c 'CREATE EXTENSION pgRouting' psql --dbname xxx_production -c 'CREATE EXTENSION hstore' In this application, we do it with Ruby on Rails “db:migrate” task. class AddExtensions < ActiveRecord::Migration[5.0] def up execute "CREATE EXTENSION hstore" execute "CREATE EXTENSION pgrouting" end def down execute "DROP EXTENSION pgrouting" execute "DROP EXTENSION hstore" end end 17
position and query type (pedestrian, wheelchair and blind_low_vision). 1. Make a virtual model with position information and query type. 2. Virtual model calculates route. • pedestrian and wheelchair: Return Well-Known Text. • blind_low_vision: pgRouting query get each “ways” and make array of building text. 20
routing.ways.id, routing.ways.source, routing.ways.target, routing.ways.length_m * CASE WHEN routing.osm_ways.tags ? 'incline' THEN 2 ELSE 1 END as cost FROM routing.ways JOIN routing.osm_ways ON (routing.ways.osm_id = routing.osm_ways.osm_id AND NOT routing.osm_ways.tags @> 'highway=>steps' AND NOT routing.osm_ways.tags @> 'highway=>path' AND NOT routing.osm_ways.tags @> 'surface=>wood' AND NOT routing.osm_ways.tags @> 'surface=>unpaved') EOS routing_sql(dijkstra_condition, text) end Define the cost per ways If way has incline tag, the cost will be double. Define ignore ways. • highway=steps • highway=path • surface=wood • surface=unpaved
<<-EOS SELECT routing.ways.id, routing.ways.source, routing.ways.target, routing.ways.length_m * CASE WHEN routing.osm_ways.tags @> 'highway=>steps' THEN 40 WHEN routing.osm_ways.tags @> 'tactile_paving=>yes' THEN 0.5 ELSE 2 END as cost FROM routing.ways JOIN routing.osm_ways ON ( routing.ways.osm_id = routing.osm_ways.osm_id AND ( routing.osm_ways.tags @> 'tactile_paving=>yes' OR ( routing.osm_ways.tags @> 'handrail:left=>yes' OR routing.osm_ways.tags @> 'handrail:right=>yes' OR routing.osm_ways.tags @> 'handrail=>left' OR routing.osm_ways.tags @> 'handrail=>right' OR routing.osm_ways.tags @> 'handrail=>yes' OR routing.osm_ways.tags @> 'handrail=>both' ) ) ) EOS routing_sql(dijkstra_condition, text) end Define the cost per ways If way has highway=step, the cost will be 40 times. But way has tactile_paving=yes, the cost will be half. Define to enable to walk for blind low vision. • tactile_paving=yes or • the way has handrail
"" if text text_query = <<-EOS with_geom.osm_id as osm_id, degrees(ST_azimuth( ST_StartPoint(ST_MakeLine(route_geom)), ST_EndPoint(ST_MakeLine(route_geom)) )) as heading, routing.osm_ways.tags as tags, max(with_geom.seq) as max_seq, EOS grouping_text = <<-EOS JOIN routing.osm_ways ON (with_geom.osm_id = routing.osm_ways.osm_id) group by with_geom.osm_id, routing.osm_ways.tags order by max_seq; EOS end <<-EOS WITH dijkstra AS ( SELECT * FROM pgr_dijkstra( $$#{dijkstra_condition}$$, (SELECT id FROM routing.ways_vertices_pgr ORDER BY the_geom <-> ST_SetSRID(ST_Point(#{source_lon},#{source_lat}),4326) LIMIT 1), (SELECT id FROM routing.ways_vertices_pgr ORDER BY the_geom <-> ST_SetSRID(ST_Point(#{target_lon},#{target_lat}),4326) LIMIT 1), false) ), with_geom AS ( SELECT dijkstra.seq, dijkstra.cost, routing.ways.name, routing.ways.osm_id, CASE WHEN dijkstra.node = routing.ways.source THEN the_geom ELSE ST_Reverse(the_geom) END AS route_geom FROM dijkstra JOIN routing.ways ON (edge = ways.id) ORDER BY seq ) SELECT sum(with_geom.cost) as cost, ST_Length(ST_MakeLine(route_geom)::geography) as length_m, ST_AsText(ST_MakeLine(route_geom)) as geom_text, #{text_query} ST_AsText(ST_StartPoint(ST_MakeLine(route_geom))) as start_position, ST_AsText(ST_EndPoint(ST_MakeLine(route_geom))) as end_position FROM with_geom #{grouping_text} EOS end Making additional query and grouping for text builder. select pgr_dijkstra with custom query with source location and target location Making result
degree 135 degree 315 degree 225 degree If next way is “Go ahead”, set current heading and add way’s length. If next way is “Turn right” or “Turn left”, close current way and start check with new way.
a Kobe city’s guideline. • At just the right time, OpenMapTiles was released. • I followed it as a hobby before when it was named OSM2VectorTile. • Also, I know about Maputnik. • Alternative of Mapbox Studio (But I didn’t access current Mapbox Studio…) • For this reason why we use openmaptiles :-) 40
openmaptiles. 2. Upload mbtiles to server. 3. Setup tileserver-gl and nginx. 4. Making mapbox-gl-style json file. 5. Add new design to tileserver-gl. 41
service docker start sudo usermod -aG docker $USER sudo reboot If you use Ubuntu < 17.04, don’t install docker-compose with apt. Use following command. curl -L https://github.com/docker/compose/releases/download/1.14.0/docker- compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
develop/osm git clone https://github.com/openmaptiles/openmaptiles.git cd ./openmaptiles docker-compose pull ./quickstart.sh japan make start-tileserver Open http://localhost:8080/ in your browser.
0 to level 7 by default. • Enable to upper levels, you need following. 1. edit .env file’s QUICKSTART_MAX_ZOOM 2. edit data/docker-compose-config.yml 3. run quickstart.sh again. • NOTE: make download-geofabrik task doesn’t make new data/docker-compose-config.yml. 46
const value = current_map this.outdoor_webview.postMessage(JSON.stringify(value)) console.log(JSON.stringify(value)) } } Call same javascript in WebView.