Giter VIP home page Giter VIP logo

osmopgviews's People

Contributors

sigfrido avatar

Stargazers

 avatar

Watchers

 avatar

osmopgviews's Issues

Views on relations

Allow user to define views on relations.
We should be able to specify geometry (multilinestring, multipoint or geometrycollection), and which roles to include in the geometry collection.

An example for routes:

CREATE OR REPLACE VIEW osm_views.routes AS
SELECT r.id,
g.geom,
r.tags -> 'ref'::text AS ref,
r.tags -> 'route'::text AS route,
r.tags -> 'from'::text AS inizio,
r.tags -> 'to'::text AS fine,
r.tags -> 'name'::text AS nome,
r.tags -> 'operator'::text AS operator,
r.tags -> 'network'::text AS network,
r.tags
FROM relations r
LEFT JOIN ( SELECT m.relation_id,
st_collect(w.linestring) AS geom
FROM relation_members m
LEFT JOIN ways w ON m.member_type = 'W'::bpchar AND m.member_id = w.id
GROUP BY m.relation_id) g ON r.id = g.relation_id
WHERE (r.tags -> 'type'::text) = 'route'::text
ORDER BY r.tags -> 'ref'::text;

Show username

Optionally show username by joining with users table.

  • Parse a specific option in meta, i.e. users.name or username
  • Generate SQL accordingly

Raw sql

We should be able to optionally encapsulate the generated sql in a raw sql:

raw=select v.*, n.* from v left join nodes n on ... where ...

If raw is present, the generated sql becomes:

create view xyz as
with v as (<previous view sql select >) <raw_statement>

Use tags in where but not in columns

Sometimes I may need to use a tag in the where clause, but I don't want it to be in the column list.

We could use a modifier for tag names, like "-tag_name", in tags list.

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.