Ignore:
Timestamp:
11/12/18 13:11:24 (2 years ago)
Author:
frank.jaeger
Message:

Umstellung Suche (nav) auf Full-Schema, Nachkorrektur Auskunft.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mapbender/http/nav/alkisnav_fls.php

    r400 r413  
    88        2017-03-06 Korrektur: Gemeinde-Suche bei Kreis-DB in norGIS-Struktur 
    99        2018-02-15 Strikte Input-Validation der Parameter 
     10        2018-11-12 Full-Schema 
    1011*/ 
    1112 
     
    514515 
    515516        // Body 
    516         $sql ="SELECT f.gml_id, f.flurnummer, f.zaehler, f.nenner, f.gemeinde, "; 
     517        $sql ="SELECT f.gml_id, f.flurnummer, f.zaehler, f.nenner, f.gemeindezugehoerigkeit_gemeinde, "; 
    517518        if($epsg == "25832") { // Transform nicht notwendig 
    518519                $sql.="st_x(st_Centroid(f.wkb_geometry)) AS x, "; 
     
    523524        } 
    524525 
    525         $sql.="FROM ax_flurstueck f WHERE f.gemarkungsnummer= $1 AND f.flurnummer= $2 AND endet IS NULL  
    526         ORDER BY f.zaehler, f.nenner LIMIT $3 ;"; 
     526        $sql.="FROM ax_flurstueck f WHERE f.gemarkungsnummer= $1 AND f.flurnummer= $2 AND endet IS NULL ORDER BY f.zaehler, f.nenner LIMIT $3 ;"; 
    527527        $v=array($zgemkg4, $zflur, $linelimit); 
    528528        $res=pg_prepare("", $sql); 
     
    566566        $whcl="WHERE flurstueckskennzeichen like $1 AND endet IS NULL "; 
    567567 
    568         $sql ="SELECT 'h' AS ftyp, gml_id, cast(zaehler AS integer) AS zaehler, cast(nenner AS integer) AS nenner, nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueck ".$whcl; 
    569         $sql.="UNION SELECT 'o' AS ftyp, gml_id, cast(zaehler AS integer) AS zaehler, cast(nenner AS integer) AS nenner, nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueckohneraumbezug ".$whcl; 
    570         $sql.="ORDER BY zaehler, nenner LIMIT $2 ;";  
     568        $sql ="SELECT 'h' AS ftyp, gml_id, cast(zaehler AS integer) AS zaehler, cast(nenner AS integer) AS nenner, nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueck ".$whcl 
     569        ."UNION SELECT 'o' AS ftyp, gml_id, cast(zaehler AS integer) AS zaehler, cast(nenner AS integer) AS nenner, nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueckohneraumbezug ".$whcl 
     570        ."ORDER BY zaehler, nenner LIMIT $2 ;";  
    571571        // "zaehler" und "nenner" sind in der Classic-Datenbank Integer-Werte aber in der Struktur  
    572572        // des norGIS-ALKIS-Importers sind das Character-Strings, die linksbÃŒndig ohne fÃŒhrende Nullen gefÃŒllt sind. 
     
    698698 
    699699        // NICHT in aktuell suchen wenn explizit historisch gesucht wird 
    700         $sql ="SELECT 'h'".$fldlist."nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueck ".$whcl; 
    701         $sql.="UNION SELECT 'o'".$fldlist."nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueckohneraumbezug ".$whcl; 
     700        $sql ="SELECT 'h'".$fldlist."nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueck ".$whcl 
     701        ."UNION SELECT 'o'".$fldlist."nachfolgerflurstueckskennzeichen as nachf FROM ax_historischesflurstueckohneraumbezug ".$whcl; 
    702702 
    703703        $v=array($fskzwhere); 
     
    736736 
    737737                        // Pass auf! Spalte zaehler hat unterschiedliches Format in den 3 Tabellen 
    738                         $nasql ="SELECT 'a' AS ftyp, gml_id, gemarkungsnummer, flurnummer, cast(zaehler AS character varying), nenner FROM ax_flurstueck ".$nawhcl; 
    739                         $nasql.="UNION SELECT 'h' AS ftyp, gml_id, gemarkungsnummer, flurnummer, zaehler, nenner FROM ax_historischesflurstueck ".$nawhcl; 
    740                         $nasql.="UNION SELECT 'o' AS ftyp, gml_id, gemarkungsnummer, flurnummer, zaehler, nenner FROM ax_historischesflurstueckohneraumbezug ".$nawhcl; 
     738                        $nasql ="SELECT 'a' AS ftyp, gml_id, gemarkungsnummer, flurnummer, cast(zaehler AS character varying), nenner FROM ax_flurstueck ".$nawhcl 
     739                        ."UNION SELECT 'h' AS ftyp, gml_id, gemarkungsnummer, flurnummer, zaehler, nenner FROM ax_historischesflurstueck ".$nawhcl 
     740                        ."UNION SELECT 'o' AS ftyp, gml_id, gemarkungsnummer, flurnummer, zaehler, nenner FROM ax_historischesflurstueckohneraumbezug ".$nawhcl; 
    741741 
    742742                        $v=array(); 
Note: See TracChangeset for help on using the changeset viewer.