feat: Update Koordinaten-Export und Ergaenzung Nordex N175
Deploy Standortplaner / deploy (push) Successful in 18s
Details
Deploy Standortplaner / deploy (push) Successful in 18s
Details
This commit is contained in:
parent
e823b10e93
commit
1dade4c566
50
app.js
50
app.js
|
|
@ -2840,7 +2840,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
|
||||
// Initialisiere jsPDF
|
||||
const { jsPDF } = window.jspdf;
|
||||
const doc = new jsPDF();
|
||||
const doc = new jsPDF('landscape');
|
||||
|
||||
// Titel und Projektname
|
||||
const projNameForFile = document.getElementById('projectSelector')?.options[document.getElementById('projectSelector')?.selectedIndex]?.text || 'Projekt unbekannt';
|
||||
|
|
@ -2853,6 +2853,10 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
let variantName = activeVariant === 'variant1' ? 'Variante 1' : activeVariant === 'variant2' ? 'Variante 2' : 'Variante 3';
|
||||
doc.text(`Variante: ${variantName}`, 14, 30);
|
||||
|
||||
// Finde Eigentümer Layer, falls vorhanden
|
||||
const ownerLayerKey = Object.keys(overlays).find(k => k.toLowerCase().includes('eigentümer'));
|
||||
const ownerLayer = ownerLayerKey ? overlays[ownerLayerKey] : null;
|
||||
|
||||
// Daten vorbereiten
|
||||
const tableData = activeTurbines.map(t => {
|
||||
const latlng = t.layers.marker.getLatLng();
|
||||
|
|
@ -2861,6 +2865,43 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
const anlagentyp = t.type === 'Standard Typ' ? '-' : (t.type || '-');
|
||||
let nennleistung = t.mw ? t.mw.toString() : '-';
|
||||
|
||||
let gemarkung = '-';
|
||||
let flur = '-';
|
||||
let flurstueck = '-';
|
||||
|
||||
if (ownerLayer) {
|
||||
const tPoint = turf.point([latlng.lng, latlng.lat]);
|
||||
let found = false;
|
||||
ownerLayer.eachLayer(l => {
|
||||
if (found) return;
|
||||
if (l.feature && l.feature.geometry) {
|
||||
try {
|
||||
if (turf.booleanPointInPolygon(tPoint, l.feature)) {
|
||||
const p = l.feature.properties || {};
|
||||
|
||||
const gmkKeys = ['GMK', 'Gemarkung', 'GEMARKUNG', 'gemarkung', 'GMK_NAME', 'gmk_name'];
|
||||
for (let k of gmkKeys) { if (p[k]) { gemarkung = p[k]; break; } }
|
||||
|
||||
const flurKeys = ['FLR', 'Flur', 'FLUR', 'flur'];
|
||||
for (let k of flurKeys) { if (p[k]) { flur = p[k]; break; } }
|
||||
|
||||
const fsKeys = ['FSZ', 'Flurstueck', 'FLURSTUECK', 'flurstueck', 'Flurstück', 'FLURSTÜCK', 'flurstück', 'FST_NR', 'FST'];
|
||||
for (let k of fsKeys) { if (p[k]) { flurstueck = p[k]; break; } }
|
||||
|
||||
if (flurstueck === '-' && p['ZAE']) {
|
||||
flurstueck = p['ZAE'];
|
||||
if (p['NEN']) { flurstueck += '/' + p['NEN']; }
|
||||
}
|
||||
|
||||
found = true;
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore turf errors
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return [
|
||||
t.nr,
|
||||
t.hersteller || '-',
|
||||
|
|
@ -2870,14 +2911,17 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
t.rd ? t.rd.toString() : '-',
|
||||
t.totalHeight ? t.totalHeight.toFixed(1) : '-',
|
||||
utmCoords[0].toFixed(2),
|
||||
utmCoords[1].toFixed(2)
|
||||
utmCoords[1].toFixed(2),
|
||||
gemarkung,
|
||||
flur,
|
||||
flurstueck
|
||||
];
|
||||
});
|
||||
|
||||
// Tabelle einfügen
|
||||
doc.autoTable({
|
||||
startY: 40,
|
||||
head: [['WEA Nr.', 'Hersteller', 'Anlagentyp', 'MW', 'NH (m)', 'RD (m)', 'GH (m)', 'Rechtswert (E)', 'Hochwert (N)']],
|
||||
head: [['WEA Nr.', 'Hersteller', 'Anlagentyp', 'MW', 'NH (m)', 'RD (m)', 'GH (m)', 'Rechtswert (E)', 'Hochwert (N)', 'Gemarkung', 'Flur', 'Flurstück']],
|
||||
body: tableData,
|
||||
theme: 'striped',
|
||||
headStyles: { fillColor: [0, 200, 255], textColor: [255, 255, 255] }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
const { Pool } = require('pg');
|
||||
const pool = new Pool({
|
||||
host: '87.106.21.21',
|
||||
port: 5432,
|
||||
database: 'enwelo',
|
||||
user: 'enwelo_admin',
|
||||
password: 'WX1t1cgP1qK09'
|
||||
});
|
||||
|
||||
async function checkTable() {
|
||||
try {
|
||||
const resCount = await pool.query("SELECT COUNT(*) FROM geodaten.wohngebaeude_umrisse;");
|
||||
console.log("Count:", resCount.rows[0].count);
|
||||
|
||||
const resIdx = await pool.query("SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'wohngebaeude_umrisse';");
|
||||
console.log("Indexes:", resIdx.rows);
|
||||
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
pool.end();
|
||||
}
|
||||
}
|
||||
checkTable();
|
||||
|
|
@ -9,3 +9,8 @@ UPDATE geodaten.wea_standorte SET projekt_id = 'trasse_bw_scheddebrock' WHERE pr
|
|||
UPDATE geodaten.wea_standorte SET projekt_id = 'projekt_bw_samern-ohne' WHERE projekt_id = 'bw_samern-ohne';
|
||||
UPDATE geodaten.wea_standorte SET projekt_id = 'projekt_bw_test' WHERE projekt_id = 'test';
|
||||
UPDATE geodaten.wea_standorte SET projekt_id = 'projekt_bw_an_der_landwehr' WHERE projekt_id ILIKE '%landwehr%';
|
||||
|
||||
-- 3. Nordex N175 Anlage mit Gesamthöhe 250m hinzufügen
|
||||
INSERT INTO geodaten.anlagendaten_wea (hersteller, anlagentyp, nabenhoehe, rotordurchmesser, nennleistung)
|
||||
VALUES ('Nordex', 'N175/6.X', 162.5, 175, 6.8)
|
||||
ON CONFLICT DO NOTHING;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
const { Pool } = require('pg');
|
||||
require('dotenv').config({ path: '.env' });
|
||||
const pool = new Pool({
|
||||
host: process.env.DB_HOST, port: process.env.DB_PORT, database: process.env.DB_NAME, user: process.env.DB_USER, password: process.env.DB_PASSWORD
|
||||
});
|
||||
pool.query('SELECT id, name FROM geodaten.projekte').then(res => { console.log(res.rows); pool.end(); }).catch(console.error);
|
||||
Loading…
Reference in New Issue