Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ponceta's full-sized avatar
😎
QWAT and QGEP up and running

Arnaud Poncet-Montanges ponceta

😎
QWAT and QGEP up and running
View GitHub Profile
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd"><Document><Placemark><Style><LineStyle><color>ffffffff</color><width>3</width></LineStyle><PolyStyle><color>66ffffff</color></PolyStyle></Style><Polygon><outerBoundaryIs><LinearRing><coordinates>7.520122751415624,45.99130785562291 7.483161664451418,45.99132825574732 7.481714916808554,45.98960168419232 7.520122751415624,45.99130785562291</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark><Placemark><Style><LineStyle><color>ffffffff</color><width>3</width></LineStyle><PolyStyle><color>66ffffff</color></PolyStyle></Style><Polygon><outerBoundaryIs><LinearRing><coordinates>7.48248834751651,45.98916961234793 7.487443958526103,45.98931153651031 7.49136706147149,45.98930979799488 7.499034735742794,45.98901815019563 7.518264163164633,45.9911652413043 7.48248834751651,45.98916961234793</coordinates></Line
@ponceta
ponceta / awards.kml
Last active August 29, 2015 14:20 — forked from davidoesch/awards.kml
Gist for awards
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<!-- Icons & Line defined -->
<!--License icons: Icons are availabe unter the Creative Commons Attribution-Share Alike 3.0 and generated with https://mapicons.mapsmarker.com/markers/media/award/?custom_color=77f23a -->
<Document>
<name>Roadshow geo.admin.ch</name><Style id="ico_current1"><IconStyle><Icon><href>https://sites.google.com/site/pichostdaevu/home/award_current.png</href></Icon></IconStyle><LabelStyle><scale>0</scale></LabelStyle></Style>
<name>Roadshow geo.admin.ch</name><Style id="ico_future2"><IconStyle><Icon><href>https://sites.google.com/site/pichostdaevu/home/award_future.png</href></Icon></IconStyle><LabelStyle><scale>0</scale></LabelStyle></Style>
<name>Roadshow geo.admin.ch</name><Style id="ico_past3"><IconStyle><Icon><href>https://sites.google.com/site/pichostdaevu/home/award_past.png</href></Icon></IconStyle><LabelStyle><scale>0</scale></LabelStyle></Style>
<name>Roadshow geo.admin.ch</name><Styl
let mapleader=","
syntax on
set bs=2
set background=dark
set number
"tabs as x spaces and smart indent
set smartindent
set tabstop=2
set shiftwidth=2
@ponceta
ponceta / gist:4dfc75b1610c2d3cc9cec629d1efbbde
Created January 5, 2017 10:12
QWAT DATA MODEL is NOT conform
pulmexa@ubuntu:~/qwat-data-model/update$ python test_migration.py --pg_service qwat
DataModel is NOT conform
Diff:
47a48
> "qwat_od","vw_element_valve"
50d50
< "qwat_od","vw_export_leak"
53d52
< "qwat_od","vw_export_pipe"
61a61
@ponceta
ponceta / cover_manhole_mod_pully.sql
Created April 19, 2017 09:19
cover_manhole_mod_pully
WITH netzlinien AS (
SELECT
gid,
-- ST_Fineltra(ST_SetSRID(ST_Point(first(y1),first(x1)),21781), 'chenyx06.chenyx06_triangles', 'the_geom_lv03', 'the_geom_lv95') as from_point,
ST_SetSRID(ST_Point(first(y1), first(x1)),21781) as from_point,
-- ST_Fineltra(ST_SetSRID(ST_Point(last(y1),last(x1)),21781), 'chenyx06.chenyx06_triangles', 'the_geom_lv03', 'the_geom_lv95') as to_point,
ST_SetSRID(ST_Point(last(y1), first(x1)),21781) as to_point,
-- ST_Fineltra(St_SetSRID(ST_GeomFromText('LINESTRINGZ('||string_agg(y1::varchar||' '||x1::varchar||' '||coalesce(z1,0)::varchar, ',' ORDER BY seq)||')'),21781), 'chenyx06.chenyx06_triangles', 'the_geom_lv03', 'the_geom_lv95') AS geometry
ST_SetSRID(ST_GeomFromText('LINESTRINGZ('||string_agg(y1::varchar||' '||x1::varchar||' '||coalesce(z1,0)::varchar, ',' ORDER BY seq)||')'),21781) as geometry
FROM sa.aw_netzlinie_geo
@ponceta
ponceta / PULLY_Pipe_materials.sql
Created April 24, 2017 13:08
Pipe_materials_PULLY
INSERT INTO qwat_vl.pipe_material (id, vl_active, short_fr, value_fr, _displayname_fr, short_en, value_en, _displayname_en, short_ro, value_ro, _displayname_ro, diameter, diameter_nominal, diameter_internal, diameter_external, code_sire, pressure_nominal, sdr, wall_thickness) VALUES (10000, true, 'AC', 'Acier', 'AC i', '', '', ' ', 'OL', 'Otel', 'OL ', '', NULL, NULL, NULL, 99, NULL, NULL, NULL);
INSERT INTO qwat_vl.pipe_material (id, vl_active, short_fr, value_fr, _displayname_fr, short_en, value_en, _displayname_en, short_ro, value_ro, _displayname_ro, diameter, diameter_nominal, diameter_internal, diameter_external, code_sire, pressure_nominal, sdr, wall_thickness) VALUES (10001, true, 'AC', 'Acier', 'AC 3/4 "', '', '', 'AC 3/4 "', 'OL', 'Otel', 'OL ', '3/4 "', 24, 22, 27, 99, NULL, NULL, NULL);
INSERT INTO qwat_vl.pipe_material (id, vl_active, short_fr, value_fr, _displayname_fr, short_en, value_en, _displayname_en, short_ro, value_ro, _displayname_ro, diameter, diameter_nominal, diameter_internal, diamet
@ponceta
ponceta / migration_TB2_QGEP.sql
Last active April 28, 2017 12:51
Notes de migration
SELECT DISTINCT ID_EINSTIEGHILFE
FROM AW_SCHACHT
SQL> select * from AW_SCHACHT_STEIGEISENG_TBD
ID EXTERNAL_ID VALUE DATE_OF_CREATION DESIGNER ACTIVE SHORT_VALUE COMMENTARY
---- ----------- ------------------- ---------------- -------- ------ ----------- ----------
10 autre 1
1 échelle 10.04.2000 SIA 1 EC
2 niches marchepied 10.04.2000 SIA 1 N
@ponceta
ponceta / Create_QGEP_Drawing_Scheme.sql
Last active February 1, 2018 09:57
Create_QGEP_Drawing_Scheme
CREATE SCHEMA qgep_dr
AUTHORIZATION qgep;
COMMENT ON SCHEMA qgep_dr
IS 'QGEP drawing tools';
/* CREATE TABLE */
CREATE TABLE qgep_dr.constructionpoint (id serial PRIMARY KEY);
COMMENT ON TABLE qgep_dr.constructionpoint IS 'construction points are artificials points to build objects.';
@ponceta
ponceta / qwat_od.valve.sql
Created July 26, 2018 14:08
QWAT OD valve
-- Table: qwat_od.valve
-- DROP TABLE qwat_od.valve;
CREATE TABLE qwat_od.valve
(
id integer NOT NULL DEFAULT nextval('qwat_od.valve_id_seq'::regclass),
fk_valve_type integer NOT NULL,
fk_valve_function integer NOT NULL,
fk_valve_actuation integer NOT NULL,
@ponceta
ponceta / vw_qgep_wastewater_structure2.sql
Last active December 13, 2018 13:54
Alternative view for wastewaterstructure
-- View: qgep_od.vw_qgep_wastewater_structure2
-- DROP VIEW qgep_od.vw_qgep_wastewater_structure2;
CREATE OR REPLACE VIEW qgep_od.vw_qgep_wastewater_structure2 AS
SELECT ws.identifier,
CASE
WHEN ma.obj_id IS NOT NULL THEN 'manhole'::text
WHEN ss.obj_id IS NOT NULL THEN 'special_structure'::text
WHEN dp.obj_id IS NOT NULL THEN 'discharge_point'::text