×

Discussion Board

Results 1 to 8 of 8

Hybrid View

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    12

    Searches are not restricted to an area

    I have tried both using the at parameter and also using a X-Map-Viewport header, but when I search it does not restrict the places search to the area I specify.

    For example, use the link http://demo.places.nlp.nokia.com/pla...CG24t50dHOwrLQ

    This is a search near me for the word "Tokyo". There is a place called "Tokyo Cafe" I'd expect to see. When I get my results back, I get a place for the City of Tokyo in Japan!

    Confused.

  2. #2
    Regular Contributor
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    289

    Re: Searches are not restricted to an area

    The reason behind this has been discussed here:
    http://www.developer.nokia.com/Commu...l=1#post890259

    However, please be aware, that we take this as an indicator of what part of the map the user of your application is looking at. We might serve places that are outside this region in the case that there are some good results just outside of it.
    Thus, exact region search is not fully supported yet
    I guess that the search algorithm believes that Tokyo the city is an exact match to your query and therefore too good a match not to return in the results, even though it is far outside the area of search.

    It would make sense is all results outside of region could be excluded some how, but at the moment I could give two suggestions:


    1) Make the search more specific by altering the query e.g. search for Tokyo restaurant rather than Tokyo:
    http://demo.places.nlp.nokia.com/pla...CG24t50dHOwrLQ

    2) Look at the distance attribute within the returned JSON feed and ignore results over a set value.

    Code:
    ...
    results:{
           items:[
                  {position:[35.68321,139.80894]
                  distance:8871883
                   title:Tokyo
                   average Rating:0.0
    ...

  3. #3
    Nokia Developer Expert
    Join Date
    Apr 2012
    Location
    Berlin, Germany
    Posts
    42

    Re: Searches are not restricted to an area

    Hi,

    Yes, Tokyo as in Tokyo/Japan will be returned as the first search result when you search for Tokyo. However, in your example, Tokyo Cafe is still in the results, it’s the second item.

    Unfortunately, we are not providing radius search yet.\

    daniel.
    Daniel Moor
    Nokia Places API

  4. #4
    Registered User
    Join Date
    Apr 2012
    Posts
    12

    Re: Searches are not restricted to an area

    Thanks. My approach will be to either look at the distance value or write function to assess whether the point is within the bounds of the map and only show things that are (or close to it). My Tokyo example was a bit drastic, but I just wanted to show how a search in Southern California was showing things in Japan.

    It's a bit confusing as a developer/user. If the API is only pulling back a set number of items, how can I trust that it's pulling the local stuff first? Are the Places on the other side of the world that fall under the "too good a match" bucket pushing good local items out of the results? My Tokyo example may not be the best one, but I hope you understand what I mean in general. If I am sending a Viewport Box or an [at], it really doesn't make sense to include something so far away no matter how good the match is. If I wanted to get good worldwide matches I should change the search to not restrict to an area, right?

    I was also hoping I could rid the results of some things based upon categories, but the categories are inconsistent. Even the top level ones mentioned do not seem to be a complete list. For example, Tokyo has "city-town-village" as its category and that doesn't map to anything in the available list of categories. Maybe that's best left to another thread, but it was another area of confusion. I am sure categories are really difficult to manage on the back-end, but at least having a mapping to a top-level in all cases would be pretty important.

    All in all, I do really like the API. I hope you take this as constructive criticism.

  5. #5
    Nokia Developer Expert
    Join Date
    Apr 2012
    Location
    Berlin, Germany
    Posts
    42

    Re: Searches are not restricted to an area

    Hi,

    thanks for your feedback! It is highly appreciated and we shipped a beta to get exactly the feedback you give to us.

    The search as it is working currently tries to make most sense of the users input with applying additional hints. Thus, X-Map-Viewport is not requesting places in this viewport only. It just gives us the hint that the user is currently looking at a map with the given viewport.

    Example: If the viewport shows the city of Berlin and the user request is "Bar Paris", we will return a place called "Paris Bar" in Berlin and bars in Paris.

    I know that this is not the use case you are after. We are evaluating that one but can not give any estimates at the moment.

    Regarding categories: "city-town-village" maps to the top-level category "administrative-areas-buildings". I understand that you need a programatic mapping to top-level categories. Could you describe that part of your use case more for us to understand your needs better?

    Thanks,
    daniel.
    Daniel Moor
    Nokia Places API

  6. #6
    Registered User
    Join Date
    Apr 2012
    Posts
    12

    Re: Searches are not restricted to an area

    I understand how you are using location as a hint to the search, but I really think you should have an option to restrict results to an area. Or perhaps use the location hints in a stronger way than they are today. As a developer, I shouldn't need to parse things out of a result set that obviously do not apply to my use case. If we can tell you to restrict the results, I think the API should.

    As far as the way it exists today, if you ALWAYS prioritize results near the hinted-at location, that would be best. I would hate to do a local search and have the city of Tokyo (halfway around the world) bump out a local result from the top 5 or top 10 results. If I cannot trust that the local results are prioritized, it makes me not want to use the API because the results are too inconsistent and open to interpretation.

    As far as the categories go, my use case is mostly around a productivity app where I am helping users map their own personal contacts database to plan business trips. I want to be able to reach out to Places and offer them the ability to add things like Hotels, Restaurants, etc. to their search. While a city/town is a "place", it's not the kind of place I need to show them. They have geocoding for that. I am more interested in businesses, landmarks, airports and such. I didn't think towns would even appear in the results so now I'd like to remove them. I am not sure what other info might show up that I want to remove, but I think categories will be the easiest way to handle that.

  7. #7
    Nokia Developer Expert
    Join Date
    Apr 2012
    Location
    Berlin, Germany
    Posts
    42

    Re: Searches are not restricted to an area

    Hi,

    Thanks for your feedback.

    I know that we don’t have true local search yet and that filtering distant results doesn’t help a lot, especially since you then don’t know how many results will be left after filtering.

    Regarding categories: did you try the /explore endpoint? This won’t return you cities. If you need the /search endpoint, you could filter out the category administrative-areas-buildings.

    Best,
    daniel.
    Daniel Moor
    Nokia Places API

  8. #8
    Registered User
    Join Date
    Apr 2012
    Posts
    12

    Re: Searches are not restricted to an area

    After trying it out more and more, I see how it works and is pretty smart. I decided to use the [at] and X-Map-Viewport options. When I get results back, I run them through this JS method. to compare the lat/lon of the Place with the bounds of my map. If it returns TRUE, I include it on the map as a result.

    Code:
    // Using a MapQuest map, so that's why the bounds object is different than a Nokia object.
    function gp_latLngInBounds(lat,lng,bounds){
    	
    	var minLat = bounds.lr.lat;
    	var maxLat = bounds.ul.lat;
    	var minLng = bounds.ul.lng;
    	var maxLng = bounds.lr.lng;
    	
    	if(lat < minLat) { return false; }
    	if(lat > maxLat) { return false; }
    	
    	if (minLng <= maxLng){
    		if(lng < minLng) { return false; }
    		if(lng > maxLng) { return false; }
    	} else {
    		if (lng > maxLng && lng < minLng) { return false; }
    	}
    	
    	
    	return true;
    }

Similar Threads

  1. How to create text area field or grawing text area
    By rohit.shah in forum Symbian User Interface
    Replies: 3
    Last Post: 2010-10-02, 11:16
  2. Replies: 3
    Last Post: 2009-03-19, 11:46
  3. Maxartists searches for IT professionals
    By maxartists in forum News and Announcements
    Replies: 0
    Last Post: 2007-11-02, 14:17
  4. Bluetooth: constantly searches devices
    By antonio5982 in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2007-06-11, 15:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×