You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Geocoder.search("8626 brookshire ln apt b, st louis MO 63132")
[#<Geocoder::Result::Mapbox:0x00007f08c20ffdd0@cache_hit=nil,@data={"id"=>"place.315328748","type"=>"Feature","place_type"=>["place"],"relevance"=>0.518519,"properties"=>{"mapbox_id"=>"dXJuOm1ieHBsYzpFc3VJN0E","wikidata"=>"Q38022"},"text"=>"St. Louis","place_name"=>"St. Louis, Missouri, United States","bbox"=>[-90.512654,38.388298, -90.11773,38.832002],"center"=>[-90.19835,38.627464],"geometry"=>{"type"=>"Point","coordinates"=>[-90.19835,38.627464]},"context"=>[{"id"=>"district.22087404","mapbox_id"=>"dXJuOm1ieHBsYzpBVkVHN0E","wikidata"=>"Q38022","text"=>"St. Louis city"},{"id"=>"region.271596","mapbox_id"=>"dXJuOm1ieHBsYzpCQ1Rz","wikidata"=>"Q1581","short_code"=>"US-MO","text"=>"Missouri"},{"id"=>"country.8940","mapbox_id"=>"dXJuOm1ieHBsYzpJdXc","wikidata"=>"Q30","short_code"=>"us","text"=>"United States"}]}>,#<Geocoder::Result::Mapbox:0x00007f08c20ffad8@cache_hit=nil,@data={"id"=>"district.22087404","type"=>"Feature","place_type"=>["district"],"relevance"=>0.518519,"properties"=>{"mapbox_id"=>"dXJuOm1ieHBsYzpBVkVHN0E","wikidata"=>"Q38022"},"text"=>"St. Louis city","place_name"=>"St. Louis city, Missouri, United States","matching_text"=>"St. Louis","matching_place_name"=>"St. Louis, Missouri, United States","bbox"=>[-90.320515,38.531852, -90.166574,38.774431],"center"=>[-90.19835,38.627464],"geometry"=>{"type"=>"Point","coordinates"=>[-90.19835,38.627464]},"context"=>[{"id"=>"region.271596","mapbox_id"=>"dXJuOm1ieHBsYzpCQ1Rz","wikidata"=>"Q1581","short_code"=>"US-MO","text"=>"Missouri"},{"id"=>"country.8940","mapbox_id"=>"dXJuOm1ieHBsYzpJdXc","wikidata"=>"Q30","short_code"=>"us","text"=>"United States"}]}>,#<Geocoder::Result::Mapbox:0x00007f08c20ff7e0@cache_hit=nil,@data={"id"=>"postcode.218910444","type"=>"Feature","place_type"=>["postcode"],"relevance"=>0.49537,"properties"=>{"mapbox_id"=>"dXJuOm1ieHBsYzpEUXhPN0E"},"text"=>"63132","place_name"=>"University City, Missouri 63132, United States","bbox"=>[-90.408972,38.66082, -90.347838,38.696322],"center"=>[-90.356661,38.674083],"geometry"=>{"type"=>"Point","coordinates"=>[-90.356661,38.674083]},"context"=>[{"id"=>"place.334981356","mapbox_id"=>"dXJuOm1ieHBsYzpFL2RvN0E","wikidata"=>"Q959885","text"=>"University City"},{"id"=>"district.22095596","mapbox_id"=>"dXJuOm1ieHBsYzpBVkVtN0E","wikidata"=>"Q498034","text"=>"St. Louis County"},{"id"=>"region.271596","mapbox_id"=>"dXJuOm1ieHBsYzpCQ1Rz","wikidata"=>"Q1581","short_code"=>"US-MO","text"=>"Missouri"},{"id"=>"country.8940","mapbox_id"=>"dXJuOm1ieHBsYzpJdXc","wikidata"=>"Q30","short_code"=>"us","text"=>"United States"}]}>,#<Geocoder::Result::Mapbox:0x00007f08c20ff4e8@cache_hit=nil,@data={"id"=>"place.177334508","type"=>"Feature","place_type"=>["place"],"relevance"=>0.461728,"properties"=>{"mapbox_id"=>"dXJuOm1ieHBsYzpDcEhvN0E","wikidata"=>"Q959786"},"text"=>"Lake Saint Louis","place_name"=>"Lake Saint Louis, Missouri, United States","bbox"=>[-90.843074,38.741282, -90.746163,38.80537],"center"=>[-90.793076,38.784515],"geometry"=>{"type"=>"Point","coordinates"=>[-90.793076,38.784515]},"context"=>[{"id"=>"district.21808876","mapbox_id"=>"dXJuOm1ieHBsYzpBVXpHN0E","wikidata"=>"Q489873","text"=>"St. Charles County"},{"id"=>"region.271596","mapbox_id"=>"dXJuOm1ieHBsYzpCQ1Rz","wikidata"=>"Q1581","short_code"=>"US-MO","text"=>"Missouri"},{"id"=>"country.8940","mapbox_id"=>"dXJuOm1ieHBsYzpJdXc","wikidata"=>"Q30","short_code"=>"us","text"=>"United States"}]}>,#<Geocoder::Result::Mapbox:0x00007f08c20ff1f0@cache_hit=nil,@data={"id"=>"district.22095596","type"=>"Feature","place_type"=>["district"],"relevance"=>0.461728,"properties"=>{"mapbox_id"=>"dXJuOm1ieHBsYzpBVkVtN0E","wikidata"=>"Q498034"},"text"=>"St. Louis County","place_name"=>"St. Louis County, Missouri, United States","bbox"=>[-90.73653,38.388298, -90.11773,38.891184],"center"=>[-90.338277,38.650259],"geometry"=>{"type"=>"Point","coordinates"=>[-90.338277,38.650259]},"context"=>[{"id"=>"region.271596","mapbox_id"=>"dXJuOm1ieHBsYzpCQ1Rz","wikidata"=>"Q1581","short_code"=>"US-MO","text"=>"Missouri"},{"id"=>"country.8940","mapbox_id"=>"dXJuOm1ieHBsYzpJdXc","wikidata"=>"Q30","short_code"=>"us","text"=>"United States"}]}>]
the first location in the mapbox's result which has a relevance of 0.881173 and is the result we were expecting is missing from the geocoder's resultset.
I forked geocoder's repository to see what is going on and looks like the request geocoder is sending mapbox is slightly different to the one i made.
GET https://api.mapbox.com/geocoding/v5/mapbox.places/8626+brookshire+ln+apt+b%2C+st+louis+MO+63132.json?access_token=pk.eyJ1IjoiZWNkZXZ0ZWFtIiwiYSI6ImNsc2NjYWszMzBvcGcyanFsdTM2YWp0dGgifQ.OdY7n16ZynJcs0MeLvQYhA
spaces were encoded as + by geocoder instead of %20 and thats why the results are different
The text was updated successfully, but these errors were encountered:
Hello,
We are getting unexpected results using mapbox when the search query has spaces in it.
For example when the search query is
8626 brookshire ln apt b, st louis MO 63132
Using mapbox's api directly
returns
and using Geocoder
the first location in the mapbox's result which has a relevance of
0.881173
and is the result we were expecting is missing from the geocoder's resultset.I forked geocoder's repository to see what is going on and looks like the request geocoder is sending mapbox is slightly different to the one i made.
spaces were encoded as
+
by geocoder instead of%20
and thats why the results are differentThe text was updated successfully, but these errors were encountered: