amat-mi / osmopgviews Goto Github PK
View Code? Open in Web Editor NEWBuild views on osmosis postgis database
Build views on osmosis postgis database
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;
Optionally show username by joining with users table.
Documentation on how to write the view files is missing.
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>
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.