OriPekelman / cocarto

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cocarto

Context

Collaborative and historized edition of geographical data

cocarto is a tool for managing geographical-related data that doesn’t require a geomatic engineer experience. It is a web application that lets you create, edit data sets that include geographical data; multiple users can collaborate in realtime on the same data.

It’s just tabular data with an extra column for the geometry; a spreadsheet of geographical data.

It is not:

  • a rendering tool to make nice printable maps
  • a tool for managing very large datasets.

How to contribute

This software is distributed under the AGPLv3.

If you want to report a bug, ask for an improvement or submit a fix, open an issue, a merge request or email us at bonjour@codeursenliberte.fr

Installation for development

Technical dependencies

cocarto is a Ruby on rails monolith application. We use turbo for interactivity and stimulus for the small bits that need javascript.

In order to work on it, you will need:

  • postgresql with postgis
  • redis running locally
  • rbenv

Create the database roles

By default, the app will try to connect to the database with the user cocarto and the password cocarto.

To create that user, run:

make setup-pg-users

Those values can also be modified in config/database.yml.

Initialize the development environment

On a new installation, run

make setup

That command will install the project ruby version, the gem bundler, the dependencies and will initialize the database. The database will contain two users:

  • elisee.reclus@commune.paris, password: refleurir
  • cassini@carto.gouv.fr, password: générations12345

Run the app

Start the server

To run the server, run:

make dev

That command will automatically run make install to install new dependencies and run database migrations. The app then runs at https://localhost:3000.

Run the tests

make test

Linting

make lint

We follow the conventions from StandardRB and StandardJS.

Importing

Territories

Territories are reference geometries (like countries of the world) that are available to all users. The territories are grouped into TerritoryCategories that have each a revision to handle evolution over time.

A rake task allows to import them, either from an url, either from a local file:

rake import:geojson[regions.json,Régions de France,2022]

rake import:geojson[http://etalab-datasets.geo.data.gouv.fr/contours-administratifs/2022/geojson/departements-100m.geojson,Départements de France,2022]

Expect a processing time of about 1s per Mb of geojson.

If you want to set the parent of a territories, you need to pass as an extra-parameter:

Mock data

The import_data thor task is a fronted to the import machinery. A preset configuration is included in the fixtures to add mock data quickly:

Usage:
  thor import_data -c "Random Restaurants" -f test/fixtures/files/random_restaurants.json

Hosting

If you want to host the app by yourself, you will need to set the following environment variables:

  • PUBLIC_URL: where is your instance running. This is used by the mailer (password recovery…)
  • EMAIL_FROM: adress that is used as From: in the emails sent
  • SMTP_HOST, SMTP_USERNAME, SMTP_PASSWORD, SMTP_PORT: being able to send emails

About

License:GNU Affero General Public License v3.0


Languages

Language:Ruby 61.7%Language:HTML 20.6%Language:SCSS 8.5%Language:JavaScript 8.3%Language:Makefile 0.5%Language:Shell 0.4%Language:Procfile 0.0%