[PHP5] [Script] OpenGeoDB Location.php läuft nicht richtig

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • [PHP5] [Script] OpenGeoDB Location.php läuft nicht richtig

    Hallo Leute,

    ich fummel hier schon seit Tagen rum und kriege es nicht auf die Reihe, dass die location.php mir die Deutschlandkarte zeichnet.

    Das Eingeben des Ortes funktioniert. Die anschliessende Auswahl des "genauen Ortes" auch. Nur anschliessend spuckt das System weder die Karte mit dem eingezeichneten Punkt noch die Orte im Umkreis von 10km aus. Es erscheint keine Fehlermeldung. Der Bildschirm bleibt ab dem Eingabefeld und der Ortsnamenüberschrift einfach weiß.

    Um den Fehler genauer einzugrenzen: Wenn ich eine fertige Karte, wie zum Beispiel 19020.png in das maps-Directory reinkopiere, dann funktioniert das Anzeigen der Karte, wenn ich als Ort Kaiserslautern eingegeben habe. Aber das Neuerstellen und das Selbstzeichnen einer Karte funktioniert nicht.

    Ich benutze:
    - Apache 2.2
    - MySQL 5.0.21
    - PHP 5.1.4
    - PEAR + PEAR DB (installiert von go-pear 1.97)
    - Betriebssystem Windows XP Home
    - GeoClass 0.3.1a
    - opengeodb 0.2.4d
    - aktuelle location.php von sourcefourge.com

    Meine Verzeichnisstruktur:

    location.php

    maps\ponet.e00 (generiert und downgeloaded von http://www.maproom.psu.edu/dcw/ , ist das richtig?)
    maps\D.png
    maps\germany_staatline.e00
    geo\geo.php
    geo\map.php
    geo\object.php
    geo\helpers\e00.php
    geo\helpers\map.php
    geo\sources\Common.php
    geo\sources\DB.php
    geo\sources\DB_Nima.php
    geo\sources\DB_OpenGeoDB.php
    geo\sources\DB_Relational.php
    geo\sources\RDF.php
    geo\sources\Soap.php

    Hat jemand eine Idee wegen der Neuzeichnnung der Karte und der Darstellung der Orte in 10km Umkreis?

    Vielen Dank für Eure Hilfe !

    Gruss,

    Martin

    Mein Konfigurationsteil der location.php:
    --------------------------------------------------
    PHP-Code:
    /**
     * Konfiguration
     */
     

    if (!defined('DSN')) {
     
    // Hier müssen die Zugangsdaten für die Datenbank eingetragen werden:
     
    define(DSN,'mysql://root:@localhost/geodata'); 
    }
    if (!
    defined('PATH_DATA')) {
     
    // Enter the path to the E00 files (for the new creation of the map)
     // The file germany_staatline.e00 should be included here
     // Other E00 files for state borders can be found at
     // [url]http://www.maproom.psu.edu/dcw/[/url]
     
     // Hier muss der Pfad zu den E00-Dateien angegeben werden (zum
     // Neuzeichnen der Karte)
     // Die Datei germany_staatline.e00 sollte bei dieser Datei dabeisein
     // Weitere E00-Dateien für Staatsgrenzen gibt es bei
     // [url]http://www.maproom.psu.edu/dcw/[/url]
     
    define(PATH_DATA,'maps');

    Und hier der Abschnitt für das Zeichnen der Map
    ------------------------------------------------------------
    PHP-Code:
    if ($_GET["id"]) {
     
     
    // Ein Datensatz ausgewählt
     
     // Datensatz des gewählten Ortes auslesen
     
    $sql 'SELECT name.loc_id, name.text_val as "name", iso.text_val as "iso", land.text_val as "land", level, lon, lat '.
     
    'FROM geodb_hierarchies hi, geodb_textdata name, geodb_textdata iso, geodb_textdata land, geodb_coordinates co '.
     
    'WHERE hi.loc_id = '.$_GET["id"].' and name.loc_id = hi.loc_id and name.text_type = 500100000 and name.is_default_name = 1 and '.
     
    'iso.loc_id = hi.id_lvl2 and iso.text_type = 500100001 and '.
     
    'land.loc_id = hi.id_lvl2 and land.text_type = 500100000 and land.is_default_name = 1 and '.
     
    'co.loc_id = hi.loc_id '.
     
    'ORDER BY hi.valid_until DESC';
     list(
    $ort) = $geodb->performQuery($sql);
     echo 
    '<h2>'.$ort->dbValues['name'].'</h2>';
     
     if (!
    file_exists('maps/'.(int)$_GET["id"].'.png') || $_GET["newMap"]) {
     
     
    // Der Parameter newMap erzwingt das Neuzeichnen der Karte
     
    if ($_GET["newMap"]) {
     
    //$map2 = Geo::setupMap(188,235);
     
    $map2 Geo::setupMap(376,470);
     
    $map2->setRange(5.515.547.255.1);
     
    $map2->color['borders'] = $map2->color(192192192);
     
    $map2->color['states'] = $map2->color(212212212);
     
     
    $map2->addDataFile(PATH_DATA."/germany_staatline.e00"'states'); // Grenzen Bundesländer
     
    $map2->addDataFile(PATH_DATA."/ponet.e00"'borders'); // Grenzen Staat
     
    $map2->saveImage('maps/D.png');
     } else {
     
    $map2 Geo::setupMap("maps/D.png");
     
    $map2->setRange(5.515.547.255.1);
     }
     
     
    $map2->addGeoObject($ort'red'3);
     
    $map2->saveImage('maps/'.(int)$_GET["id"].'.png');
     }

     echo 
    '<div style="float:left">';
     

     if (
    $_GET["style"] == "1") {
     echo 
    '<img src="maps/wikipedia_'.(int)$_GET["id"].'.png" width="188" height="235" alt="Lage von '.$ort->dbValues['name'].' in Deutschland">';
     } else {
     echo 
    '<img src="maps/'.(int)$_GET["id"].'.png" width="188" height="235" alt="Lage von '.$ort->dbValues['name'].' in Deutschland">';
     }
     echo 
    '</div>'

    Hier der Abschnitt für das Finden der Orte in der Umgebung
    ---------------------------------------------------------------------------
    PHP-Code:
    // Orte in der Umgebung finden
     
    $treffer $geodb->findCloseByGeoObjects($ort10false);
     
    $home $ort;
     if (
    is_array($treffer) && count($treffer)>1) {
     echo 
    '<div style="border-bottom:1px solid #CCCCCC;"><b>Orte im Umkreis von 10 km</b></div><br>';
     echo 
    '<ol>';
     foreach (
    $treffer AS $ort) {
     if (
    $ort->dbValues["loc_type"] == GEO_OGDB_POPULATED_AREA && $home->dbValues["loc_id"] != $ort->dbValues["id"]) {
     echo 
    '<li>';
     if (
    $ort->dbValues['typ']>6) {
     echo 
    '<a href="'.$_SERVER['PHP_SELF'].'?id='.$ort->dbValues['id'].'&q='.$_GET['q'].'">'.$ort->dbValues['name'].'</a>';
     } else {
     echo 
    '<b><a href="'.$_SERVER['PHP_SELF'].'?id='.$ort->dbValues['id'].'&q='.$_GET['q'].'">'.$ort->dbValues['name'].'</a></b>';
     }
     echo 
    '<br>';
     
     echo 
    '<small>';
     
    // Land / Bundesland / Regierungsbezirk / Landkreis:
     
    for($n 2$n 6$n++) {
     if (
    $n == 4) { // Skip Regierungsbezirk
     
    continue;
     }
     
    $sql3 'SELECT text_val '.
     
    'FROM geodb_hierarchies hi, geodb_textdata td '.
     
    'WHERE hi.loc_id = '.$ort->dbValues["id"].' and td.loc_id = hi.id_lvl'.$n.' and text_type = 500100000 and is_default_name = 1 '.
     
    'ORDER BY hi.valid_until DESC';
     
    $tx $geodb->performQuery($sql3);
     if (
    is_array($tx) && count($tx)>=1) {
     echo (
    $n != 2?' &gt; ':'').$tx[0]->dbValues["text_val"];
     }
     } 
    Zuletzt geändert von Bingoboy1975; 18.07.2006, 10:53.
Lädt...
X