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