Code Monkey home page Code Monkey logo

sidrcs / osmnxelevation Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 19.23 MB

Python package that binds elevation from raster datasets to nodes and edges of OpenStreetMaps (OSM) to create input network datasets that support elevation-based network analysis

Home Page: https://sidrcs.github.io/maps/resume.html

Jupyter Notebook 99.45% Python 0.55%
gis osmnx elevation-bind elevation-extraction osmnxelevation road-network road-network-extraction elevation-binder network-analysis-esri road-elevation-binder

osmnxelevation's Introduction

OSMnxElevation

OSMnxElevation is a lightweight Python package that binds elevation from raster datasets to nodes and edges of OpenStreetMaps (OSM) to create input network datasets that support elevation-based network analysis like walkability and bikeability in ArcGIS Pro (ESRI 2020).

Demo

Basic Demo Notebook

How to Install and Use

Installation

Step 1: Clone the repository

git clone https://github.com/Sidrcs/osmnxelevation.git

Step 2: Change the directory to lib folder

cd lib

Step 3: Install environment.yml to install dependencies using Conda

conda env create -f environment.yml

Step 4: Activate the Conda environment

conda activate oxelev

Step 5: Launch Jupyter Notebook from the terminal (Mac) or Anaconda prompt (Windows)

jupyter-notebook

Usage

  1. Import the NetworkDataset module from osmnxelevation library.
  2. Initialize the NetworkDataset instance with the required arguments:
    • place(str): City, County, State, Country [Eg: Madison, Dane, Wisconsin, US]
    • raster_fpath(str): Folder path containing Digital Elevation Models (DEMs) raster datasets. Try: USGS TNM Downloader
    • output_fpath(str): Output folder path to store geopackage outputs after elevation binding
  3. Launch elevation binding to network using method bind_elevation_to_network()
# import library
import osmnxelevate as oe

# Create an instance of NetworkDataset object
ndst = oe.NetworkDataset(place = "Midland, Midland County, TX, USA",
                        raster_fpath = "Elevation_OSM\Midland_DEM",
                        output_fpath = "Elevation_OSM")

# Binds elevation to nodes and edges
ndst.bind_elevation_to_network()

Visualization

  1. The NetworkDataset module has visualize_edges_elevation(gpkg_fpath, col_name, title) which visualizes from_elev or to_elev columns of the edge_network.gpkg created from the output of the bind_elevation_to_network() method:
gpkg_fpath = "edge_network.gpkg"
col_name = "from_elev"
title = "Elevation model of Midland City, TX"
ndst.visualize_edges_elevation(gpkg_fpath, col_name, title)

Credits

Boeing, G. 2017. "OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks." Computers, Environment and Urban Systems 65, 126-139.

LICENSE

OSMnxElevation is open source and licensed under the MIT license. License requires that derivative works provide proper attribution.

osmnxelevation's People

Contributors

sidrcs avatar

Stargazers

 avatar  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.