I am trying to search tweets using twitter4j by longitude and latitude as follows:
GeoLocation gl = new GeoLocation(39.8,-95.583068847656);
query.setGeoCode(gl, 2500, Unit.valueOf("km"));
This location is supposed to be San Francisco. However, twitter4j is returning no tweets when trying to search by location.
Related
I am writing a Foursquare API to find all the Bus Stops via category ID (52f2ab2ebcbc57f1066b8b4f) within a set radius from a set location in New York. I am using the following code:
CLIENT_ID = '123'
CLIENT_SECRET = '456'
latitude = location.latitude
longitude = location.longitude
intent = "checkin"
VERSION = '20180604'
radius = 5000
LIMIT = 10
category = "52f2ab2ebcbc57f1066b8b4f"
and these variables are passed to the URL as follows:
url = 'https://api.foursquare.com/v2/venues/search?client_id={}&client_secret={}&ll={},
{}&intent{}&v={}&radius={}&limit={}&category{}'.format(CLIENT_ID, CLIENT_SECRET,
latitude, longitude, intent, VERSION, radius, LIMIT, category)
which gives
https://api.foursquare.com/v2/venues/search&client_id=123&client_secret=456&ll=40.7149555,-74.0153365&intentcheckin&v=20180604&radius=5000&limit=10&category52f2ab2ebcbc57f1066b8b4f
However, this query returns locations which are not Bus Stops - but the category IDs that are being returned are also not to be found on the Foursquare Dev website, as follows:
In addition, whenever I change the ID to test the code, it brings back the same info. I cant get it to change. Something isnt updating somewhere and I keep restarting my notebook with no effect.
Do we know why my code isn't bringing back bus stop location?
Does it matter the order that I send in the URL? e.g. could I define intent after LL or Category after client ID?
Why am I getting the same return each time?
Thank you.
I have used a workaround to search under a query using the text from the category ID instead. Not perfect, but gets me to where I need to be.
I am trying to run some geo queries in arangodb and not getting results.
Here is what I have tried
Created index (in java)
final Collection<String> fields = new ArrayList<String>();
fields.add("latitude");
fields.add("longitude");
db.collection("foo").ensureGeoIndex(fields,null);
Verify index exist in the web interface
ID Type Unique Sparse Deduplicate Selectivity Est. Fields
13362 geo2 false true n/a n/a latitude, longitude
Example foo record from web interface
{"properties":{"latitude":37.78808138412046,"longitude":-122.080078125}}
From the QUERIES window in the web interface
FOR doc IN NEAR(##collection, #latitude, #longitude, #limit)
RETURN doc
binding
#collection foo
latitude 37.78808138412046
longitude -122.080078125
limit 50
Always returns an empty array even though I have loads of records with the exact location
Info:
using storage engine mmfiles
ArangoDB 3.2.8 [darwin] 64bit, using jemalloc, VPack 0.1.30, RocksDB 5.6.0, ICU 58.1, V8 5.7.492.77, OpenSSL 1.0.2k 26 Jan 2017
Just to complete the question, do not put the location fields in the nested properties of an object - this is what was my issue
My document is structured as the following -
{
"food_group":"Proteins",
"carbs":"6.295",
"protein":"13.729",
"fat":"2.551",
"calories":103.0
}
The aim is to fetch documents in an order determined by the boost of food_group which the user likes in the query as well as boost of proximity to calories preferred by user.
The boost based on food_group is acheived as follows-
(
food_group:"Proteins"^boost1 OR
food_group:"Dairy"^boost2 OR
food_group:"Grains"^boost3
)
However the moment i add abs(sub(preferred_calories,calories)) asc to factor in the proximity of calories to preferred_calories of user the boost based on food_group is lost
Try to use boost function
bf=div(1,abs(sub(100,calories)))
defType=edismax
q=(food_group:"Proteins"^100 OR food_group:"Dairy" OR food_group:"Grains")
Source : https://cwiki.apache.org/confluence/display/solr/The+DisMax+Query+Parser#TheDisMaxQueryParser-Thebf(BoostFunctions)Parameter
For the Universal Windows Platform (UWP) MapControl, I want to plot a street address. Unfortunately, as far as I know, the control only accepts Geopoint locations for Center.
Ex:
myMap.Center =
new Geopoint(new BasicGeoposition()
{
//Geopoint for Seattle
Latitude = 47.604,
Longitude = -122.329
});
How do I convert a street address to a Geopoint location and back again? Is there another way to plot street addresses?
Thanks for your help.
To convert a street address to a Geopoint location and back again, you can use the MapLocationFinder.FindLocationsAsync and MapLocationFinder.FindLocationsAtAsync method.
Convert addresses to geographic locations (geocoding) and convert geographic locations to addresses (reverse geocoding) by calling the methods of the MapLocationFinder class in the Windows.Services.Maps namespace.
For more info, see Perform geocoding and reverse geocoding.
I am using Gdirections google API. In that I am required to pass longitude and latitude in load method as parameters of source and destination. But when I pass longitude and latitude as parameters, it gives me a map with wrong directions. But when I pass source and destination address it gives me correct map.
How can I get a map with correct driving directions when lat and long is passed?
Here is one example of usage...
try below thing
gdir.loadFromWaypoints(["New Y...#40.714490,-74.007130", "NewJer...#40.072410,-74.728565"]);
Change New York and NewJer.. With the city or state you want..
Let me know it works for you or not.. Hope it helps..