[OSM-talk] name finder: "pubs near Cambridge"
David Earl
david at frankieandshadow.com
Thu May 24 10:55:17 BST 2007
In updating the index for the name finder (
http://www.frankieandshadow.com/osm ) to this week's planet file, I have
added some capabilities, which with some remarkably minor changes give a big
increase in functionality:
1. You can now give a lat,lon pair instead of the search term or the place
name contextualising your search
2. You can now search on type of item not just its name (or ref).
3. The result now tells you not just '7km from Cambridge' but also the
direction: '7km south-east of Cambridge'
4. The word 'near'(*) is equivalent to a comma: this is just syntactic
sugar, but it reads more naturally in some cases.
Here are some of the interesting things you can now do:
Fulbourn [as before]
52.18,0.20 [where is this, in context? **]
Hinton Road, Fulbourn [as before]
Hinton Road near Fulbourn [equivalent to above]
Hinton Road near 52.18,0.20
hospitals near Fulbourn [churches, pubs, supermarkets, stations, atms,
...***, ****]
pubs near 52.18,0.20 [specially for Nick!]
post offices near Cambridge, UK [qualifying which one, using is_in]
places near Fulbourn
villages near 52.18,0.20
suburbs near Cambridge
airports near Cambridge
airports [not that helpful, you'll just get a random 30 of them]
Ipswich : 52.18,0.20 [how far between them?]
* all lower case, to avoid the problem of not otherwise being able to search
for 'Long Near Meadow' or some such.
** tells you where you are in relation to nearby places: e.g. 'requested
location found less than 1km west of middle of village Fulbourn in
Cambridgeshire, England, UK (which is about 7km east of city Cambridge,
ditto)'
*** Because types of item and their names use the same index, 'places [or
place] near Cambridge' will yield 'street Abbey Place...' as well as 'suburb
Chesterton', and likewise 'churches near Waterbeach' may yield 'street
Church Lane...' among the results. For this reason, at the moment I've
prevented searches for e.g. 'place of worship near Cambridge', because
'places near Cambridge' would otherwise yield all the 'place of worship' too
if I put that term in the index. But 'place of worship' is translated into
'church' or 'mosque' if there is enough information in the place_of_worship
node to determine this, but I'm afraid Hindu temples and the like will have
to wait for now.
**** In general, an item has to have a name or ref in order to be found.
However, I've made some exceptions to this to put certain anonymous items in
the index, for example supermarkets and cinemas, so 'cinemas near Cambridge'
will give you them all, not just the named ones. OTOH, highways are not
indexed by type at all, so you can't currently say 'highways near
Cambridge'.
David
More information about the talk
mailing list