Ignore:
Timestamp:
12/30/21 17:49:00 (2 years ago)
Author:
frank.jaeger
Message:

Web-GIS-Auskunft und Mapbender2-Navigation: neue Konfigurations-Parameter und verbessertes Grundbuch-Modul

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/info/info/alkisn/alkisstrasse.php

    r422 r425  
    33 
    44        ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo). 
    5         Alle FlurstÃŒcke an einer Strasse anzeigen, egal ob "mit" oder "ohne" Hausnummer 
     5        Alle FlurstÃŒcke an einer Straße anzeigen, egal ob "mit" oder "ohne" Hausnummer 
    66        Parameter: "gml_id" aus der Tabelle "ax_lagebezeichnungkatalogeintrag" 
    77 
    88        Version: 
    9         2016-02-24 Version fuer norGIS-ALKIS-Import 
     9        2016-02-24 Version fÃŒr norGIS-ALKIS-Import 
    1010        ... 
    1111        2020-02-20 Authentifizierung ausgelagert in Function darf_ich() 
    1212        2020-12-15 Input-Validation und Strict Comparisation (===) 
     13        2021-12-09 Neue Parameter: $katAmtMix (Kataster-Amt-Mix), $PrntBtn (Drucken-SchaltflÀche) 
    1314*/ 
    1415ini_set("session.cookie_httponly", 1); 
     
    5253<?php 
    5354$erlaubnis = darf_ich(); if ($erlaubnis === 0) { die('<p class="stop1">Abbruch</p></body>'); } 
     55$dbg=$debug; // CONF in Arbeits-Variable 
    5456 
    5557// Mit URL-Parameter "&nodebug=j" kann man die Entwicklungsumgebung (in Conf definiert) ausschalten. 
    56 // Manuell an die URL anfÃŒgen, wirkt nur temporÀr und wird nicht in Links weiter gereicht. 
    57 if ($nodebug === "j") {$debug=0;}  
     58// Wirkt temporÀr und wird nicht in Links weiter gereicht. 
     59if ($nodebug === "j") {$dbg=0;}  
    5860 
    5961$con = pg_connect($dbconn." options='--application_name=ALKIS-Auskunft_alkisstrasse.php'"); 
     
    6365b.bezeichnung AS bnam, r.bezeichnung AS rnam, k.bezeichnung AS knam, g.bezeichnung AS gnam, o.gml_id AS ogml  
    6466FROM ax_lagebezeichnungkatalogeintrag s  
    65 JOIN ax_bundesland b ON s.land=b.land  
    66 JOIN ax_regierungsbezirk r ON s.land=r.land AND s.regierungsbezirk=r.regierungsbezirk  
    67 JOIN ax_kreisregion k ON s.land=k.land AND s.regierungsbezirk=k.regierungsbezirk AND s.kreis=k.kreis  
    68 JOIN ax_gemeinde g ON s.land=g.land AND s.regierungsbezirk=g.regierungsbezirk AND s.kreis=g.kreis AND s.gemeinde=g.gemeinde  
    69 LEFT JOIN ax_lagebezeichnungohnehausnummer o ON s.land=o.land AND s.regierungsbezirk=o.regierungsbezirk AND s.kreis=o.kreis AND s.gemeinde=o.gemeinde AND s.lage=o.lage  
     67JOIN ax_bundesland b ON s.land=b.land ".UnqKatAmt("s","b") 
     68."JOIN ax_regierungsbezirk r ON s.land=r.land AND s.regierungsbezirk=r.regierungsbezirk ".UnqKatAmt("s","r") 
     69."JOIN ax_kreisregion k ON s.land=k.land AND s.regierungsbezirk=k.regierungsbezirk AND s.kreis=k.kreis ".UnqKatAmt("s","k") 
     70."JOIN ax_gemeinde g ON s.land=g.land AND s.regierungsbezirk=g.regierungsbezirk AND s.kreis=g.kreis AND s.gemeinde=g.gemeinde ".UnqKatAmt("s","g") 
     71."LEFT JOIN ax_lagebezeichnungohnehausnummer o ON s.land=o.land AND s.regierungsbezirk=o.regierungsbezirk AND s.kreis=o.kreis AND s.gemeinde=o.gemeinde AND s.lage=o.lage  
    7072WHERE s.gml_id= $1 AND s.endet IS NULL AND b.endet IS NULL AND r.endet IS NULL AND k.endet IS NULL AND g.endet IS NULL AND o.endet IS NULL ;";  
    7173 
     
    7577if (!$res) { 
    7678        echo "\n<p class='err'>Fehler bei Lagebezeichnungskatalogeintrag.</p>"; 
    77         if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sql), ENT_QUOTES, "UTF-8")."</p>";} 
     79        if ($dbg > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sql), ENT_QUOTES, "UTF-8")."</p>";} 
     80} 
     81if ($dbg > 0) { 
     82        $zeianz=pg_num_rows($res); 
     83        if ($zeianz > 1){ 
     84                echo "\n<p class='err'>Die Abfrage liefert mehr als ein (".$zeianz.") Stra&szlig;en-Objekt!</p>"; 
     85                if ($dbg > 2) {echo "\n<p class='dbg'>SQL=<br>".htmlentities(str_replace("$1","'".$gmlid."'",$sql), ENT_QUOTES, "UTF-8")."</p>";} 
     86        } 
    7887} 
    7988if ($row = pg_fetch_assoc($res)) { 
     
    133142echo "\n\t</td>\n</tr>\n</table>"; 
    134143pg_free_result($res); 
    135 // Ende Seitenkopf 
    136  
    137 // F L U R S T U E C K E 
     144 
     145// F L U R S T Ü C K E 
    138146echo "\n\n<h3 id='fs'><img src='ico/Flurstueck.png' width='16' height='16' alt=''> Flurst&uuml;cke</h3>" 
    139147."\n<p>Zusammenfassung von 'Lage mit Hausnummer' und 'Lage ohne Hausnummer' an dieser Straße</p>"; 
     
    142150// ax_Flurstueck >zeigtAuf> ax_LagebezeichnungOhneHausnummer > = s = Strasse 
    143151// Suchkriterium: gml_id aus Katalog 
    144 $sql="SELECT fh.gemarkungsnummer, gh.bezeichnung, fh.gml_id, fh.flurnummer, fh.zaehler, fh.nenner, fh.amtlicheflaeche, lh.gml_id AS lgml, lh.hausnummer, 'm' AS ltyp 
     152$sql ="SELECT fh.gemarkungsnummer, gh.bezeichnung, fh.gml_id, fh.flurnummer, fh.zaehler, fh.nenner, fh.amtlicheflaeche, lh.gml_id AS lgml, lh.hausnummer, 'm' AS ltyp 
    145153 FROM ax_flurstueck fh  
    146154 JOIN ax_lagebezeichnungmithausnummer lh ON lh.gml_id=ANY(fh.weistAuf)  
    147  JOIN ax_gemarkung gh ON fh.land=gh.land AND fh.gemarkungsnummer=gh.gemarkungsnummer  
    148  JOIN ax_lagebezeichnungkatalogeintrag sh ON lh.land=sh.land AND lh.regierungsbezirk=sh.regierungsbezirk AND lh.kreis=sh.kreis AND lh.gemeinde=sh.gemeinde AND lh.lage=sh.lage  
     155 JOIN ax_gemarkung gh ON fh.land=gh.land AND fh.gemarkungsnummer=gh.gemarkungsnummer ".UnqKatAmt("fh","gh") 
     156."JOIN ax_lagebezeichnungkatalogeintrag sh ON lh.land=sh.land AND lh.regierungsbezirk=sh.regierungsbezirk AND lh.kreis=sh.kreis AND lh.gemeinde=sh.gemeinde AND lh.lage=sh.lage  
    149157 WHERE sh.gml_id = $1 AND fh.endet IS NULL AND lh.endet IS NULL AND gh.endet IS NULL AND sh.endet IS NULL 
    150158UNION SELECT fs.gemarkungsnummer, gs.bezeichnung, fs.gml_id, fs.flurnummer, fs.zaehler, fs.nenner, fs.amtlicheflaeche, ls.gml_id AS lgml, '' AS hausnummer, 'o' AS ltyp 
    151159 FROM ax_flurstueck fs  
    152160 JOIN ax_lagebezeichnungohnehausnummer ls ON ls.gml_id=ANY(fs.zeigtauf)  
    153  JOIN ax_gemarkung gs ON fs.land=gs.land AND fs.gemarkungsnummer=gs.gemarkungsnummer  
    154  JOIN ax_lagebezeichnungkatalogeintrag ss ON ls.land=ss.land AND ls.regierungsbezirk=ss.regierungsbezirk AND ls.kreis=ss.kreis AND ls.gemeinde=ss.gemeinde AND ls.lage=ss.lage  
     161 JOIN ax_gemarkung gs ON fs.land=gs.land AND fs.gemarkungsnummer=gs.gemarkungsnummer ".UnqKatAmt("fs","gs") 
     162."JOIN ax_lagebezeichnungkatalogeintrag ss ON ls.land=ss.land AND ls.regierungsbezirk=ss.regierungsbezirk AND ls.kreis=ss.kreis AND ls.gemeinde=ss.gemeinde AND ls.lage=ss.lage  
    155163 WHERE ss.gml_id = $1 AND fs.endet IS NULL AND ls.endet IS NULL AND gs.endet IS NULL AND ss.endet IS NULL 
    156164ORDER BY gemarkungsnummer, flurnummer, zaehler, nenner;"; 
     
    161169if (!$resf) { 
    162170        echo "\n<p class='err'>Fehler bei Flurst&uuml;ck.</p>"; 
    163         if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sql), ENT_QUOTES, "UTF-8")."</p>";}    
     171        if ($dbg > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sql), ENT_QUOTES, "UTF-8")."</p>";}      
    164172} 
    165173 
     
    176184$gwgmkg=""; // Gruppenwechsel 
    177185$gwflur=""; 
    178 $cnths=0; // Count Haus-Lagebezeichnung 
     186$cnths=0; // Count Haus-Lagebez. 
    179187 
    180188$zpaar=false; // Zeilen-Farbwechsel 
     
    233241} 
    234242pg_free_result($resf); 
     243 
     244echo "\n<div class='buttonbereich noprint'>\n<hr>" 
     245        ."\n\t<a title='zur&uuml;ck' href='javascript:history.back()'><img src='ico/zurueck.png' width='16' height='16' alt='zur&uuml;ck'></a>&nbsp;"; 
     246if ($PrntBtn==true){echo "\n\t<a title='Drucken' href='javascript:window.print()'><img src='ico/print.png' width='16' height='16' alt='Drucken'></a>&nbsp;";} 
     247echo "\n\t<a title='Export als CSV' href=\"javascript:ALKISexport('')\">alle<img src='ico/download.png' width='16' height='16' alt='Export'></a>&nbsp;" 
     248        ."\n\t<a title='CSV - nur Flurst&uuml;cke mit Hausnummer' href=\"javascript:ALKISexport('m')\">mit HsNr<img src='ico/download.png' width='16' height='16' alt='Export'></a>&nbsp;" 
     249        ."\n\t<a title='CSV - nur Flurst&uuml;cke ohne Hausnummer' href=\"javascript:ALKISexport('o')\">ohne<img src='ico/download.png' width='16' height='16' alt='Export'></a>&nbsp;" 
     250."\n</div>"; 
     251 
     252footer($gmlid, selbstverlinkung()."?", "");  
    235253?> 
    236  
    237 <div class='buttonbereich noprint'> 
    238 <hr> 
    239         <a title="zur&uuml;ck" href='javascript:history.back()'><img src="ico/zurueck.png" width="16" height="16" alt="zur&uuml;ck"></a>&nbsp; 
    240         <a title="Drucken" href='javascript:window.print()'><img src="ico/print.png" width="16" height="16" alt="Drucken"></a>&nbsp; 
    241         <a title="Export als CSV" href='javascript:ALKISexport("")'>alle<img src="ico/download.png" width="16" height="16" alt="Export"></a>&nbsp; 
    242         <a title="CSV - nur Flurst&uuml;cke mit Hausnummer" href='javascript:ALKISexport("m")'>mit HsNr<img src="ico/download.png" width="16" height="16" alt="Export"></a>&nbsp; 
    243         <a title="CSV - nur Flurst&uuml;cke ohne Hausnummer" href='javascript:ALKISexport("o")'>ohne<img src="ico/download.png" width="16" height="16" alt="Export"></a>&nbsp; 
    244 </div> 
    245  
    246 <?php footer($gmlid, selbstverlinkung()."?", ""); ?> 
    247254 
    248255</body> 
Note: See TracChangeset for help on using the changeset viewer.