Can't seem to get "other" nearby places to show up
  • In a test script, using the php sdk, I'm creating a layer, adding 2 places which are about 5 blocks from one another, then running places/nearby on the location of one of those 2 places.  The response only seems to contain the record at the location I specified in the nearby query, but not the other, no matter how high I set the distance.

    Here are the requests - via your app debugger page - all with a Response Code of 200:

    layer/create: {"name":"users","description":"Users","public":0}

    Response: {"layer_id":"E5k"}

    place/create: {"latitude":40.7024,"longitude":-73.9419,"layer_id":"E5k","name":"test-1","extra":{"user_id":1}}

    Response: {"place_id":"1zCB","name":"test-1","latitude":40.7024,"longitude":-73.9419,"radius":0,"display_name":"test-1","time_from":"00:00:00","time_to":"00:00:00","active":1,"extra":{"user_id":1},"description":""}

    place/create: {"latitude":40.6995,"longitude":-73.9395,"layer_id":"E5k","name":"test-2","extra":{"user_id":2}}

    Response: {"place_id":"1zCC","name":"test-2","latitude":40.6995,"longitude":-73.9395,"radius":0,"display_name":"test-2","time_from":"00:00:00","time_to":"00:00:00","active":1,"extra":{"user_id":2},"description":""}

    place/nearby: {"latitude":40.6995,"longitude":-73.9395,"layer_id":"E5k","distance":100}

    Response: {"nearby":[{"place_id":"1zCC","name":"test-2","latitude":40.6995,"longitude":-73.9395,"radius":0,"display_name":"test-2","time_from":"00:00:00","time_to":"00:00:00","active":1,"extra":{"user_id":2},"description":""}],"paging":{"limit":25,"total":1}}

    After creating the layers, I ran a layer/list to make sure the layer showed up.  After creating the places, I ran a place/list to make sure they showed up properly with all the correct data as well.

    Here is where the two test locations are on a map:
  • 2 Comments sorted by
  • Thanks for the detailed examples. I ran through your input data on my end. It looks like I can retrieve both places using place/nearby when the radius is 390. It looks like the two points are 381m apart from each other.
  • Weird.  That's spot on.  I just ran my script again with the distance as 390 and then again with distance 1000 (which was my original distance before this test) and it worked perfectly.  I know my sample above shows as 100.  I should have shown the results when I ran it at 1000 (which were the same).

    Regardless, it's working, I'm happy.  Thanks so much for your time.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion