From e562a6f2b511bcc4c3998c2c2f6b39daf4379b33 Mon Sep 17 00:00:00 2001 From: Francois Voisard Date: Tue, 14 Jul 2020 17:08:41 +0200 Subject: [PATCH 1/6] added new topic and layer road alignements --- config_db.yaml | 1 + crdppfportal/models.py | 23 +++++++--- crdppfportal/table2model_match.py | 4 +- mapserver/crdppf.map.mako | 72 +++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 7 deletions(-) diff --git a/config_db.yaml b/config_db.yaml index 4dfe7b1a..1bcfacdb 100644 --- a/config_db.yaml +++ b/config_db.yaml @@ -42,6 +42,7 @@ db_config: railways_construction_limits highways_project_zones highways_construction_limits + road_construction_limits airport_security_zones airport_project_zones airport_construction_limits diff --git a/crdppfportal/models.py b/crdppfportal/models.py index d4839b3e..aa36a45b 100644 --- a/crdppfportal/models.py +++ b/crdppfportal/models.py @@ -1,14 +1,19 @@ # -*- coding: utf-8 -*- from sqlalchemy import( - Column, - Sequence, - Integer, - Text, + Column, + Integer, String, - Float) - + ForeignKey) + +from sqlalchemy.orm import relationship, backref + +from papyrus.geo_interface import GeoInterface + +from geoalchemy2 import Geometry + from crdppf import db_config +srid_ = db_config['srid'] from crdppf.models import Base @@ -16,3 +21,9 @@ class Users(Base): __tablename__ = 'users' __table_args__ = {'schema': db_config['schema'], 'autoload': True} + +class RoadConstructionLimits(GeoInterface, Base): + __tablename__ = 'r078ne_alignements' + __table_args__ = {'schema': db_config['schema'], 'autoload': True} + idobj = Column(Integer, primary_key=True) + geom = Column(Geometry("MULTILINE", srid=srid_)) diff --git a/crdppfportal/table2model_match.py b/crdppfportal/table2model_match.py index 097be3d7..76812517 100644 --- a/crdppfportal/table2model_match.py +++ b/crdppfportal/table2model_match.py @@ -11,6 +11,7 @@ from crdppf.models.models import CHPollutedSitesPublicTransports, CHPollutedSitesPublicTransportsPDF from crdppf.models.models import WaterProtectionZones, WaterProtectionPerimeters from crdppf.models.models import RoadNoise, ForestLimits, ForestDistances +from crdppfportal.models import RoadConstructionLimits # Matching dictionnary model-table name table2model_match = { @@ -38,5 +39,6 @@ 'r132_perimetre_prot_eau': WaterProtectionPerimeters, 'r145_sens_bruit': RoadNoise, 'r157_lim_foret': ForestLimits, - 'r159_dist_foret': ForestDistances + 'r159_dist_foret': ForestDistances, + 'r078ne_alignements': RoadConstructionLimits } diff --git a/mapserver/crdppf.map.mako b/mapserver/crdppf.map.mako index 2af8a0a3..853ce94d 100644 --- a/mapserver/crdppf.map.mako +++ b/mapserver/crdppf.map.mako @@ -1876,6 +1876,78 @@ LAYER END END +LAYER + NAME "r078ne_alignements" + TYPE LINE + METADATA + "ows_title" "r078ne_alignements" + "wms_srs""EPSG:2056" + "wms_title" "${instanceid} WMS Server" + "wms_onlineresource" "http://${host}/${instanceid}/wmscrdppf" + END + CONNECTIONTYPE POSTGIS + CONNECTION "user=${dbuser} password=${dbpassword} dbname=${db} host=${dbhost} port=${dbport}" + PROCESSING "CLOSE_CONNECTION=DEFER" + DATA "geom from crdppf.r078ne_alignements using unique idobj using srid=2056" + STATUS ON + TEMPLATE "ttt" + TOLERANCE 5 + TOLERANCEUNITS pixels + CLASSITEM "codegenre" + CLASS + NAME "alignement primaire" + EXPRESSION /ali_prim/ + STYLE + WIDTH 3 + COLOR 25 60 116 + END + END + CLASS + NAME "alignement secondaire" + EXPRESSION /ali_sec/ + STYLE + WIDTH 2 + COLOR 25 60 116 + END + END + CLASS + NAME "front d'implantation obligatoire" + EXPRESSION /fio/ + STYLE + PATTERN 6 6 END + WIDTH 3 + COLOR 31 120 180 + END + END + CLASS + NAME "bande d'implantation obligatoire" + EXPRESSION /bio/ + STYLE + WIDTH 4 + COLOR 31 120 180 + END + END + CLASS + NAME "alignement de rez-de-chaussée" + EXPRESSION /ali_rez/ + STYLE + WIDTH 2 + COLOR 14 88 162 + END + END + CLASS + NAME "alignement en cas de reconstruction" + EXPRESSION /ali_rec/ + STYLE + PATTERN 6 6 END + WIDTH 2 + COLOR 31 120 180 + END + END + MINSCALEDENOM 50 +END + + ##################### # RESTRICTIONS CRDPPF - fin ##################### From 9e9fc8d98867f95e4e229888b0b9ae9c6a577b01 Mon Sep 17 00:00:00 2001 From: Francois Voisard Date: Wed, 15 Jul 2020 12:30:12 +0200 Subject: [PATCH 2/6] added icons for road alignement and fixed topic display --- crdppfportal/static/images/icons/ali_prim.png | Bin 0 -> 750 bytes crdppfportal/static/images/icons/ali_rec.png | Bin 0 -> 604 bytes crdppfportal/static/images/icons/ali_rez.png | Bin 0 -> 765 bytes crdppfportal/static/images/icons/ali_sec.png | Bin 0 -> 761 bytes crdppfportal/static/images/icons/bio.png | Bin 0 -> 736 bytes crdppfportal/static/images/icons/fio.png | Bin 0 -> 660 bytes mapserver/crdppf.map.mako | 2 +- 7 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 crdppfportal/static/images/icons/ali_prim.png create mode 100644 crdppfportal/static/images/icons/ali_rec.png create mode 100644 crdppfportal/static/images/icons/ali_rez.png create mode 100644 crdppfportal/static/images/icons/ali_sec.png create mode 100644 crdppfportal/static/images/icons/bio.png create mode 100644 crdppfportal/static/images/icons/fio.png diff --git a/crdppfportal/static/images/icons/ali_prim.png b/crdppfportal/static/images/icons/ali_prim.png new file mode 100644 index 0000000000000000000000000000000000000000..2f96792744d78618450dd70ca52a6a602039967d GIT binary patch literal 750 zcmVKYaRTW1_02Adaa37x?$@U;lzVi#MIfh_GkGH2Uw~e}OsE&RluO zz`!6QA-HW;o`@h1kw(v7ceJ{H0|NttxG*0Rru4Ecry%AsFfcrM@jkhF;g6rci81%o zrTcZ0HbK~4_B!ZBzkKtlb;ed?k<*tSRQ9g>_wOHmbDzKdm|DB|@85q63=Fzz(luE= z=teh8+5G9t4+aJXIZ2_?WOs<*%I#-ntT=?n+@HVxq}MHe{q8dZ1A`zx*WA{4PIgul zqxYY@v2pJO2)m;=C_m0A+|vZYZJEAx*U@XZjBc2`2@-~kjEplHVq_!)85kH4Mt}SM ztD<)ugdN~w;9#!K#KhEI9Av7i01?b;TzdWPb4+trY&*Sh!*K|^I>XD>L>0nD7(HRp zp2yGMGcYjl@o+Tc_(B9Z*jeYc#zS23?fb9ziurHee?d0)!u7`$J!>IsUq`)+2s^kG z)adJXpHE+Y5W=p>^cEB5gR2k`OVfRSL{y#JC?v+&pNzYGiv>WbpM6`@Q_ zOejYG{rj)HXDuXhO?4C^z0J_Ptf?$Htv(vUh9{WcfBt4REP3|oBLf2iFE_{B)_5K+ z4rE;{3`hx?nVG4xG?`*C znij?vuRq$yc0&?eZj4i9x+kW&5b*EczoL%StG1s(6E9A5ElzU7RL}gAPyhV&#|#V% za*{$b8lzcRm~k1+$jInmrhe@F-Dj^pzy)2cG~0`Vn3xzb)iWJFa~s0yC=TM}V8dlD z1aPpk&S{C078ihU6=g&w)kIPLRF#rGn literal 0 HcmV?d00001 diff --git a/crdppfportal/static/images/icons/ali_rec.png b/crdppfportal/static/images/icons/ali_rec.png new file mode 100644 index 0000000000000000000000000000000000000000..50f17828240ec2c9bdb45f7f91cc17d409b5f37d GIT binary patch literal 604 zcmV-i0;BzjP)PIc-@pGKzWw6oWM#y3^@F!x-6tIS`R5-y3)9a(|9V37LyToea`nG||Nk>EFkwo} zK6LNrpMQad(mkR2%uI}r-hCy>Tm}XPCMHH^CPs$;7+}}c7dgw$z4`p(|NsB*zWn_A z_aCMjOz`LLzgM4rAd6rznhfy!&)>uar{pWP+u=tQ^G`o~M;3qb{#*Xa3k(bl1um*~s-nnJP@`9zethiiTV^Ik zHWutb6l)=Grz-N{+wbgU=YIbA3laSJ=WovP^B=zbwpSI+byP*u!oP9Z-@pHPvyUIY`N~LHmStv&W&?w(u3J9*CTo9m80 zc`TJkEjpDR)D+UIJibbc-+<8NcxuoBE%>|KledeEaDKeskY^`Vl|j(4W8m)7;gAtrQp- z7*LG<`0ZE4qB9H(3=NS+Vgj5D3=FL?#>UFRPu_k@oqF`|zkj&Q{qy%<>eM4o-+ePt z5ow7wh6th<-M0GTix1yTR7B#PR3IYktjr7Y?F4z)_Fj6{z5X&Tqr2B%-goJ_5HI_J zd^>hlW~k_Y7&w3L4S(b!{>Via?!Wzy3ie!h$``SSFJjT23s3)JfZZ3KKxFq`M3H5J z`>1g4$^ZWuGCef)6@<_n<*YAN5v<3+z>qxU@Z&dMk)oxS_EX6adoVD*x-XYan15$2km zZOzPtp4gZe7#M1np8fRww~M}%pQ#*Hb0I*4k7H4xJqt7AterR49KFBh=>6HdZn7{l zE-bJY=HtLr&$$2cGym2-?5s>DyZsc!dGQzx0kd}AC|z)xi=CN)f#KWFzdea&sc!1n zJ$jeV;pN94l_7fGCit8T2Zl<*cV2wD^x*yPzyCw56zU@k85yycFf8JNoHkr+x!&5u vn9IPxz{JEjF~vfFn~i~ip)t}3Pss%Uin&Am&&TJq00000NkvXXu0mjfvBiol literal 0 HcmV?d00001 diff --git a/crdppfportal/static/images/icons/ali_sec.png b/crdppfportal/static/images/icons/ali_sec.png new file mode 100644 index 0000000000000000000000000000000000000000..7adfaea5d3b38bac08a819673be2f4ce78a734e2 GIT binary patch literal 761 zcmV4^CaWpMinl?T4>Z z>mr$$n20p@-@kvQU29HVx^JKd)VQX|;>refWys+_xXTq}MI}^Y>q3uyufo0RsaA ziqW6Ge6OFhiGhKkD&0#|h?jwZp)T9kP*e8Vs}DKN%m4oUhs)eQfBxn)FMsyxqmh3xw~Gz{bZyi7wu~f5n*Rznb{O8$j5cy)XfQt_Tn;n;-b9=Pu&va=bG6R z!wydx|6$k!!kCsAaX;65tv zUHAY0|CCT0T{USmM>&|Q7bm(hFfe2{EqnU%J+jo37w>bLmNPIg6eqdao2es9L5*Iz z<>ZCyk0nI-N|M~LdbuFp#okQq{iknfwTplL`U4UC`Rh-5-QxG3zB!nw7sNTEX<=eu zV0iWRQ`?N~3=9lS`To4z*z+DUGt-pXNGUP?^Vc6YP1^zyY?`|H{Po9DVggfYBbk}e z6B`o)14GlaEuX*sa5PucJ?A&qo;A2n9IPx@aNzEj3s9; zJpMq?+!r5zq%AoMF_(dX;s5{t=tgh9`eM)ZSI8pYfB#KfaO&=>FL=!T@%wN3k~6PA z|AdPaxTvBS{o&iMhD}#7b-w@hJ8u4|7axCMHTU1Y|CQ@6UwrZrE|PAiyW;d? zI5*2dxjR@t)K~^Ca_i-nltpL0!=eEK4%~dzzT-Nat0clbDcq2SnF(R^kKcbQ*I!0f zk>#Mm#KhPZsOzFB1{Xi`@O|!zbH8D6b@$bm+~w!tNsO1BWp3pIMm{yX>I ze1#j)9;C~`%FMvPz{<=tIl{<99+9;7Tz^%y{_?+n|37~JowE4M=bwKd;*5+8Q=$x& zMS0*VSr`}?ZoK$3{oq}=P^77>xuP(f%gM$(C(a~n*6~{}p^0Sm*(bu>Y}cQEMs`h= zr>4Cc!hZ}542-}3{0*IX{5&k>it@7WDYWN@c?u3*eEbnSl zMr1*zrKcX9N6Hb6zS@}PGB7Ym@N+CmG!x{)B4r>e&=#nRW-bE*1Jk1858)hFO>qxx z39Rm7U|>)dvWzEGWjyJ~PIc162@eG`tMqW@B#j)5f$M&4Dvwj9Fl6*qE7S z#hQroabQ)J66}85!FGbS#xc@R$n+=N`U)_4x-YGn1qMrQxgpzHgom9B zqnR*;wqAY)F_(dX;mL>Z8B5Oo{QZ|0vz~qUK55_WOHV%FH2V7U&&b>}58rq0yh+g9 z7axE4Pd(bV`&RP8Gr#`)!)|nMuzr4T_z?*1_lO3 z`o1EdIa`R-buXy7m%;UFoTjZU=P-!l0!mA8I%3OkH&5?>{Wbk%58X(YtRu zt~`f?BOF|R{;7Jy6$sl~S2EQ`2`&W1*G0la5 zuRs4XFfg2c@VeG)-n1*yaC0yn*FfgRqDg_%!L)h)xZ*02w z6vAd>VZt<*fq{YfuVKiACm$IY7-R)Gr$icIRRr}QBcp?w=<$1RpMU(pz`(Hm$_oQo z0R<6mT`g;;Ze*u Date: Wed, 15 Jul 2020 14:20:22 +0200 Subject: [PATCH 3/6] added conditionnal definition for the new model --- crdppfportal/models.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/crdppfportal/models.py b/crdppfportal/models.py index aa36a45b..c80c6c9e 100644 --- a/crdppfportal/models.py +++ b/crdppfportal/models.py @@ -22,8 +22,12 @@ class Users(Base): __tablename__ = 'users' __table_args__ = {'schema': db_config['schema'], 'autoload': True} -class RoadConstructionLimits(GeoInterface, Base): - __tablename__ = 'r078ne_alignements' - __table_args__ = {'schema': db_config['schema'], 'autoload': True} - idobj = Column(Integer, primary_key=True) - geom = Column(Geometry("MULTILINE", srid=srid_)) +if 'road_building_lines' in db_config['restrictions']: + class RoadBuildingLines(GeoInterface, Base): + __tablename__ = 'r078ne_alignements' + __table_args__ = {'schema': db_config['schema'], 'autoload': True} + idobj = Column(Integer, primary_key=True) + geom = Column(Geometry("MULTILINE", srid=srid_)) +else: + class RoadBuildingLines(): + pass From ab035e2349d30aa6d698e1f7453e71c992083de4 Mon Sep 17 00:00:00 2001 From: Francois Voisard Date: Wed, 15 Jul 2020 14:21:40 +0200 Subject: [PATCH 4/6] changed layer name --- config_db.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_db.yaml b/config_db.yaml index 1bcfacdb..5cc99170 100644 --- a/config_db.yaml +++ b/config_db.yaml @@ -42,7 +42,7 @@ db_config: railways_construction_limits highways_project_zones highways_construction_limits - road_construction_limits + road_building_lines airport_security_zones airport_project_zones airport_construction_limits From f1aac4e6e9d3d41b92413002d1485babf57ea2a0 Mon Sep 17 00:00:00 2001 From: Francois Voisard Date: Wed, 15 Jul 2020 14:22:56 +0200 Subject: [PATCH 5/6] changed class name --- crdppfportal/table2model_match.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crdppfportal/table2model_match.py b/crdppfportal/table2model_match.py index 76812517..b008b751 100644 --- a/crdppfportal/table2model_match.py +++ b/crdppfportal/table2model_match.py @@ -11,7 +11,7 @@ from crdppf.models.models import CHPollutedSitesPublicTransports, CHPollutedSitesPublicTransportsPDF from crdppf.models.models import WaterProtectionZones, WaterProtectionPerimeters from crdppf.models.models import RoadNoise, ForestLimits, ForestDistances -from crdppfportal.models import RoadConstructionLimits +from crdppfportal.models import RoadBuildingLines # Matching dictionnary model-table name table2model_match = { @@ -40,5 +40,5 @@ 'r145_sens_bruit': RoadNoise, 'r157_lim_foret': ForestLimits, 'r159_dist_foret': ForestDistances, - 'r078ne_alignements': RoadConstructionLimits + 'r078ne_alignements': RoadBuildingLines } From 475140021b6ebda3f3bfb39d24f02df52edd77f5 Mon Sep 17 00:00:00 2001 From: Francois Voisard Date: Wed, 15 Jul 2020 14:25:28 +0200 Subject: [PATCH 6/6] reverted changes on other layer definition --- mapserver/crdppf.map.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapserver/crdppf.map.mako b/mapserver/crdppf.map.mako index b6119bc5..853ce94d 100644 --- a/mapserver/crdppf.map.mako +++ b/mapserver/crdppf.map.mako @@ -1788,7 +1788,7 @@ LAYER CONNECTIONTYPE POSTGIS CONNECTION "user=${dbuser} password=${dbpassword} dbname=${db} host=${dbhost} port=${dbport}" PROCESSING "CLOSE_CONNECTION=DEFER" - DATA "geom from noise_sensitivity_levels.v_r145_sens_bruit using unique idobj using srid=2056" + DATA "geom from crdppf.r145_sens_bruit using unique idobj using srid=2056" STATUS ON CLASSITEM "codegenre" OPACITY 50