Giter Club home page Giter Club logo

mappics's Introduction

Mappics

Build Status codecov

Mappics is a map based travel photos gallery, with automatic place and weather description of the very moment the photos are taken.

It will process all the images placed in a specific directory and perform these operations:

  • it fetches Exif data, (https://en.wikipedia.org/wiki/Exif), which usually contain camera model and settings, GPS information, and date and time the photo was taken
  • it fetches place description. A short one (like Goðafoss Waterfall and a long one (like Goðafoss Waterfall, Goðafossvegur, Öxará, Þingeyjarsveit, Norðurland eystra, Ísland). This is based on the Exif GPS information stored in the photo and obtained from Nominatim and OpenStreetMap APIs
  • it fetches weather forecast in the place and moment the photo was taken. This is based on the Exif GPS information and the creation date of the photo, and obtained from the DarkSky APIs
  • it creates a resized version of the image and a thumbnail, and store them in a different folder from the original one

All these information are shown in galleries and pop up with photos and details, using Leaflet javascript library and Mapbox maps. Frontend is based on Bootstrap framework and backend is written in PHP on top of some Symfony components.

Mappics includes also a backend interface (based on EasyAdminBundle) that lets you modify descriptions, coordinates and creation date of the photos.

You can see a working version here: http://pics.antodippo.com.

Usage

Mappics provides a simple console command to process images. To configure and run the command you will have to:

  1. obtain API keys from external services:
  2. deploy the application (see dedicated paragraph for details)
  3. edit your /.env file adding the keys from step 1
  4. place your images in the <root>/var/galleries directory (Mappics supports jpg and png images), organized in folders (they will become galleries)
  5. run the console command bin/console mappics:process-galleries from the <root> directory
  6. go to the home page and enjoy your photos!

If you have a lot of images this command can take a long time, so you may want to run it in background:

bin/console mappics:process-galleries &

or, if you want to set-it-and-forget-it and just upload photo every now and then, you could run it as a cron job (it has a lock which prevents multiple execution):

0 * * * * /var/www/mappics/current/bin/console mappics:process-galleries

To access the admin backend you must set the ADMIN_PWD variable in the /.env file, and then access it from www.your-domain.com/mappics-admin.

Deploy

One option is to make Mappics run on Apache with PHP module. You will have to install and enable the following PHP extensions:

php-curl
php-mbstring
php-zip
php-gd
php-xml
php-exif

You can find a sample virtual host file in /docker/vhost.conf and a Dockerfile to have a better understanting of the system stack needed.

To deploy and update Mappics you can also find a simple configuration for https://deployer.org, in /deploy.sample.php, so you will have to:

  1. install Deployer
  2. edit the sample file adding you host information (see comments in file and documentation)
  3. rename the file in deploy.php
  4. run dep deploy (to install the latest version)

If you want to deploy a specific version you can also use the tag option: dep deploy --tag="1.0.0"

Run on your local machine

The suggested way to run and work on Mappics in a local enviroment is Docker:

  1. install Docker on your machine
  2. clone the repository: git clone [email protected]:antodippo/mappics.git
  3. build Mappics application: make setup
  4. run tests: make test
  5. run application: make start
  6. browse Mappics on http://localhost:8080
  7. stop application: make stop

You should get an empty Mappics home page. To fill it, see the "Usage" paragraph.

mappics's People

Contributors

antodippo avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mappics's Issues

add new datatype geojson

Hello still working on mappics deployment, was wondering if you could clarify the workflow "it fetches place description. A short one (like Goðafoss Waterfall and a long one (like Goðafoss Waterfall, Goðafossvegur, Öxará, Þingeyjarsveit, Norðurland eystra, Ísland). This is based on the Exif GPS information stored in the photo and obtained from Nominatim and OpenStreetMap APIs"
as would like to use OpenstreetMap API to fetch description for geojson data
-polygon building footprint https://github.com/buildvoc/buildingshistory/blob/main/geojson-example/osgb1000015671624.geojson
-national heritage building information https://github.com/buildvoc/buildingshistory/blob/main/geojson-example/National_Heritage_List_for_England_NHLE-chalfield-house.geojson

which files does mappics use to fetch description, many thanks

delete gallery in mappics-admin

hello when I go to delete a gallery in mappics-admin get the following error

There is a ForeignKeyConstraintViolationException for the Doctrine entity associated with "Gallery". Solution: disable the "delete" action for this entity or configure the "cascade={"remove"}" attribute for the related property in the Doctrine entity. Full exception: An exception occurred while executing 'DELETE FROM gallery WHERE id = ?' with params ["7c22edec-c259-4ea3-8ff5-a83a461025e6"]:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (mp_db.image, CONSTRAINT FK_C53D045F4E7AF8F FOREIGN KEY (gallery_id) REFERENCES gallery (id))

also when i add a folder in /var/galleries doesn't automatically create a gallery in mappics
any help would be greatly appreciated

Dot not get ObjectRepository in repositories

In your infrastructure repositories, you're getting the ObjectManager in constructors.
I'm afraid that is a bad practice, since you're invoking some external services when container is built, so basically at every request (even in requests where repositories are not used).
You should keep your constructors simpler and move call to $this->em->getRepository() in methods

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.