Browse Source

replace all in search.md, some formatting changes for consistency with unordered lists

pull/124/head
rmglennon 9 years ago committed by Julian Simioni
parent
commit
46e928d565
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 47
      search.md

47
search.md

@ -23,7 +23,7 @@ In the simplest search, you can provide only one parameter, the text you want to
For example, if you want to find a [YMCA](https://en.wikipedia.org/wiki/YMCA) facility, here's what you'd need to append to the base URL of the service, `search.mapzen.com`.
> [/v1/search?api_key=search-XXXXXXX&___text=YMCA___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA)
> [/v1/search?api_key=search-hnopfLZ&___text=YMCA___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA)
Note the parameter values are set as follows:
@ -38,7 +38,7 @@ If you are having trouble seeing the JSON in your browser, you can install a bro
In the example above, you will find the name of each matched locations in a property named `'label'`. The top 10 labels returned were:
> * YMCA, Bargoed Community, United Kingdom
* YMCA, Bargoed Community, United Kingdom
* YMCA, Nunspeet, Gelderland
* YMCA, Belleville, IL
* YMCA, Forest City, IA
@ -51,7 +51,7 @@ In the example above, you will find the name of each matched locations in a prop
Spelling matters, but not capitalization when performing a query with Mapzen Search. You can type `ymca`, `YMCA`, or even `yMcA`. See for yourself by comparing the results of the earlier search to the following:
> [/v1/search?api_key=search-XXXXXXX&___text=yMcA___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=yMcA)
> [/v1/search?api_key=search-hnopfLZ&___text=yMcA___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=yMcA)
Note that the results are spread out throughout the world because you have not given your current location or provided any other geographic context in which to search.
@ -65,12 +65,11 @@ By default, Mapzen Search results 10 places, unless otherwise specified. If you
| `text` | YMCA |
| `size` | 1 |
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___size=1___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&size=1)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___size=1___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&size=1)
If you want 25 results, you can build the query where `size` is 25.
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___size=25___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&size=25)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___size=25___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&size=25)
## Narrow your search
@ -84,7 +83,7 @@ Sometimes your work might require that all the search results be from a particul
Now, you want to search for YMCA again, but this time only in Great Britain. To do this, you will need to know that the alpha-3 code for Great Britain is GBR and set the parameters like this:
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___boundary.country=GBR___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&boundary.country=GBR)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___boundary.country=GBR___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&boundary.country=GBR)
| parameter | value |
| :--- | :--- |
@ -94,7 +93,7 @@ Now, you want to search for YMCA again, but this time only in Great Britain. To
Note that all the results are within Great Britain:
> * YMCA, Bargoed Community, United Kingdom
* YMCA, Bargoed Community, United Kingdom
* YMCA, Orpington, Greater London
* YMCA, Erdington, West Midlands
* YMCA, Malvern CP, United Kingdom
@ -107,11 +106,11 @@ Note that all the results are within Great Britain:
If you try the same search request with different country codes, the results change to show YMCA locations within this region.
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___boundary.country=USA___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&boundary.country=USA)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___boundary.country=USA___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&boundary.country=USA)
Results in the United States:
> * YMCA, Belleville, IL
* YMCA, Belleville, IL
* YMCA, Forest City, IA
* YMCA, Fargo, ND
* YMCA, Frisco, TX
@ -130,9 +129,9 @@ To specify the boundary using a rectangle, you need latitude, longitude coordina
For example, to find a YMCA within the state of Texas, you can set the `boundary.rect.*` parameter to values representing the bounding box around Texas: min_lon=-106.65 min_lat=25.84 max_lon=-93.51 max_lat=36.5
Tip: You can look up a bounding box for a known region with this [web tool](http://boundingbox.klokantech.com/).
Tip: You can look up a bounding box for a known region with this [web tool](http://boundingbox.klokantech.com/).
[/v1/search?api_key=search-XXXXXXX&text=YMCA&___boundary.rect.min_lat=25.84&boundary.rect.min_lon=-106.65&boundary.rect.max_lat=36.5&boundary.rect.max_lon=-93.51___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&boundary.rect.min_lat=25.84&boundary.rect.min_lon=-106.65&boundary.rect.max_lat=36.5&boundary.rect.max_lon=-93.51)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___boundary.rect.min_lat=25.84&boundary.rect.min_lon=-106.65&boundary.rect.max_lat=36.5&boundary.rect.max_lon=-93.51___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&boundary.rect.min_lat=25.84&boundary.rect.min_lon=-106.65&boundary.rect.max_lat=36.5&boundary.rect.max_lon=-93.51)
| parameter | value |
| :--- | :--- |
@ -143,7 +142,7 @@ For example, to find a YMCA within the state of Texas, you can set the `boundary
| `boundary.rect.max_lat` | 36.5 |
| `boundary.rect.max_lon` | -93.51 |
> * YMCA, Austin, TX
* YMCA, Austin, TX
* YMCA, Frisco, TX
* Y.M.C.A, Fort Worth, TX
* YMCA, Rockwall, TX
@ -162,7 +161,7 @@ Sometimes you don't have a rectangle to work with, but rather you have a point o
In this example, you want to find all YMCA locations within a 35-kilometer radius of a location in Ontario, Canada. This time, you can use the `boundary.circle.*` parameter group, where `boundary.circle.lat` and `boundary.circle.lon` is your location in Ontario and `boundary.circle.radius` is the acceptable distance from that location. Note that the `boundary.circle.radius` parameter is always specified in kilometers.
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&__boundary.circle.lon=-79.186484&boundary.circle.lat=43.818156&boundary.circle.radius=35__](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&boundary.circle.lon=-79.186484&boundary.circle.lat=43.818156&boundary.circle.radius=35)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&__boundary.circle.lon=-79.186484&boundary.circle.lat=43.818156&boundary.circle.radius=35__](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&boundary.circle.lon=-79.186484&boundary.circle.lat=43.818156&boundary.circle.radius=35)
| parameter | value |
| :--- | :--- |
@ -174,7 +173,7 @@ In this example, you want to find all YMCA locations within a 35-kilometer radiu
You can see the results have fewer than the standard 10 items because there are not that many YMCA locations in the specified radius:
> * YMCA, Toronto, Ontario
* YMCA, Toronto, Ontario
* YMCA, Markham, Ontario
* YMCA, Toronto, Ontario
* Metro Central YMCA, Toronto, Ontario
@ -198,7 +197,7 @@ By specifying a `focus.point`, nearby places will be scored higher depending on
To find YMCA again, but this time near a specific coordinate location (representing the Sydney Opera House) in Sydney, Australia, use `focus.point`.
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___focus.point.lat=-33.856680&focus.point.lon=151.215281___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___focus.point.lat=-33.856680&focus.point.lon=151.215281___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281)
| parameter | value |
| :--- | :--- |
@ -209,7 +208,7 @@ To find YMCA again, but this time near a specific coordinate location (represent
Looking at the results, you can see that the few locations closer to this location show up at the top of the list, sorted by distance. You also still get back a significant amount of remote locations, for a well balanced mix. Because you provided a focus point, Mapzen Search can compute distance from that point for each resulting feature.
> * YMCA, Redfern, New South Wales [distance: 3.836]
* YMCA, Redfern, New South Wales [distance: 3.836]
* YMCA, St Ives (NSW), New South Wales [distance: 14.844]
* YMCA, Epping (NSW), New South Wales [distance: 16.583]
* YMCA, Revesby, New South Wales [distance: 21.335]
@ -227,7 +226,7 @@ Now that you have seen how to use boundary and focus to narrow and sort your res
Going back to the YMCA search you conducted with a focus around a point in Sydney, the results came back from distant parts of the world, as expected. But say you wanted to only see results from the country in which your focus point lies. You can combine that same focus point in Sydney with the country boundary of Australia like this.
> [/v1/search?api_key={YOUR-KEY}&text=YMCA&___focus.point.lat=-33.856680&focus.point.lon=151.215281___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281)
> [/v1/search?api_key={YOUR-KEY}&text=YMCA&___focus.point.lat=-33.856680&focus.point.lon=151.215281___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281)
| parameter | value |
| :--- | :--- |
@ -239,7 +238,7 @@ Going back to the YMCA search you conducted with a focus around a point in Sydne
The results below look different from the ones you saw before with only a focus point specified. These results are all from within Australia. You'll note the closest results show up at the top of the list, which is helped by the focus parameter.
> * YMCA, Redfern, New South Wales [distance: 3.836]
* YMCA, Redfern, New South Wales [distance: 3.836]
* YMCA, St Ives (NSW), New South Wales [distance: 14.844]
* YMCA, Epping (NSW), New South Wales [distance: 16.583]
* YMCA, Revesby, New South Wales [distance: 21.335]
@ -254,7 +253,7 @@ The results below look different from the ones you saw before with only a focus
If you are looking for the nearest YMCA locations, and are willing to travel no farther than 50 kilometers from your current location, you likely would want the results to be sorted by distance from current location to make your selection process easier. You can get this behavior by using `focus.point` in combination with `boundary.circle.*`. You can use the `focus.point.*` values as the `boundary.circle.lat` and `boundary.circle.lon`, and add the required `boundary.circle.radius` value in kilometers.
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281&___boundary.circle.lat=-33.856680&boundary.circle.lon=151.215281&boundary.circle.radius=50___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281&boundary.circle.lat=-33.856680&boundary.circle.lon=151.215281&boundary.circle.radius=50)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281&___boundary.circle.lat=-33.856680&boundary.circle.lon=151.215281&boundary.circle.radius=50___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&focus.point.lat=-33.856680&focus.point.lon=151.215281&boundary.circle.lat=-33.856680&boundary.circle.lon=151.215281&boundary.circle.radius=50)
| parameter | value |
| :--- | :--- |
@ -268,7 +267,7 @@ If you are looking for the nearest YMCA locations, and are willing to travel no
Looking at these results, they are all less than 50 kilometers away from the focus point:
> * YMCA, Redfern, New South Wales [distance: 3.836]
* YMCA, Redfern, New South Wales [distance: 3.836]
* YMCA, St Ives (NSW), New South Wales [distance: 14.844]
* YMCA, Epping (NSW), New South Wales [distance: 16.583]
* YMCA, Revesby, New South Wales [distance: 21.335]
@ -296,7 +295,7 @@ The search examples so far have returned a mix of results from all the data sour
If you use the `sources` parameter, you can choose which of these data sources to include in your search. So if you're only interested in finding a YMCA in data from OpenAddresses, for example, you can build a query specifying that data source.
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___sources=oa___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&sources=oa)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___sources=oa___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&sources=oa)
| parameter | value |
| :--- | :--- |
@ -319,7 +318,7 @@ Because OpenAddresses is, as the name suggests, only address data, here's what y
If you wanted to combine several data sources together, set `sources` to a comma separated list of desired source names. Note that the order of the comma separated values does not impact sorting order of the results; they are still sorted based on the linguistic match quality to `text` and distance from `focus`, if you specified one.
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___sources=osm,gn___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&sources=oa)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___sources=osm,gn___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&sources=oa)
| parameter | value |
| :--- | :--- |
@ -344,7 +343,7 @@ In Mapzen Search, place types are referred to as `layers`, ranging from fine to
|`neighbourhood`|social communities, neighbourhoods|
|`coarse`|alias for simultaneously using `country`, `region`, `county`, `locality`, `localadmin`, and `neighbourhood`|
> [/v1/search?api_key=search-XXXXXXX&text=YMCA&___layers=venue,address___](https://search.mapzen.com/v1/search?api_key=search-XXXXXXX&text=YMCA&layers=venue,address)
> [/v1/search?api_key=search-hnopfLZ&text=YMCA&___layers=venue,address___](https://search.mapzen.com/v1/search?api_key=search-hnopfLZ&text=YMCA&layers=venue,address)
| parameter | value |
| :--- | :--- |

Loading…
Cancel
Save