Browse Source

Reorg headings in place, add TO DO comments

pull/6/head
rmglennon 9 years ago
parent
commit
b16c585052
  1. 4
      getting-started/003-reverse.md
  2. 35
      getting-started/004-place.md

4
getting-started/003-reverse.md

@ -12,15 +12,13 @@ With reverse geocoding with Mapzen Search, you can look up all sorts of informat
* postal areas
* countries
## Basic reverse geocoding search
To get started with reverse geocoding, you need a [free, developer API key](https://mapzen.com/developers) and a latitude,longitude pair in decimal degrees specified with the parameters `point.lat` and `point.lon`, respectively. For example, the Eiffel Tower in Paris, France, is located at `48.858268,2.294471`. The reverse geocode query for this would be:
>[/v1/reverse?api\_key={YOUR-KEY}&___point.lat=48.858268___&___point.lon=2.294471___](https://search.mapzen.com/v1/reverse?api_key={YOUR_API_KEY}&point.lat=48.858268&point.lon=2.294471)
Notice that the first result is the Eiffel Tower (well, Tour Eiffel). The output is the standard GeoJSON format.
## Additional parameters for reverse geocoding
reverse geocoding
Similar to other queries with Mapzen Search, reverse geocoding has optional, additional parameters you can use to refine results.

35
getting-started/004-place.md

@ -1,39 +1,38 @@
# Search for places
# Search an ID to get details on a place
Place search is for when you have an ID and the source it came from and now you just need the details.
When you know an identification number and the source it came from, you can use Mapzen Search to get details on the location.
Once you have [an API key](https://mapzen.com/developers), continue on.
To get started with a place search, you need a [free, developer API key](https://mapzen.com/developers) and these three pieces of information:
## The Basics
* source - the data source, such as OpenStreetMap
* layer - the type of place, such as a venue, address, country.
* id - the identification number of the item
A place search requires 3 pieces of information:
If you have all of those, join them together with semicolon and pass them in with the `ids` parameter.
1. source
2. layer
3. id
For example, this `/place` query looks up the Eiffel Tower in OSM:
Once you have all 3 of those, simply join them together with semicolon and pass in on the ids parameter.
http://pelias.bigdev.mapzen.com/v1/place?api_key=pelias-M7dcnto&ids=osm:venue:5013364
For example, this /place query looks up the Eiffel Tower in OSM:
***From Rhonda -- looks like this returns a radio station in Michigan? Also need to redo the query to include production server and the reader's API key***
http://pelias.bigdev.mapzen.com/v1/place?api_key=pelias-M7dcnto&ids=osm:venue:5013364
*** From Rhonda -- what are some examples of when you would use a /place search? When would you have this info and need to get the details? What would you do with it.***
## Advanced Usage
## Search for multiple places in a query
To request more than 1 /place lookup in one request, simply join multiple values together delimited by comma.
For example, this /place query looks up the Eiffel Tower in OSM and `30 West 26th St, New York, NY` in OpenAddresses:
To search for more than one `/place` in a request, join multiple values together and separate them with a comma. For example, this /place query looks up the Eiffel Tower in OSM and `30 West 26th St, New York, NY` in OpenAddresses:
http://pelias.bigdev.mapzen.com/v1/place?api_key=pelias-M7dcnto&ids=osm:country:5013364,oa:address:65cf57e4eb5548eca9bb548fb1461633
The results are returned in the order requested.
## Caveats
***From Rhonda -- is there another example where you might do multiple requests at the same time...in other words, more related locations?***
If you enter a `source:layer:id` combination that cannot be found then the `features` array in the response will continue a different number of elements than the number of requests. This will be most noticeable in multi-id requests since your request may have 3 ids requested but only 2 results returned. The reason for this is that the `features` section of the response is GeoJSON-compliant and there is currently no way to convey an exception condition (not even an empty JSON element, `{}`). For this reason, if your application is dependent upon the results mapping directly to the individual input requests in order, then you'll have to do your own bookkeeping to handle with exception conditions.
Keep in mind that if you enter a `source:layer:id` combination that cannot be found, then the `features` array in the response contains a different number of elements than the number of requests. This will be most noticeable in requests with multiple IDs, as your request may have three IDs requested but only two results returned. The reason for this is that the `features` section of the response is GeoJSON-compliant and there is currently no way to convey an exception condition (not even an empty JSON element, `{}`). For this reason, if your application is dependent upon the results mapping directly to the individual input requests in order, then you'll have to do your own bookkeeping to handle with exception conditions.
## Valid combinations
## Valid combinations of place searches
Some combinations of `sources` and `layers` are valid while others aren't. Please use the following table for reference:
Some combinations of `sources` and `layers` are valid while others are not. This table shows valid combinations.
source | layers
--- | ---

Loading…
Cancel
Save