Giter Site home page Giter Site logo

lwdovico / geospatial-analytics Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 45.9 MB

Project and exercises done during the Geospatial Analytics course

Jupyter Notebook 99.95% Python 0.05%
geometry geospatial-analysis geospatial-data voronoi-diagram voronoi-generator voronoi-tessellation

geospatial-analytics's Introduction

This reposityory contains the exercises of the Geospatial Analytics course I attended, with the final project being the implementation of an algorithm to build the Voronoi tessellation.

Voronoi Tessellation Project

For this project I implemented the Voronoi Tessellation tiler for the scikit-mobility library.

The implementation was done without using external libraries (at least not part of the basic python package). In particular the library used which were not already imported in the tilers.py file were heapq and collections (only for namedtuples).

To understand the basic concepts to final implementation I read Chapter 7 of this Computational Geometry book and I took inspiration from Steven Fortune's code and various adaptations of it.

Going to the details of the implementation of the sweepline algorithm (bottom to top), the entire implementation can be summarized as it follows:

  1. Checking the input array and points validity

  2. Managing the base shape as with the rest of the tilers

  3. A static method to compute the convex hull on the resulting verteces (using the Graham Scan algorithm), used in last step of the following part

  4. Inside the main "compute_voronoi" the following classes and features were implemented:

    • A min-heap to build a queue.
    • A linked list to manage the halfedges pointers.
    • The HalfEdge objects to manage connections to site, regions, edges and other halfedges.
    • A class to handle the site and circle events with some other necessary operations like bisecting the plane and getting vector events.
    • I used a namedtuple to implement the Edges as I needed just some attributes for them
    • Limiting the tessellation far from earth max and min coordinates (I selected a box of sides 10.000 in lon and lat)
    • Computing the convex hull of the unsorted verteces

  5. Finally the "large" tessellation is "intersected" (overlayed) with the base_shape in order to get the correct subdivision of the geometry.

I finally also used pytest to make some general tests on the implemented code, I got mainly warnings related to the cascade_union deprecation.

geospatial-analytics's People

Contributors

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