update folder
This commit is contained in:
parent
3373521f53
commit
59e48fea4a
|
|
@ -8,7 +8,7 @@ from qgis.core import (
|
||||||
)
|
)
|
||||||
import processing
|
import processing
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
from core.config import HOST,PORT,DB,USER,PWD,SCHEMA,GEOM_COL
|
from config import HOST,PORT,DB,USER,PWD,SCHEMA,GEOM_COL
|
||||||
|
|
||||||
def load_layer(table_name: str):
|
def load_layer(table_name: str):
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
|
|
@ -85,17 +85,17 @@ def cleansing_layer(layer: QgsVectorLayer) -> Dict:
|
||||||
print("\nStep 3: Ensure MULTIPOLYGON (LTR-safe method)")
|
print("\nStep 3: Ensure MULTIPOLYGON (LTR-safe method)")
|
||||||
|
|
||||||
# Step 3.1: Pecah multiparts → single (agar bersih)
|
# Step 3.1: Pecah multiparts → single (agar bersih)
|
||||||
singleparts = processing.run(
|
# singleparts = processing.run(
|
||||||
"native:multiparttosingleparts",
|
# "native:multiparttosingleparts",
|
||||||
{"INPUT": fixed, "OUTPUT": "memory:"}
|
# {"INPUT": fixed, "OUTPUT": "memory:"}
|
||||||
)["OUTPUT"]
|
# )["OUTPUT"]
|
||||||
|
|
||||||
print(" - After multiparttosingleparts:", singleparts.featureCount())
|
# print(" - After multiparttosingleparts:", singleparts.featureCount())
|
||||||
|
|
||||||
# Step 3.2: Promote semua polygon → multipolygon
|
# Step 3.2: Promote semua polygon → multipolygon
|
||||||
multipolygon = processing.run(
|
multipolygon = processing.run(
|
||||||
"native:promotetomulti",
|
"native:promotetomulti",
|
||||||
{"INPUT": singleparts, "OUTPUT": "memory:"}
|
{"INPUT": fixed, "OUTPUT": "memory:"}
|
||||||
)["OUTPUT"]
|
)["OUTPUT"]
|
||||||
|
|
||||||
print(" - After promotetomulti:", multipolygon.featureCount())
|
print(" - After promotetomulti:", multipolygon.featureCount())
|
||||||
|
|
|
||||||
4
main.py
4
main.py
|
|
@ -13,7 +13,7 @@ from qgis.core import (
|
||||||
QgsCoordinateReferenceSystem
|
QgsCoordinateReferenceSystem
|
||||||
)
|
)
|
||||||
from qgis.PyQt.QtCore import QByteArray
|
from qgis.PyQt.QtCore import QByteArray
|
||||||
from core.config import HOST,PORT,DB,USER,PWD,SCHEMA,GEOM_COL
|
from config import HOST,PORT,DB,USER,PWD,SCHEMA,GEOM_COL
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
@ -75,7 +75,7 @@ def run_clean_table(table_name: str, job_id: str):
|
||||||
callback_payload = {
|
callback_payload = {
|
||||||
"job_id": job_id,
|
"job_id": job_id,
|
||||||
"table": table_name,
|
"table": table_name,
|
||||||
"summary": summary,
|
# "summary": summary,
|
||||||
"status": "FINISHED"
|
"status": "FINISHED"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user