Book Image

Python Geospatial Analysis Cookbook

Book Image

Python Geospatial Analysis Cookbook

Overview of this book

Table of Contents (20 chapters)
Python Geospatial Analysis Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Other Geospatial Python Libraries
Mapping Icon Libraries
Index

Creating an indoor route from room to room


Routing from room A to room B in an indoor routing web application over multiple floors with routing types brings together all our work up to this point. We will import some room data and utilize our network to then allow a user to select a room, route from one room to the next, and select a type of route.

Getting ready

We need to import a set of room polygons for both the first and second floor as follows:

  1. Import a Shapefile of the first floor room polygons as follows:

    ogr2ogr -a_srs EPSG:3857 -lco "SCHEMA=geodata" -lco "COLUMN_TYPES=name=varchar,room_num=integer,floor=integer" -nlt POLYGON -nln ch11_e01_roomdata -f PostgreSQL "PG:host=localhost port=5432 user=saturn dbname=py_geoan_cb password=secret" e01_room_data.shp
    
  2. Import a Shapefile of the second floor room polygons as follows:

    ogr2ogr -a_srs EPSG:3857 -lco "SCHEMA=geodata" -lco "COLUMN_TYPES=name=varchar,room_num=integer,floor=integer" -nlt POLYGON -nln ch11_e02_roomdata -f PostgreSQL "PG:host...