GithubHelp home page GithubHelp logo

pizzatreeisland / overpass-split-n-stitch Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 139 KB

A simple UI tool that makes it easy to run overpass API queries on a large BBox by splitting it up into smaller areas and joining the resulting geojson file(s).

License: MIT License

Python 100.00%

overpass-split-n-stitch's Introduction

Overpass-Split-n-Stitch

A simple UI tool that makes it easy to run overpass API queries on a large BBox by splitting it up into smaller areas and joining the resulting geojson file(s).

Pasted image 20240709204544


Table of contents


Usage

Prerequisites

This tool uses the overpy library to run the queries, the tkintermapview library to draw the map and bbox segmentation as well as the geojson library to handle the result files.

How to run

Compile and run Overpass split 'n' stitch.py.

Paste your overpass query into the field on the left, adjust your bbox and hit Run! A file dialog will appear. Choose the path where you want the resulting geojson file to be saved. After the query has completed, a noice will appear and you can quit the tool and open the results file you saved earlier, for example using the JOSM editor or QGIS.

Configuration options

Adding more query parameters

If you want to add more query parameters, such as a timeout, you can select the "Add more options" checkbox, thus removing the semicolon at the end of the preset query header and therefore not terminating it. You have to add this semicolon after your custom parameters.

Pasted image 20240709204725

Custom bbox or global search

You can customize the borders of your rectangular bbox using the according options. You can also check "global search" to search globally.

Pasted image 20240709205046

Note that in any case, results south of -89.99999° will be ignored because of a possible bug in a used library. I hope you don't want to search anything about 4 feet around the south pole.

Segment number

You can set the number of segments to influence the individual segment size. Uncheck "Show segmentation" if you're using a large number and the visualisation bogs down your computer.

Pasted image 20240709205435


Possible future features

This is an early version of the Overpass Split 'n' Stitch tool. It works well enough for what I need it for personally, which is why I chose to publish it now, but it is very much unpolished and I will try to get around to some issues. Here are some of my ideas for future versions:

Adding options for using your own overpass instance

For particularly large queries, it would be nice if you could usse this tool to query a self hosted version of the overpass api. But it seems there isn't support for that yet in ther overpy library. This other overpass wrapper has an easy option for that, but doesn't just easily pass through the query, which is why I ultimately opted against using that one.

Making this a commandline tool

I prefer looking at pretty pictures rather than working with the naked numbers, especially when it comes to geocoordinates and maps. However, I know people like command line tools and I consider removing all the gui elements and just packing the bbox segmentation function into its own command line tool.

Display query results in preview map

To make it more complete and easy to use just like the overpass turbo website. Run huge queries and look at the results in just one window, so you don't even have to figure out what to do with the resulting geojson file and how to open it.

Show progress intuitively

So far, all the input options go inactive and nothing happens for a while until all the queries are finished. That is ok if you know what's going on, but I would like to add a "everything is fine" communication of some kind for confused users. I dream of multi-colored progress bars showing succesful, unsuccesful and currently pending segments.

Pasted image 20240709212230

Add more options to the tile view

The tile view is a great opportunity to show each tiles progress for each tile.

Error handling for query issues or timeouts

This one is a big oversight. If you have a typo in your query, the program just stops. Error handling should be somewhat easy to implement in the future and is necessary for dealing with unsuccesful segments.

Implement dynamic segment size

It doesn't make any sense to have the same segment size over oceans and in city centers. Options for dynamic tile sizes based on node density would be very useful, but that is above my paygrade at this point.

If you're interested in any of these issues or other possible features feel free to contribute, open an issue or write me on Mastodon!


overpass-split-n-stitch's People

Contributors

pizzatreeisland avatar

Stargazers

Oliver Rümpelein 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.