[49] | 1 | <?php
|
---|
| 2 | /* alkisinlaybaurecht.php - Inlay fuer Template: Baurecht
|
---|
| 3 | ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo).
|
---|
| 4 |
|
---|
[105] | 5 | Version:
|
---|
[132] | 6 | 26.07.2011 debug |
---|
| 7 | 28.11.2011 import_request_variables
|
---|
[49] | 8 | */
|
---|
[132] | 9 | //ini_set('error_reporting', 'E_ALL & ~ E_NOTICE');
|
---|
| 10 | session_start(); |
---|
| 11 | import_request_variables("G");
|
---|
| 12 | //$gkz=urldecode($_REQUEST["gkz"]);
|
---|
[123] | 13 | require_once("alkis_conf_location.php");
|
---|
[132] | 14 | if ($auth == "mapbender") {require_once($mapbender);}
|
---|
| 15 | // $gmlid=urldecode($_REQUEST["gmlid"]); |
---|
[49] | 16 | ?>
|
---|
| 17 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
| 18 | <html>
|
---|
| 19 | <head>
|
---|
| 20 | <meta name="author" content="F. Jaeger krz" >
|
---|
| 21 | <meta http-equiv="cache-control" content="no-cache">
|
---|
| 22 | <meta http-equiv="pragma" content="no-cache">
|
---|
| 23 | <meta http-equiv="expires" content="0">
|
---|
| 24 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
---|
| 25 | <title>ALKIS Bau-, Raum- oder Bodenordnungsrecht</title>
|
---|
[123] | 26 | <link rel="stylesheet" type="text/css" href="alkisauszug.css">
|
---|
| 27 | <link rel="shortcut icon" type="image/x-icon" href="ico/Gericht.ico">
|
---|
[53] | 28 | <base target="_blank">
|
---|
[49] | 29 | </head>
|
---|
[123] | 30 | <body>
|
---|
[49] | 31 |
|
---|
| 32 | <?php
|
---|
| 33 | $con = pg_connect("host=".$dbhost." port=" .$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass);
|
---|
[123] | 34 | if (!$con) echo "<p class='err'>Fehler beim Verbinden der DB</p>\n";
|
---|
| 35 | if ($debug > 1) {echo "<p class='err'>DB=".$dbname.", user=".$dbuser."</p>";}
|
---|
[61] | 36 |
|
---|
[123] | 37 | // wie View "baurecht"
|
---|
| 38 | $sql ="SELECT r.ogc_fid, r.artderfestlegung as adfkey, r.name, r.stelle, r.bezeichnung AS rechtbez, ";
|
---|
| 39 | $sql.="a.bezeichner AS adfbez, d.bezeichnung AS stellbez, d.stellenart, ";
|
---|
| 40 | $sql.="round(st_area(r.wkb_geometry)::numeric,0) AS flae ";
|
---|
| 41 | $sql.="FROM ax_bauraumoderbodenordnungsrecht r ";
|
---|
| 42 | $sql.="LEFT JOIN ax_bauraumoderbodenordnungsrecht_artderfestlegung a ON r.artderfestlegung = a.wert ";
|
---|
| 43 | $sql.="LEFT JOIN ax_dienststelle d ON r.land = d.land AND r.stelle = d.stelle ";
|
---|
| 44 | $sql.="WHERE r.gml_id= $1 ;";
|
---|
| 45 |
|
---|
[61] | 46 | $v = array($gmlid);
|
---|
| 47 | $res = pg_prepare("", $sql);
|
---|
[123] | 48 | $res = pg_execute("", $v);
|
---|
[61] | 49 |
|
---|
[123] | 50 | if (!$res) {
|
---|
| 51 | echo "\n<p class='err'>Fehler bei Baurecht.</p>\n";
|
---|
| 52 | if ($debug > 2) {echo "<p class='err'>SQL=<br>".$sql."<br>$1 = ".$gmlid."</p>\n";}
|
---|
[49] | 53 | }
|
---|
[123] | 54 | echo "\n<h2><img src='ico/Gericht.ico' width='16' height='16' alt=''> Bau-, Raum- oder Bodenordnungsrecht</h2>\n";
|
---|
| 55 |
|
---|
[49] | 56 | if ($row = pg_fetch_array($res)) {
|
---|
[123] | 57 | echo "\n<table>";
|
---|
| 58 |
|
---|
[49] | 59 | echo "\n<tr>";
|
---|
[123] | 60 | echo "\n\t<td class='li'>Art der Festlegung:</td>\n\t<td><span class='key'>(".$row["adfkey"].")</span> ";
|
---|
[49] | 61 | echo "<span class='wichtig'>".$row["adfbez"]."</span></td>";
|
---|
[123] | 62 | echo "\n</tr>";
|
---|
| 63 |
|
---|
| 64 | $enam=$row["name"];
|
---|
[49] | 65 | if ($enam != "") {
|
---|
[64] | 66 | echo "\n<tr>";
|
---|
[49] | 67 | echo "\n\t<td class='li'>Eigenname des Gebietes:</td>\n\t<td>".$enam."</td>";
|
---|
[123] | 68 | echo "\n</tr>";
|
---|
[64] | 69 | }
|
---|
[49] | 70 | echo "\n<tr>";
|
---|
| 71 | echo "\n\t<td class='li'>Verfahrensnummer:</td>";
|
---|
| 72 | echo "\n\t<td>".$row["rechtbez"]."</td>";
|
---|
[123] | 73 | echo "\n</tr>";
|
---|
[49] | 74 |
|
---|
[123] | 75 | $stell=$row["stelle"];
|
---|
| 76 | if ($stell != "") {
|
---|
| 77 | echo "\n<tr>";
|
---|
| 78 | echo "\n\t<td class='li'>Dienststelle:</td>\n\t<td><span class='key'>(".$stell.")</span> ".$row["stellbez"];
|
---|
| 79 | $stellart=$row["stellenart"];
|
---|
| 80 | if ($stellart != "") {
|
---|
| 81 | echo " (".$stellart.")"; // d.stellenart -- weiter entschluesseln
|
---|
[64] | 82 | }
|
---|
[49] | 83 | echo "</td>";
|
---|
[123] | 84 | echo "\n</tr>";
|
---|
| 85 | }
|
---|
| 86 |
|
---|
[49] | 87 | echo "\n<tr>";
|
---|
[123] | 88 | echo "\n\t<td class='li'>Fläche:</td>";
|
---|
[49] | 89 | $flae=number_format($row["flae"],0,",",".")." m²";
|
---|
| 90 | echo "\n\t<td>".$flae."</td>";
|
---|
[123] | 91 | echo "\n</tr>";
|
---|
| 92 |
|
---|
| 93 | echo "\n</table>";
|
---|
| 94 | } else {
|
---|
| 95 | echo "\n<p class='err'>Fehler! Kein Treffer bei gml_id=".$gmlid."</p>";
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | echo "\n<h2><img src='ico/Flurstueck.ico' width='16' height='16' alt=''> betroffene Flurstücke</h2>\n";
|
---|
| 99 | echo "\n<p>Ermittelt durch geometrische Verschneidung. Nach Größe absteigend.</p>";
|
---|
| 100 |
|
---|
[49] | 101 | $sql ="SELECT f.gml_id, f.flurnummer, f.zaehler, f.nenner, f.amtlicheflaeche, ";
|
---|
[123] | 102 | $sql.="round(st_area(ST_Intersection(r.wkb_geometry,f.wkb_geometry))::numeric,1) AS schnittflae ";
|
---|
[49] | 103 | $sql.="FROM ax_flurstueck f, ax_bauraumoderbodenordnungsrecht r ";
|
---|
[123] | 104 | $sql.="WHERE r.gml_id= $1 ";
|
---|
| 105 | $sql.="AND st_intersects(r.wkb_geometry,f.wkb_geometry) = true ";
|
---|
| 106 | $sql.="AND st_area(st_intersection(r.wkb_geometry,f.wkb_geometry)) > 0.05 "; // > 0.0 ist gemeint, Ungenauigkeit durch st_simplify
|
---|
[137] | 107 | $sql.="AND isvalid(r.wkb_geometry) AND isvalid(f.wkb_geometry) ";
|
---|
[123] | 108 | $sql.="ORDER BY schnittflae DESC ";
|
---|
| 109 | // Limit: Flurbereinigungsgebiete koennen sehr gross werden!
|
---|
| 110 | $sql.="LIMIT 40;";
|
---|
| 111 | // Trotz Limit lange Antwortzeit, wegen OrderBy -> intersection
|
---|
[61] | 112 | $v = array($gmlid);
|
---|
| 113 | $res = pg_prepare("", $sql);
|
---|
[123] | 114 | $res = pg_execute("", $v);
|
---|
[61] | 115 |
|
---|
[123] | 116 | if (!$res) {
|
---|
| 117 | echo "\n<p class='err'>Keine Flurstücke ermittelt.<br>\nSQL=<br></p>\n";
|
---|
| 118 | if ($debug > 2) {echo "<p class='err'>SQL=<br>".$sql."<br>$1 = ".$gmlid."</p>\n";}
|
---|
[49] | 119 | }
|
---|
| 120 |
|
---|
[123] | 121 | echo "\n<table class='fs'>";
|
---|
| 122 | echo "\n<tr>"; // Header
|
---|
[49] | 123 | echo "\n\t<td class='head' title='Flur- und Flurstücksnummer'>Flurstück</td>";
|
---|
| 124 | echo "\n\t<td class='head fla' title='geometrische Schnittfläche'>Fläche</td>";
|
---|
| 125 | echo "\n\t<td class='head fla' title='amtliche Flurstücksfläche, Buchfläche'>von</td>";
|
---|
[123] | 126 | echo "\n\t<td class='head nwlink' title='Link zum Flurstück'>weitere Auskunft</td>";
|
---|
[49] | 127 | echo "\n</tr>";
|
---|
[123] | 128 |
|
---|
| 129 | $fscnt=0;
|
---|
| 130 | while($row = pg_fetch_array($res)) {
|
---|
[64] | 131 | $fscnt++;
|
---|
[49] | 132 | echo "\n<tr>";
|
---|
[123] | 133 | echo "\n\t<td>".$row["flurnummer"]."-<span class='wichtig'>".$row["zaehler"];
|
---|
| 134 | $nen=$row["nenner"];
|
---|
| 135 | if ($nen != "") {
|
---|
| 136 | echo "/".$nen;
|
---|
| 137 | }
|
---|
| 138 | echo "</span></td>";
|
---|
[49] | 139 | echo "\n\t<td class='fla'>".$row["schnittflae"]." m²</td>";
|
---|
[123] | 140 | echo "\n\t<td class='fla'>".$row["amtlicheflaeche"]." m²</td>";
|
---|
| 141 | echo "\n\t<td class='nwlink noprint'>";
|
---|
[49] | 142 | echo "\n\t\t<a target='_blank' href='alkisfsnw.php?gkz=".$gkz."&gmlid=".$row["gml_id"]."&eig=n";
echo "' title='Flurstücksnachweis'>Flurstück ";
|
---|
[123] | 143 | echo "\n\t\t\t<img src='ico/Flurstueck_Link.ico' width='16' height='16' alt=''>";
|
---|
| 144 | echo "\n\t\t</a>";
|
---|
| 145 | echo "\n\t</td>";
|
---|
| 146 | echo "\n</tr>";
|
---|
[49] | 147 | }
|
---|
[123] | 148 | echo "\n</table>";
|
---|
[49] | 149 |
|
---|
| 150 | if ($fscnt == 40) {
|
---|
[123] | 151 | echo "<p>... und weitere Flurstücke (Limit 40 erreicht).</0>";
|
---|
| 152 | }
|
---|
| 153 |
|
---|
| 154 | ?>
|
---|
[49] | 155 |
|
---|
| 156 | </body>
|
---|
| 157 | </html>
|
---|