diff --git a/README.md b/README.md index fb778a3..fed3779 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 diff --git a/anaxitile/__init__.py b/anaxitile/__init__.py new file mode 100644 index 0000000..c42b8d6 --- /dev/null +++ b/anaxitile/__init__.py @@ -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 diff --git a/tilenames.py b/anaxitile/tilenames.py similarity index 100% rename from tilenames.py rename to anaxitile/tilenames.py diff --git a/tsdl.py b/anaxitile/tsdl.py similarity index 98% rename from tsdl.py rename to anaxitile/tsdl.py index 1cb725b..25fb14a 100644 --- a/tsdl.py +++ b/anaxitile/tsdl.py @@ -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) @@ -160,5 +159,5 @@ def main(): return downloadErr -if __name__ == "__main__": - exit(int(main())) +def shell_invoke(): + exit(main()) diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9747218..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -certifi==2019.6.16 -chardet==3.0.4 -idna==2.8 -Pillow==6.1.0 -requests==2.22.0 -urllib3==1.25.3 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3a9b8dd --- /dev/null +++ b/setup.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +from setuptools import setup + +setup( + name = "AnaxiTile", + version = "0.0.1", + author = "Conlan Cesar", + author_email = "herocc@herocc.com", + 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", + } +)