GithubHelp home page GithubHelp logo

mmomtchev / igc-admin-analyze Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 104.97 MB

A tool for generating a breakdown of the overflown administrative boundaries from flight data in igc format

License: MIT License

Python 91.38% Shell 8.62%
igc paragliding parallel-algorithm

igc-admin-analyze's Introduction

igc-admin-analyze

This is a tool for generating a breakdown of the overflown administrative boundaries from flight data in igc format

Installation

Use the package manager pip to install the dependencies.

pip install aerofiles argparse shapely rtree

Usage

igc-admin-analyze.py -i <flightdata> -a <borders> [-q] [-v] [-s selected_areas]

If you want to verify that the included igc flight data corresponding to the current national record in France for paragliding distance over flatland is indeed a valid flatland flight, run

igc-admin-analyze.py -i record_de_france.igc -a FR -s "Yonne,Aube,Nièvre,1450201,Cher,51,Creuse"

Launch in Marne
Land in Corrèze
3.73% (272 of 7292) in Allier *
8.37% (610 of 7292) in Aube *
17.73% (1293 of 7292) in Cher *
2.56% (187 of 7292) in Corrèze
13.73% (1001 of 7292) in Creuse *
26.85% (1958 of 7292) in Marne *
6.82% (497 of 7292) in Nièvre *
20.21% (1474 of 7292) in Yonne *
97.44% (7105 of 7292) in selected areas

Areas can be specified by name, OSM Ref field (which happens to be the department number in France) or OSM ID

igc-admin-analyze.py -i record_de_france.igc -a Europe

Launch in France
Land in France
100.00% (7292 of 7292) in France

Inner workings

This tool tries to be as precise as possible. For example the above record flight follows the Allier boundary for a few tens of kms. Simplified datasets produce incorrect results. The data used is the full scale OSM administrative boundary data which amounts to about 1,200,000 vertices for the French departments. As direct matching of 8000 to 10000 flight track points to such a number of vertices is not feasible, this tool uses a bounding box cache in a 2D R-tree that is saved across sessions. First run over a new area tends to be somewhat slow, with subsequent runs being almos instantenous.

Algorithm

For each point, check if there is a bounding box in the 2D R-tree and get the administrative area from it Otherwise try to find the largest possible square bounding box corresponding to this point which does not cross into another administrative area and add it to the cache At the end of the run, each administrative area is going to be represented by a set of square bounding boxes in a 2D R-tree

OSM Overpass extraction

A script that can be used to re-extract the data from the Overpass server of OpenstreetMap is included, should you wish to extract the data yourself

License

MIT

igc-admin-analyze's People

Contributors

mmomtchev avatar

Stargazers

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