feat(parcel-sync): DXF export in ZIP + detailed tooltips on hero buttons
DXF Export: - Add gpkgToDxf() helper using ogr2ogr -f DXF (non-fatal fallback) - export-local: terenuri.dxf, cladiri.dxf, terenuri_magic.dxf in ZIP - export-bundle: same DXF files alongside GPKGs - Zero overhead — conversion runs locally from DB data, no eTerra calls Hero Button Tooltips: - Hover shows ZIP contents: layer names, entity counts, sync dates - Base tooltip: "GPKG + DXF per layer" - Magic tooltip: "GPKG + DXF + CSV complet + Raport calitate" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -562,6 +562,19 @@ export async function POST(req: Request) {
|
||||
zip.file("terenuri.gpkg", terenuriGpkg);
|
||||
zip.file("cladiri.gpkg", cladiriGpkg);
|
||||
|
||||
// DXF versions (non-fatal)
|
||||
try {
|
||||
const { gpkgToDxf } = await import(
|
||||
"@/modules/parcel-sync/services/gpkg-export"
|
||||
);
|
||||
const tDxf = await gpkgToDxf(terenuriGpkg, "TERENURI_ACTIVE");
|
||||
if (tDxf) zip.file("terenuri.dxf", tDxf);
|
||||
const cDxf = await gpkgToDxf(cladiriGpkg, "CLADIRI_ACTIVE");
|
||||
if (cDxf) zip.file("cladiri.dxf", cDxf);
|
||||
} catch {
|
||||
// DXF conversion not available — skip silently
|
||||
}
|
||||
|
||||
// ── Comprehensive quality analysis ──
|
||||
const withGeomRecords = dbTerenuri.filter(
|
||||
(r) =>
|
||||
@@ -685,6 +698,15 @@ export async function POST(req: Request) {
|
||||
|
||||
if (validated.mode === "magic" && magicGpkg && csvContent) {
|
||||
zip.file("terenuri_magic.gpkg", magicGpkg);
|
||||
try {
|
||||
const { gpkgToDxf } = await import(
|
||||
"@/modules/parcel-sync/services/gpkg-export"
|
||||
);
|
||||
const mDxf = await gpkgToDxf(magicGpkg, "TERENURI_MAGIC");
|
||||
if (mDxf) zip.file("terenuri_magic.dxf", mDxf);
|
||||
} catch {
|
||||
// DXF conversion not available
|
||||
}
|
||||
zip.file("terenuri_complet.csv", csvContent);
|
||||
report.magic = {
|
||||
csvRows: csvContent.split("\n").length - 1,
|
||||
|
||||
@@ -182,6 +182,15 @@ async function buildFullZip(siruta: string, mode: "base" | "magic") {
|
||||
zip.file("terenuri.gpkg", terenuriGpkg);
|
||||
zip.file("cladiri.gpkg", cladiriGpkg);
|
||||
|
||||
// DXF versions (non-fatal — ogr2ogr may not be available)
|
||||
const { gpkgToDxf } = await import(
|
||||
"@/modules/parcel-sync/services/gpkg-export"
|
||||
);
|
||||
const terenuriDxf = await gpkgToDxf(terenuriGpkg, "TERENURI_ACTIVE");
|
||||
if (terenuriDxf) zip.file("terenuri.dxf", terenuriDxf);
|
||||
const cladiriDxf = await gpkgToDxf(cladiriGpkg, "CLADIRI_ACTIVE");
|
||||
if (cladiriDxf) zip.file("cladiri.dxf", cladiriDxf);
|
||||
|
||||
if (mode === "magic") {
|
||||
// ── Magic: enrichment-merged GPKG + CSV + quality report ──
|
||||
const headers = [
|
||||
@@ -295,6 +304,8 @@ async function buildFullZip(siruta: string, mode: "base" | "magic") {
|
||||
});
|
||||
|
||||
zip.file("terenuri_magic.gpkg", magicGpkg);
|
||||
const magicDxf = await gpkgToDxf(magicGpkg, "TERENURI_MAGIC");
|
||||
if (magicDxf) zip.file("terenuri_magic.dxf", magicDxf);
|
||||
zip.file("terenuri_complet.csv", csvRows.join("\n"));
|
||||
|
||||
// ── Quality analysis ──
|
||||
|
||||
Reference in New Issue
Block a user