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