[Geocoding] Nominatim patches

Ілля Романенко illia.romanenko at googlemail.com
Mon Aug 1 17:57:04 BST 2011


Hi all guys,

i've looked into nominatim sources and found some that i think that is bug.
I've mentioned one in forums but looks like there is no devs here so i'm
posing here:

1)
http://forum.openstreetmap.org/viewtopic.php?id=11987

In Ukraine it's common situation to have housenumbers like 43/2 and so on -
in order to make them searcheable we should update search.php:

$sHouseNumberRegex = '\\\\m'.str_replace(' ','[-,
]',$aSearch['sHouseNumber']).'\\\\M';

to

$sHouseNumberRegex = '\\\\m'.str_replace(' ','[-, */*
]',$aSearch['sHouseNumber']).'\\\\M';

2)

I found that in one case
http://localhost/~seth/reverse?format=xml&lat=49.989675&lon=36.206152&zoom=18&addressdetails=1

nominatim returns street that is far away of specified place. Looking into
sources i found that in

if ($iMaxRank >= 26)

{

// Street level search is done using placex table

                                $sSQL = 'select place_id from placex';

$sSQL .= ' WHERE ST_DWithin('.$sPointSQL.', geometry, '.$fSearchDiam.')';

$sSQL .= ' and rank_search >= 26 and rank_search <= '.$iMaxRank;

$sSQL .= ' and (ST_GeometryType(geometry) not in
(\'ST_Polygon\',\'ST_MultiPolygon\') ';

  $sSQL .= ' OR ST_DWithin('.$sPointSQL.', ST_Centroid(geometry),
'.$fSearchDiam.'))';

$sSQL .= ' and rank_address != 0 and type != \'houses\'';

if ($bNamedOnly) $sSQL .= ' and (name is not null or housenumber is not
null)';

$sSQL .= ' ORDER BY rank_search desc, ST_distance('.$sPointSQL.', *geometry*)
ASC limit 1';


should be replaced for

$sSQL .= ' ORDER BY rank_search desc, ST_distance('.$sPointSQL.', *
ST_Centroid(geometry)*) ASC limit 1';

after it - reverse script returns nearby subway station.

Hope you will add this fixes to all benefit from better search.


Illia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20110801/b52dc6c7/attachment.html>


More information about the Geocoding mailing list