Skip to main content

A simple tool to iterate circles within given boundaries:

Project description

geoiter

iterates the planet.

A simple tool to iterate coordinates within given boundaries. The usage is mostly for querying/searching by location. Geoiter provides many locations within a boundary, like a country. Let's say Germany has in sum 5000 houses to sell. Then most platforms will only allow you to visit 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

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geoiter-0.1.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geoiter-0.1.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file geoiter-0.1.1.tar.gz.

File metadata

  • Download URL: geoiter-0.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for geoiter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a79f346e6cde9f8cfe4598cab2abdc9d1ed25535da1985314e2b8783b8572c39
MD5 752fdb4b06bbec57a18ac48967d0ee6d
BLAKE2b-256 b53c64b296bc4acdba80ceafcc56ccef3ac33d3ceb93c8437d8d8a469b87953d

See more details on using hashes here.

File details

Details for the file geoiter-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: geoiter-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for geoiter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eda0adc47e03324d34302233d8c03b317e0a8598e192f0c9656972ae19ac495a
MD5 7d1a4fcf33e35ce6c5ba1c0da1670637
BLAKE2b-256 d9b525ed040a57aa88011842f30068a4125c4bcdaecd7b3db37d52b63f29a318

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page