Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert into a package that's installable as a console script #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Anaxi Tile Downloader
Downloads and stitches images downloaded from Map Tile servers.

## Dependencies
* Python 3
* Python Requests (`pip3 install --user requests==2.*`)
* Python Pillow (`pip3 install --user Pillow=6.*`) -- optional, used for image stitching
## Installation
Run `python setup.py install`.

## Usage
After ensuring your dependencies are installed, you can run the program with `python3 tsdl.py`. It will prompt you for your bounding Lat and Long coordinates, zoom, and tile server URL. For best results, the larger the area you select with your lat & long, the smaller you should have your zoom. If your zoom is too big, downloading will take longer, your resulting stitched file will be larger, and the tile server may throttle / restrict your usage.
To start AnaxiTile, run `anaxi` in your command line. It will prompt you for your bounding Lat and Long coordinates, zoom, and tile server URL. For best results, the larger the area you select with your lat & long, the smaller you should have your zoom. If your zoom is too big, downloading will take longer, your resulting stitched file will be larger, and the tile server may throttle / restrict your usage.

The program will tell you the coords it rounded to (make a note of these for geolocation, they are the top right and bottom left of the generated image), and start downloading the tiles to the `tiles/` folder.

Expand All @@ -16,7 +14,7 @@ After downloading all tiles, you will be asked if you'd like to stitch together
## Example
The following example will download and stitch tiles within an area of the MIT campus in Cambridge, Massachusetts.
```
$ python3 tsdl.py
$ anaxi
Starting Anaxi Tile Downloader...
Enter Starting Latitude: 42.363531
Enter Starting Longitude: -71.096362
Expand Down
6 changes: 6 additions & 0 deletions anaxitile/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python3

# the file that collects all of the files that make up the anaxitile
# library, providing what is available when you `import anaxi`

from .tsdl import shell_invoke
File renamed without changes.
7 changes: 3 additions & 4 deletions tsdl.py → anaxitile/tsdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

import requests

import tilenames

from anaxitile import tilenames

def getTileFileName(zoom, tileX, tileY, tileExtension):
return "%d_%d_%d%s" % (zoom, tileX, tileY, tileExtension)
Expand Down Expand Up @@ -160,5 +159,5 @@ def main():
return downloadErr


if __name__ == "__main__":
exit(int(main()))
def shell_invoke():
exit(main())
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3

from setuptools import setup

setup(
name = "AnaxiTile",
version = "0.0.1",
author = "Conlan Cesar",
author_email = "[email protected]",
description = "Downloads and Stitches images grabbed from GIS Tile Services.",
url = "http://github.com/lschumm/seymour",
install_requires = [
"requests == 2.22.0",
"Pillow == 6.1.0",
],
packages = ["anaxitile"],
entry_points = {
"console_scripts": "anaxi=anaxitile:shell_invoke",
}
)