Git Product home page Git Product logo

divbscan's Introduction

divbscan

Ivann Schlosser

This repo contains the code of a clustering algorithm for urban analytics, specifically to identify neighbourhoods in a city. It was developed and tested in London with GPS mobility data of a sample of residents coming from an industry partner, Locomizer Ltd. and open source data from OSM.

Setup

You will need a C/C++ compiler, which comes with the developer tools of R. It has a few dependencies and calls python from within R with the reticulate package.

External dependencies

The workflow relies on the osmium library, please install it separately. If using mac, you can install it from homebrew by running:

brew install libosmium

With Renv

This project uses renv to setup an R and python environments. Once the repo is cloned, open it and start the environment with the following command:

renv::activate()

This should download all the R and python packages required to run this algorithm.

Running

There are multiple ways to start working with this repository, the easiest being to analyze a city from the predefined set. It will still require downloading the corresponding OSM file from geofabrick.

The necessary OSM file will be either the country or region containing the city. For reusability reasons, it might be better to download the whole country. Say if you are running the analysis on several cities across France, it’s easier to get a single osm file for the country, than each region individually.

The OSM files, should be put in the data/osm_extracts/ folder. For example, if working on France, the OSM extract will be looked for at the following location in the directory: data/osm_extracts/australia-latest.osm.pbf

Predefined cities

Currently, a set of cities are supported, this essentially means that their bbox and associated .pbf files are located. A new city can be added manually quite easily, this will be covered in another section.

To visualise the available cities, run names(rlist::list.load("cities.rds")). Select the one yyou want, it is recommended to start with a smaller one to see that everything works initially.

Open the params.R script and in the first line of code assign to the city variable whichever city you chose. Default is aix-en-provence.

Simulation

You can now run a simulation by calling the divbscan_ny.R once the raw osm extract is at the right location and you have entered a city name in the parameters.

Run for example in your R console :

source("divbscan_ny.R")

Future updates of this repository will aim to automate as much as possible the setup step.

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.