You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sql+=f"UPDATE {list_tables[feature_type]} SET doable = False WHERE {feature_type}_id = '{feature_id}' AND psector_id = {selected_psector} AND state = '{state}';"
""" Update the muni_id of all features getting the spatial intersection with the municipality """
1404
1419
1405
-
sql="""
1406
-
UPDATE node n SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom) LIMIT 1) WHERE EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom));
1407
-
UPDATE arc a SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom) LIMIT 1) WHERE EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom));
1420
+
sql=f"""
1421
+
UPDATE node n
1422
+
SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom) LIMIT 1)
1423
+
WHERE workcat_id = '{self.workcat}' AND sector_id = {self.sector}
1424
+
AND EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom));
1425
+
1426
+
UPDATE arc a
1427
+
SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom) LIMIT 1)
1428
+
WHERE workcat_id = '{self.workcat}' AND sector_id = {self.sector}
1429
+
AND EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom));
# Just create the 'VARC' catalog to temporarly insert them as varcs
526
541
execute_sql("""
527
542
INSERT INTO cat_arc (id, arc_type, shape, geom1)
@@ -2109,9 +2124,16 @@ def get_subc_geom(subc):
2109
2124
def_update_municipality(self):
2110
2125
""" Update the muni_id of all features getting the spatial intersection with the municipality """
2111
2126
2112
-
sql="""
2113
-
UPDATE node n SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom) LIMIT 1) WHERE EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom));
2114
-
UPDATE arc a SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom) LIMIT 1) WHERE EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom));
2127
+
sql=f"""
2128
+
UPDATE node n
2129
+
SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom) LIMIT 1)
2130
+
WHERE workcat_id = '{self.workcat}' AND sector_id = {self.sector}
2131
+
AND EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, n.the_geom));
2132
+
2133
+
UPDATE arc a
2134
+
SET muni_id = (SELECT m.muni_id FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom) LIMIT 1)
2135
+
WHERE workcat_id = '{self.workcat}' AND sector_id = {self.sector}
2136
+
AND EXISTS (SELECT 1 FROM ext_municipality m WHERE ST_Intersects(m.the_geom, a.the_geom));
0 commit comments