Giter Club home page Giter Club logo

pgroutinguiuc's Introduction

pgroutingUIUC

Author: Alexander Michels

Work is based on this FOSS4G Workshop

Steps:

  1. Download the data because it doesn't fit in Github. You can use the script data/download_data.sh or simply download some state from here: https://download.geofabrik.de/north-america/us.html The notebooks assume you will use Illinois.

  2. From the repo run:

> bash up.sh
Click here to see the expected output from `bash up.sh`
Building pgr
Step 1/2 : FROM pgrouting/pgrouting:12-3.0-3.0.1
 ---> de07041c0250
Step 2/2 : RUN apt update && apt install --fix-missing -y --no-install-recommends   bzip2   osm2pgrouting   osmctools   osmium-tool
 ---> Using cache
 ---> a0ffd185a0f2
Successfully built a0ffd185a0f2
Successfully tagged pgroutinguiuc_pgr:latest
Creating pgroutinguiuc_pgr_1 ... done
Execution starts at: Thu Sep  8 16:03:38 2022

***************************************************
           COMMAND LINE CONFIGURATION             *
***************************************************
Filename = illinois-extracted.osm
Configuration file = /usr/share/osm2pgrouting/mapconfig.xml
host = localhost
port = 5432
dbname = routing
username = alex
schema= 
prefix = 
suffix = 
Drop tables
Don't create indexes
Don't add OSM nodes
***************************************************
Testing database connection: routing
database connection successful: routing
Connecting to the database
connection success

Dropping tables...
TABLE: ways dropped ... OK.
TABLE: ways_vertices_pgr dropped ... OK.
TABLE: pointsofinterest dropped ... OK.
TABLE: configuration dropped ... OK.
TABLE: osm_nodes dropped ... OK.
TABLE: osm_ways dropped ... OK.
TABLE: osm_relations dropped ... OK.

Creating tables...
TABLE: ways_vertices_pgr created ... OK.
TABLE: ways created ... OK.
TABLE: pointsofinterest created ... OK.
TABLE: configuration created ... OK.
Opening configuration file: /usr/share/osm2pgrouting/mapconfig.xml
    Parsing configuration

Exporting configuration ...
  - Done 
Counting lines ...
  - Done 
Opening data file: illinois-extracted.osm	total lines: 1156418
    Parsing data


End Of file


    Finish Parsing data

Adding auxiliary tables to database...

Export Ways ...
    Processing 53109 ways:
[******************|                                ] (37%) Total processed: 20000	 Vertices inserted: 36305	Split ways inserted 44994
[*************************************|             ] (75%) Total processed: 40000	 Vertices inserted: 17184	Split ways inserted 29033
[**************************************************|] (100%) Total processed: 53109	 Vertices inserted: 705	Split ways inserted 2327

Creating indexes ...

Processing Points of Interest ...
#########################
size of streets: 53109
Execution started at: Thu Sep  8 16:03:38 2022
Execution ended at:   Thu Sep  8 16:04:04 2022
Elapsed time: 25.837 Seconds.
User CPU time: -> 5.03359 seconds
#########################

to bring up your database. This builds the Dockerfile, strips metadata from the .pbf file, extracts just a bounding box, and then adds the data to a PostgreSQL database. You can control some aspects of this by altering the variables under "environment" in the docker-compose.yml. The variables are:

  • POSTGRES_USER=root # should be user in container
  • POSTGRES_PASSWORD=cybergis # also doesn't matter, just password
  • POSTGRES_DB=routing # also doesn't matter, just name of database
  • OSM_PLACE=illinois # the file in ./data (${OSM_PLACE}-latest.osm.pbf)
  • OSM_BBOX=-88.34,40.05,-88.14,40.18 # bounding box to extract from the file

The notebooks assume the variables above, so change at your own risk. If you choose another location you will need to figure out your own bounding box and OSMids to route between. If you change the database name/username/password that is easier to change, just change it in the cell at the top of the notebook that connects to the postgresql server.

This step takes a while (a few minutes).

  1. Run the notebooks! It is recommended that you run these notebooks sequentially because some notebooks create views/functions that are used in other later notebooks.

Presentation notebooks (used for GGIS 407 project)

Debugging

Some of the information (especially "NOTICE" output from pgr) isn't veiwable from the notebook and you'll have to go into the container. To enter the container, run docker-compose exec pgr bash from the repository root. This opens a terminal in the container. To access the database, run psql routing.

pgroutinguiuc's People

Contributors

alexandermichels avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.