update main.py
This commit is contained in:
parent
bd1f6263ca
commit
32a8c3f99f
29
main.py
29
main.py
|
|
@ -28,7 +28,12 @@ from sqlalchemy import text
|
|||
|
||||
UPLOAD_FOLDER.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
app = FastAPI(title="ETL Geo Upload Service")
|
||||
apiVersion = "1.1.0"
|
||||
app = FastAPI(
|
||||
title="ETL Geo Upload Service",
|
||||
version=apiVersion,
|
||||
description="Upload Automation API"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
@ -100,7 +105,23 @@ def detect_zip_type(zip_path: str) -> str:
|
|||
return "unknown"
|
||||
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
@app.get("/check", tags=["System"])
|
||||
async def health_check():
|
||||
response = {
|
||||
"status": "success",
|
||||
"message": "Server is running smoothly ✅",
|
||||
"data": {
|
||||
"service": "upload_automation",
|
||||
"status_code": 200,
|
||||
"timestamp": datetime.now(datetime.timezone.utc).isoformat() + "Z",
|
||||
},
|
||||
"meta": {
|
||||
"version": apiVersion,
|
||||
"environment": "deployment"
|
||||
}
|
||||
}
|
||||
return response
|
||||
|
||||
|
||||
|
||||
|
|
@ -266,8 +287,6 @@ async def upload_file(payload: PdfRequest):
|
|||
print("[INFO] Mencoba menambahkan geometry (MultiPolygon) berdasarkan nama wilayah...")
|
||||
result = attach_polygon_geometry_auto(result)
|
||||
|
||||
print("\n" + "="*80)
|
||||
|
||||
if isinstance(result, gpd.GeoDataFrame) and "geometry" in result.columns:
|
||||
geom_type = ", ".join([g for g in result.geometry.geom_type.unique() if g]) \
|
||||
if not result.empty else "None"
|
||||
|
|
@ -356,8 +375,6 @@ async def upload_file(payload: PdfRequest):
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
VALID_WKT_PREFIXES = (
|
||||
"POINT",
|
||||
"POINT Z",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user