Aloha
Nous sommes sous Oracle Spatial et nous travaillons sur l'enrichissement de notre logiciel de consultation du PLU par les instructeurs de l'urba.
Nous avons ce genre de requête pour croiser différentes table
Ce que je souhaite c'est lancer cette requête mais qu'elle ne me sorte que les enregistrements en double (i.e. même section, même numéro de parcelle) et non tous les enregistrements. Mais tous les doublons avec les valeurs de S intersection, de Zonage_U,...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 /*Rq avec le critère S, S/S >0.1*/ Select PARC.GID, RZPOS."zonage_U" as "ZONAGE", RZPOS."zone_UrG" as "ZONE", '51'||substr(PARC.IDENT,1,3) as "INSEE", ltrim(substr(PARC.IDENT,7,2),'0') as "SECTION", ltrim(substr(PARC.IDENT,9,4),'0') as "NUMERO", /*select count(PARC.GID)*/ round((SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/(SDO_GEOM.SDO_AREA(PARC.GEOMETRY,0.005)))*100,3) " S INTERSECTION (%)", round(SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/1000000,3) " S INTERSECTION (m2)", round((SDO_GEOM.SDO_LENGTH(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY,0.005),0.1)*0.2),4) "Px0.4/2 INT", round(SDO_GEOM.SDO_AREA(PARC.GEOMETRY, 0.005)/1000000,2) "S PARCELLE en m2", round(SDO_GEOM.SDO_LENGTH(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY,0.005),0.1)/1000,4) "P INTERSECTION (m)" from A_REIMS.PP_RZPOS RZPOS, A_REIMS.PCI_PARC PARC, A_REIMS.PP_EMCTR EMP where EMP."numero_e"='10' and SDO_FILTER(PARC.GEOMETRY,EMP.GEOMETRY)='TRUE' and (SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=contains querytype=WINDOW')='TRUE' OR SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=covers querytype=WINDOW')='TRUE' OR SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=overlapbdyintersect querytype=WINDOW')='TRUE' OR SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=equal querytype=WINDOW')='TRUE') and round((SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/(SDO_GEOM.SDO_AREA(PARC.GEOMETRY,0.005)))*100,3)>0.1 and round(SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/1000000,3)>0.1 and substr(PARC.IDENT,1,3)='454';
Quelqu'un a-t'il une idée ?
Une fois la requête exécutée nous utilisons les résultats pour visualiser dans APIC les collections d'objets posant problèmes et arbitrer.
J'ai testé une modification de cette requête avec une sous interrogation :
Solution testée.
Problème j'obtiens toutes mes parcelles. Toutes les parcelles de mon agglomération alors qu'il y a deux trois critères de requêtes géographiques. Et le count est égal au nombre de parcelles intersectant l'emprise.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 /*Rq avec le critère pour ressortir les doublons*/ Select PARC.GID, count(*) from A_REIMS.PCI_PARC PARC, (select PARC.GID, RZPOS."zonage_U" as "ZONAGE", RZPOS."zone_UrG" as "ZONE", '51'||substr(PARC.IDENT,1,3) as "INSEE", ltrim(substr(PARC.IDENT,7,2),'0') as "SECTION", ltrim(substr(PARC.IDENT,9,4),'0') as "NUMERO", round((SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/(SDO_GEOM.SDO_AREA(PARC.GEOMETRY,0.005)))*100,3) " S INTERSECTION (%)", round(SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/1000000,3) " S INTERSECTION (m2)", round((SDO_GEOM.SDO_LENGTH(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY,0.005),0.1)*0.2),4) "Px0.4/2 INT", round(SDO_GEOM.SDO_AREA(PARC.GEOMETRY, 0.005)/1000000,2) "S PARCELLE en m2", round(SDO_GEOM.SDO_LENGTH(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY,0.005),0.1)/1000,4) "P INTERSECTION (m)" from A_REIMS.PP_RZPOS RZPOS, A_REIMS.PCI_PARC PARC, A_REIMS.PP_EMCTR EMP where EMP."numero_e"='10' and SDO_FILTER(PARC.GEOMETRY,EMP.GEOMETRY)='TRUE' and (SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=contains querytype=WINDOW')='TRUE' OR SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=covers querytype=WINDOW')='TRUE' OR SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=overlapbdyintersect querytype=WINDOW')='TRUE' OR SDO_RELATE(RZPOS.GEOMETRY,PARC.GEOMETRY,'mask=equal querytype=WINDOW')='TRUE') and round((SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/(SDO_GEOM.SDO_AREA(PARC.GEOMETRY,0.005)))*100,3)>0.1 and round(SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(PARC.GEOMETRY,RZPOS.GEOMETRY, 0.005),0.005)/1000000,3)>0.1 and substr(PARC.IDENT,1,3)='454') group by PARC.GID having count(*)>1 ;
Une idée ?
Partager