From 52265a33ba2fa4e6f862688909f43fab1c13817d Mon Sep 17 00:00:00 2001 From: Marc Tobias Metten Date: Tue, 28 Oct 2014 14:27:40 +0100 Subject: [PATCH] for PlaceLookup if we look for nodes then the centroid does not exist in the placex table --- lib/PlaceLookup.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PlaceLookup.php b/lib/PlaceLookup.php index e0016337..f013fe17 100644 --- a/lib/PlaceLookup.php +++ b/lib/PlaceLookup.php @@ -46,7 +46,8 @@ $sSQL .= " get_address_by_language(place_id, $sLanguagePrefArraySQL) as langaddress,"; $sSQL .= " get_name_by_language(name, $sLanguagePrefArraySQL) as placename,"; $sSQL .= " get_name_by_language(name, ARRAY['ref']) as ref,"; - $sSQL .= " st_y(centroid) as lat, st_x(centroid) as lon"; + $sSQL .= " (case when centroid is null then st_y(st_centroid(geometry)) else st_y(centroid) end) as lat,"; + $sSQL .= " (case when centroid is null then st_x(st_centroid(geometry)) else st_x(centroid) end) as lon"; $sSQL .= " from placex where place_id = ".(int)$this->iPlaceID; $aPlace = $this->oDB->getRow($sSQL); -- 2.39.5