Skip to main content

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.

Metadata

Release files for geoiter 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geoiter 0.1.1
File Size Uploaded Provenance Actions
geoiter-0.1.1.tar.gz 9.7 kB Without provenance Details for geoiter-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for geoiter 0.1.1
File Interpreter ABI Platform Actions
geoiter-0.1.1-py3-none-any.whl Python 3 none any Details for geoiter-0.1.1-py3-none-any.whl

Total release size: 18.1 kB

Release files / geoiter-0.1.1.tar.gz

Download URL geoiter-0.1.1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a79f346e6cde9f8cfe4598cab2abdc9d1ed25535da1985314e2b8783b8572c39
BLAKE2b-256 checksum
How to use checksums
b53c64b296bc4acdba80ceafcc56ccef3ac33d3ceb93c8437d8d8a469b87953d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / geoiter-0.1.1-py3-none-any.whl

Download URL geoiter-0.1.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eda0adc47e03324d34302233d8c03b317e0a8598e192f0c9656972ae19ac495a
BLAKE2b-256 checksum
How to use checksums
d9b525ed040a57aa88011842f30068a4125c4bcdaecd7b3db37d52b63f29a318
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for geoiter 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page