Coder Social home page Coder Social logo

daveedortega / hoyodecrimen.api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from diegovalle/hoyodecrimen.api

1.0 0.0 0.0 31.98 MB

Website and API for hoyodecrimen

Home Page: https://hoyodecrimen.com

License: GNU General Public License v3.0

Shell 0.11% JavaScript 14.07% Python 11.49% CSS 3.52% HTML 12.83% PLpgSQL 57.73% DIGITAL Command Language 0.24% Dockerfile 0.01% Jinja 0.01%

hoyodecrimen.api's Introduction

Build Status Build Status

Distrito Federal Crime API and Website

You'll need to set the following environmental variables for the testing environment:

MODULE_NAME
LOG_LEVEL
PORT
SQLALCHEMY_DATABASE_URI
SENTRY_DSN
CACHE_SECRET

To deploy a testing server you have to:

  • create a postgresql database called apihoyodecrimen
  • Enale the postgis extension CREATE EXTENSION IF NOT EXISTS postgis;
  • use the db.sql file in the ansible/roles/hoyodecrimen.app/files to create the tables (be sure to uncomment the lines to also copy the data)
  • copy the cuadrantes polygons psql -d apihoyodecrimen < data/cuadrantes_poly.sql
  • add the indexes in the file ansible/roles/hoyodecrimen.app/files/index.sql

To deploy to a server use the ansible script in the ansible directory.

Updating

Copy the crime-lat-long, cuadrantes and pgj csv files to the tmp directory and then run the update.sh script.

To update the carto table you first have to delete all rows in the existing table (don't delete the crime_lat_long1 table visualization)

TRUNCATE TABLE crime_lat_long;

and then upload the new table to a tempory one and copy all rows to crime_lat_long

INSERT INTO crime_lat_long SELECT * FROM crime_lat_long_pgj
WHERE ROWNUM <= 100;

and then delete the temporary table

BE SURE THE TABLE IS CALLED crime_lat_long

Mailing list

Hoyodecrimen Notificaciones: https://hoyodecrimen.us6.list-manage.com/subscribe/post?u=787fae824c502d9f3ad7d0b73&amp;id=99835eea14

Hoyodecrimen Notifications: https://hoyodecrimen.us6.list-manage.com/subscribe/post?u=787fae824c502d9f3ad7d0b73&amp;id=102491489b

hoyodecrimen.api's People

Contributors

diegovalle avatar

Stargazers

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