Startseite
  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche
Startseite › Forum › Drupalcenter.de › Module ›

Location-Module, Umkreissuche (Proximity Search), PLZ Problem

Eingetragen von cedrix (28)
am 19.02.2009 - 11:19 Uhr in
  • Module
  • Drupal 6.x

Hallo,

ich nutze Druapl 6 mit Locations und Gmap. Habe die Module installiert und auch die Datenbank mit den PLZ gefüttert. Habe nach dieser Anleitung (http://drupal.org/node/359463) alles erledigt. Ich habe zwei Nodes mit Location-Settings, diese werden in GMap auch korrekt angezeigt. In den nodes sind Lat/Longitude gespeichert. Das Problem ist, dass eine Suche nach PLZ nicht funktioniert.

Ich habe eine View/Ansich erstellt mit einem Proximity-Filter (exposed, also einstellbar für Benutzer). Trägt man einen "Standort" im Format Latitude/Longitude ein, un wählt z.B. 200km Umkreis aus, findet er die entsprechende Node. Wählt man als Standort die Eingabe über PLZ, erhält man ein leeres Ergebnis.

Das Ergebnis mit Latitude/Longitude funktioniert und sieht im Vorschau-Modus so aus:

Zitat:

Textkörper:

Jop 1
Distance / Proximity: 170.24 km
Textkörper:

Jop 2
Distance / Proximity: 171.99 km
Abfrage

SELECT node.nid AS nid,
   node_revisions.body AS node_revisions_body,
   node_revisions.format AS node_revisions_format,
   (IFNULL(ACOS(0.601630442741*COS(RADIANS(location.latitude))*(0.988022017143*COS(RADIANS(location.longitude)) + 0.154312973013*SIN(RADIANS(location.longitude))) + 0.798774567927*SIN(RADIANS(location.latitude))), 0.00000)*6364467.83762) AS location_distance
FROM node node
LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid
LEFT JOIN location location ON location_instance.lid = location.lid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE (location.latitude > 44.0107947979 AND location.latitude < 62.0156872649 AND location.longitude > -6.19830854786 AND location.longitude < 23.9522147979) AND ((IFNULL(ACOS(0.601630442741*COS(RADIANS(location.latitude))*(0.988022017143*COS(RADIANS(location.longitude)) + 0.154312973013*SIN(RADIANS(location.longitude))) + 0.798774567927*SIN(RADIANS(location.latitude))), 0.00000)*6364467.83762) < 1000000) AND (node.type in ('neutest'))

Die gleiche Abfrage mit Eingabe einer PLZ sieht so aus:

Abfrage

SELECT node.nid AS nid,
   node_revisions.body AS node_revisions_body,
   node_revisions.format AS node_revisions_format,
   'Unknown' AS location_distance
FROM node node
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
LEFT JOIN location_instance location_instance ON node.vid = location_instance.vid
LEFT JOIN location location ON location_instance.lid = location.lid
WHERE (0) AND (node.type in ('neutest'))

und liefert ein leeres Ergebnis.

Irgendwie werden PLZ nicht in Longitude/Latitude-Werte gewandelt, oder?!

Kann mir jemand sagen, wie die PLZ Proximity-Suche klappt oder wenn es einer geschafft hat, wie es geht?!

Danke im Voraus!

Cedrix

‹ Kurze Frage zu Webforms Form - Webform $form_state value ändern klappt nicht! ›
  • Anmelden oder Registrieren um Kommentare zu schreiben

Benutzeranmeldung

  • Registrieren
  • Neues Passwort anfordern

Aktive Forenthemen

  • Drupal 8/9 SEO-Beratung/Coaching
  • Hilfe zu Views und Filter?
  • Variable aus dem inkludierten Partial Template auslesen
  • Probleme beim Versand von Mails via Drupal 9
  • Drupal 9: Wie kommt der Inhalt eines selbst erstellten Feldes in page-title.html.twig
  • Drupal DACH Meetup - Donnerstag 4. März 2021, 19 Uhr
  • Layout-Builder hängt
  • Sollte das Forum vielleicht lieber offline gehen?
  • Cronjob für Multisite
  • Drupal oder Symfony Web Entwickler (m/w/i*) in Hamburg
  • Problem mit Verschlüsselungsmodul Real AES: PHP-encryption library via Composer
  • [gelöst] nodeone Tutorials nicht mehr online?
Weiter

Neue Kommentare

  • manarak schrieb Ich konnte
    vor 18 Stunden 18 Minuten
  • Geschafft!
    vor 19 Stunden 33 Minuten
  • montviso schrieb Bist Du auf
    vor 20 Stunden 33 Minuten
  • bewerben Sie sich bitte wie
    vor 1 Tag 56 Minuten
  • Dann per persönlicher
    vor 1 Tag 1 Stunde
  • da es sich um eine
    vor 1 Tag 1 Stunde
  • Danke AliGerne möchte ich
    vor 1 Tag 1 Stunde
  • Danke für den Tipp! Ich werde
    vor 1 Tag 1 Stunde
  • Um welche Seite gehts denn?
    vor 1 Tag 1 Stunde
  • Hallo, wir sind ein junges
    vor 1 Tag 21 Stunden

Statistik

Beiträge im Forum: 246072
Registrierte User: 18884

Neue User:

  • uniquename
  • xapizm
  • maklko

» Alle User anzeigen

User nach Punkten sortiert:
wla9015
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3917
ronald3831
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 1 Benutzer und 5 Gäste online.

Benutzer online

  • bv

Hauptmenü

  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche

Quicklinks I

  • Infos
  • Drupal Showcase
  • Installation
  • Update
  • Forum
  • Team
  • Verhaltensregeln

Quicklinks II

  • Drupal Jobs
  • FAQ
  • Drupal-Kochbuch
  • Best Practice - Drupal Sites - Guidelines
  • Drupal How To's

Quicklinks III

  • Tipps & Tricks
  • Drupal Theme System
  • Theme Handbuch
  • Leitfaden zur Entwicklung von Modulen

RSS & Twitter

  • Drupal Planet deutsch
  • RSS Feed News
  • RSS Feed Planet
  • Twitter Drupalcenter
Drupalcenter Team | Impressum & Datenschutz | Kontakt
Angetrieben von Drupal | Drupal is a registered trademark of Dries Buytaert.
Drupal Initiative - Drupal Association