Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/v-spassky/gisture
Solution to a test task (GIS data processing).
https://github.com/v-spassky/gisture
gis test-task
Last synced: about 1 month ago
JSON representation
Solution to a test task (GIS data processing).
- Host: GitHub
- URL: https://github.com/v-spassky/gisture
- Owner: v-spassky
- Created: 2022-09-10T12:17:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-03T16:49:03.000Z (about 2 years ago)
- Last Synced: 2024-01-29T10:13:48.979Z (11 months ago)
- Topics: gis, test-task
- Language: HTML
- Homepage:
- Size: 42.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Description
It is a solution to [this](assets/task/task.md) test problem.
### Notes
- Python 3.8 was used in development environment, as well as in Docker image;
- The code is deployed via Github Actions and Amazon ECS;
- There are three files with dependencies declaration: [Pipfile](Pipfile), [Pipfile.lock](Pipfile.lock) and [requirements.txt](requirements.txt). I use the first two in development environment on my machine with pipenv and the third one for docker image (turns out pipenv isn`t really meant to be used inside Docker, so it is just more convenient to use requirements.txt in Dockerfile);
- Sample data to try it out is included in the repo [here](static/samples) and can be accessed from the frontend as well;### Demonstration
_The gif below is 40 Mb and might take a while to load. Sorry!_
### Algorithm explanation
All the work is done in these three lines:
```python
with fiona.open(shapefile_name) as shapefile:
for record in shapefile:
plt.plot(*zip(*record['geometry']['coordinates']), linewidth=0.5)
```Somewhat simplistic, but it gets the job done 🤷♂️
### How to run locally
##### In Docker
Clone git repo:
`git clone https://github.com/v-spassky/gisture.git`
Navigate to the project folder:
`cd gisture`
Build the image:
`sudo docker build -t gisture .`
Run the image:
`sudo docker run -d -p 8000:8000 gisture`
Now the app is available on localhost:8000.
##### In virtual environment
Clone git repo and navigate to the project folder:
`git clone https://github.com/v-spassky/gisture.git`
`cd gisture`
Initialize virtual environment with the tool of your choice, activate it and install dependencies listed in [requirements.txt](requirements.txt) or [Pipfile](Pipfile).
`python3 -m virtualenv .`
`source bin/activate`
`pip install -r requirements.txt`
Run the app:
`gunicorn app:app`
Now the app is running on localhost:8000.