Code Monkey home page Code Monkey logo

clima's People

Contributors

paulovieira avatar

Watchers

 avatar  avatar

clima's Issues

Correct texts in tilemill

  • in the menu in the bottom left
    • instead of "Layers", use "Shapes"
    • remove the fonts icons, and reorder them (shapes should come first)
    • add native tooltips

Improve the cartoCss for shapes with null values

"Warning: the shape has 276 geometries"

The cartoCss shows only a static property. It should be dynamic, like the code above (though the user can actually see the property to use in the code above)

List of small improvements

TileMill

  • legends: control the precision of decimal places (but has to be improved)
  • legends: in real mode, the first and last class need to have a small delta
  • legends: allow the user to change the interval of classes (use input text and add an "update" button)
  • preview of the legend (open in a new modal)
  • get more legend styles
  • find more tutorials / examples
  • raster upload
  • download shape of each map (the file id should be placed in the related info.json)
  • menu: order groups
  • when exporting to mbtiles, warn about the presence of the countries shape
  • using icons in the markers
  • in tilemill, change for the format of date (should be "2015-07-27", not "15-07-27")

Dashboard

  • inspire metadata
  • indicators (?)
  • edit texts inline
  • groups / users
  • inspect the table of attributes of the shapes (using pagination)
  • in the dashboard tables, if the string is too long it won't be visible; use the "title" attribute (or the bootstrap plugins)
  • after a new file upload, add a button to upload a new file

reduce the gap between the dashboard and tilemill

To create a new map the user should be in tilemill, not in the dashboard. The UI for that is already done. We just have to capture the click event on the button and instead of executing the original code, make a POST to /api/maps

The "web maps" section in the dashboard could be renamed to "map tools".

Steps:

  1. in the original UI to create a new map, add 3 radio buttons: "madeira"

  2. in the click event to create the map, make POST request to /api/maps

  3. show to button to go to the new map (or find the code that invokes the router and use it)

  4. in the listing of all maps, order by date of creation (the listing of all maps is now obtained with GET /api/maps)

  5. show the user that created the maps

  6. (detail) when a new is being edited, the dashboard should somehow know about it; when the user goes to "Map tools" -> Legends, the map that is being currently edited would be already selected

Páginas

Mantem-se o formato de 3 níveis.

No nível 2 (introdução do sector), usar o template das 3 colunas

test pm2 automatic restart

  • create a script that increses the memory usage purposely
  • lauch with pm2 (configured to restart when memory is above certain value)
  • verify that it is working

(note: this has been done before!)

  • start pm2 + some processes automatically when the systems reboots

process dies when the shape file is too big (>=200)

For the cirac shapes the process dies when loading the shape to the database.

The problem seems to happend when we call child_process's exec with shp2pgsql ... | psql .... Alternatives:

  1. use 2 separate commands which don't involve streaming data

    • shp2pgsql > tem_output.sql
    • psql -f temp_output.sql
  2. use other tool like ogr2ogr

Indicadores

Para mais detalhes ver Plataforma/Indicadores de processo.docx (no ftp)

Há dois tipos de indicadores: "indicadores de processo" e "indicadores de conteúdo":

  • Indicadores de processo
    • com checkboxes
    • mostrar como uma lista
    • usar linguagem visual / cores para comunicar a falha de um indicador (caso não tenha sido
  • Indicadores de conteúdo
    • introdução de valores numéricos ou de acordo com uma escala ("bom, médio")
    • todos os anos os observadores têm de actualizar os dados
    • mostrar como gráfico ao longo do tempo

É necessário criar uma página "Indicadores".

Definir um grupo e utilizadores para editar os indicadores ("observadores"). Estes utilizadores não podem editar o website nem os mapas.

error in anonymous sql code to add new column

This doesn't seem to be working (because of the audit script)

CREATE TABLE IF NOT EXISTS shapes( 
    id SERIAL PRIMARY KEY,
    schema_name TEXT NOT NULL default 'geo',
    table_name TEXT NOT NULL UNIQUE,  -- the name of the file and the name of the shape might be slightly different
    srid INT REFERENCES spatial_ref_sys(srid) default 4326,
    geometry_type TEXT NOT NULL,
    attributes_info JSONB default '[]',
    description JSONB default '{}',
    file_id INT references files(id)  on update cascade on delete set null,
    owner_id INT REFERENCES users(id) ON DELETE SET NULL,
    created_at timestamptz not null default now(),
    CONSTRAINT description_must_be_object CHECK (jsonb_typeof(description) = 'object')
);

-- change 15.07.13: add json column for the inspire metadata
DO $$
DECLARE
    dummy INT;
BEGIN
    BEGIN
        ALTER TABLE shapes ADD COLUMN inspire JSONB default '{}';
    EXCEPTION
        WHEN duplicate_column THEN RAISE NOTICE 'column "inspire" already exists in "shapes", skipping';
    END;
END;
$$;

dev-no-auth

Remove all references to auth being false. What we really mean now is to test directly if env is dev-no-auth, and is so, use the credentials objects in the configuration

new map tool: sequential maps

The "sequential maps" (or "grouped maps") functionality should be in en extra tab in "map tools".

Objectives:

  • create a new "sequential map" (this is like a "meta-map", or a "container of normal maps")
  • add "normal maps" to the new "sequential map" (drag and drop)
  • define the basic properties: name, description, etc
  • edit existing "sequential maps"
  • delete existing "sequential maps"
  • define other specific options (play button, etc)

handle corner cases in the shapes table

  • If the geo table is deleted somehow from the geo schema but the corresponding row remains in the shapes table. What to do?
    • everytime we read the shapes table we should check that each entry has a corresponding table in the geo schema (there is already an action which gives all the tables in the geo schema)
    • if there is no corresponding geo table, delete the row from the schema table
  • (the inverse) If the a row is somehow deleted from the shapes table, but the corresponding table remains in the geo schema. What to do?
    • Before we invoke shp2pgsql (which requires a name for the table) and before we insert the new row inthe shapes table, we are already checking the name for the new table is unique among the existing rows in the shapes table, as well as among all the tables in the geo schema. So it is garanteed that the name of the table will be indeed unique and the process won't abort. So this case is already handled. We will get an "orphan" geo table, but it won't harm anyone.

refactor the pg functions

For the *_create and *_update functions, consider using json_array_elements instead of json_populate_recordset (see example below).

Advantages:

  • it would sove the problem found in the config table, where some value are objects while others are simple strings
  • it would make more explicit which keys we are actually using

http://www.postgresql.org/docs/9.4/static/functions-json.html

DO $$

DECLARE
    input_array JSON;

    input_obj JSON;
    id INT;
    name TEXT;
    some_field JSON;
BEGIN

SELECT '[{"id": 1, "name": "paulo", "some_field": {"xyz": 123} }, {"id": 2, "name": "ana"}]' INTO input_array;

FOR input_obj IN (SELECT * from json_array_elements(input_array)) LOOP

    -- extract only the keys that we are interested in
    SELECT input_obj->'id'         INTO id;
    SELECT input_obj->'name'       INTO name;
    SELECT input_obj->'some_field' INTO some_field;

    IF some_field IS NULL THEN
        SELECT '{"default": "value"}'::json INTO some_field;
    END IF;

    RAISE NOTICE 'Input data: %   %   %', id, name, some_field;
END LOOP;

END;
$$

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.