Coder Social home page Coder Social logo

gisture's Introduction

Description

It is a solution to this 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.lock and 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 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:

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 or 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.

gisture's People

Contributors

v-spassky avatar zakhar-bozhok-jito avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.