Skip to main content

GeoScraper

GitHub version PyPI version

Very user friendly library to parse OpenSourceMap data either from an XML file (i.e. *.osm), from an OSM API URL, or from a user specified bounding box.

To Install

pip install GeoScraper

Example Python Script

import os
from pprint import pprint

from GeoScraper import GeoScraper


USE_BBOX  = True
USE_FILE  = True
USE_URL   = True

XML_FNAME = os.path.join(os.path.dirname(__file__), 'map.osm') # YOU MAY NEED TO CHANGE THIS LINE!
BBOX = [-84.0958000, # left
         39.7617000, # bottom
        -84.0484000, # right
         39.7823000] # top
URL = r'https://api.openstreetmap.org/api/0.6/map?bbox=-84.0958000,39.7617000,-84.0484000,39.7823000'


if __name__ == '__main__':
    scraper = GeoScraper()
    
    if USE_FILE:
        print('=' * 50)
        print('Using file:')
        print('=' * 50)
        scraper.from_file(XML_FNAME)
        pprint(scraper.highways()[:3])
        print('\n')
    
    if USE_BBOX:
        print('=' * 50)
        print('Using bbox:')
        print('=' * 50)
        scraper.from_bbox(left   = BBOX[0],
                          bottom = BBOX[1],
                          right  = BBOX[2],
                          top    = BBOX[3])
        pprint(scraper.highways()[:3])
        print('\n')
        print('=' * 50)
        print('Done')
        print('=' * 50)
    
    if USE_URL:
        print('=' * 50)
        print('Using url:')
        print('=' * 50)
        scraper.from_url(URL)
        pprint(scraper.highways()[:3])
        print('\n')
        print('=' * 50)
        print('Done')
        print('=' * 50)

Metadata

Release files for GeoScraper 0.0.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 GeoScraper 0.0.1
File Size Uploaded
GeoScraper-0.0.1.tar.gz 6.0 kB Details

Built distribution (wheel)

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

Total release size: 12.3 kB

Release files / GeoScraper-0.0.1.tar.gz

Download URL GeoScraper-0.0.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f23587a280a9d43154960f2b2a5e721e41d76e631422fcb7eee65823fae7c2fa
BLAKE2b-256 checksum
How to use checksums
526ddcc96ed1b4bae0c173c033bd40ab3ed487387aaa050b708f9524b6891260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / GeoScraper-0.0.1-py3-none-any.whl

Download URL GeoScraper-0.0.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfd6d2e371f8f17d41d9079080c003c51c63afdc5ca90f04c5c21e1f8e947aab
BLAKE2b-256 checksum
How to use checksums
f1ece30771e292e48d4741fb23a7d3ad267672d52afa134457cffe6e3eabd963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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