Giter Club home page Giter Club logo

geoiter's Introduction

geoiter

iterates the planet.

A simple tool to iterate coordinates within given boundaries such as country boundary. The usage is mostly for querying/searching by location at for example ebay.com or zillow.com

Let's say Germany has in sum 5000 houses to sell. Then most platforms will only allow you to visit or request the first 200 houses. Now to get the others, you need to dissect the big boundary area into smaller ones. And this is where geoiter provides you with coordinates.

geoiter can be used for web scraping to utilize geo/location queries:

In many cases the web page restrict the result items to a fixed number. With geoiter you can now dissect this one query to a many location queries to relax the result density under the restriction limit.

geoiter has only one additional dependency called haversine.

install

pip install geoiter

usage

import pickle

from geoiter.util.ressource_example import germany
from geoiter import GeoIter

# get you boundary for example
with open(germany, "rb") as file:
    germany = pickle.load(file)

# prepare
gi = GeoIter(
    boundary=germany,
    radius=100,
    comp_rate=20
    )

if __name__ == "__main__":
    # plot them as example
    for coordinate in gi:
        print(coordinate)

speed

one may consider that geo data have megabytes of coordinates. Which may make the iteration very slow, because it needs to look up coordinates in the boundary often. To accelerate the geoiter provides a very simple compressor and uses bisect instead of list iteration. However, it still can be slow.

extensions

There two extensions which give additional help

pip install geoiter["gpx]

provides you with an gpx exporter.

pip install geoiter["plot"]

provides a plotting function to visualize the grid.

data

get boundaries from osm or others sources like

todo

  • SRP for compressor
  • Make own haversine calculation for fixed directions.

Homepage

geoiter's People

Contributors

cloasdata avatar

Stargazers

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