FAQ Database Discussion Community

Retrieve all latitude longitude points within x distance given an area

Given an area defined by x amount of points, I'd like to split that area in to 3 mile blocks and retrieve the center latitude longitude from each block. Here's what I mean: Area covering London: Area split in to 3 mile blocks (not perfect): And then print out the...

k-means core function for temporal geo data

I want cluster geo data (lat,long,timestamp) with k-means. I'm searching for a good core function, I can't find good paper or other sources for that. To time I multiplicate the time and the space distance: public static double dis(GeoData input1, GeoData input2) { double timeDis = Math.abs( input1.getTime() - input2.getTime()...

Using ng-href with geo: Uri in Cordova does not work

I am trying to use the geo: uri in Cordova. It works when I do something like: <a href="geo:0,0q=12345+jefferson+st">link1</a> but if I do something like with angular: <a ng-href="{{location}}">{{location}}>link2</a> and location = "geo:0,0q=12345+jefferson+st"; it will not work. Any ideas? ...

Polygon search in django haystack

Documentation says, that polygon search is possible with elastic http://django-haystack.readthedocs.org/en/latest/spatial.html However, I can't find any code samples with polygon search implementation. Do you have some?...

Geo plugin API is not working on a domain sometimes

I've used geo plugin(http://www.geoplugin.com/) api to get currency of the country using user's ip address. It seems to be working on last week. But sometimes it gives wrong response(ie it is not working for our domain).Is the server blocking our domain? Can anyone help on this?

Cloudant / Bluemix geo search

I'm trying to query a cloudant database using the nano library from a Bluemix runtime. The goal is to bring back the closest 200 geopoints to a given location. I have a cloudant database set up with dummy data and a search index function with the relevant fields: function(doc){ index("status",...

How can I get the State (city and address not needed) for a given zipcode?

I don't want an API call out if possible. I have a user-input zipcode, and I want to display a paragraph of text depending on the state that that zipcode is in. I know it's much more complicated to lookup City AND State, and for that the USPS web API...

How do I check if a point is behind another point relative to its location and course?

I am working on an app which highly depends on geolocation and calculations based upon it. One of the views is a list view which gives a list of moving POI's behind the users location. +---------------------------+ +------ . ------+ +----- . -----+ +---- . [POI1] ----+ +--- . / ---+...

K-Means Clustering a list of US addresses based on drive time

I have 8 traveling consultants that need to visit 155 groups across the continental united states. Is there a way to find the optimal 8 regions based of drive time using k-means clustering? I see there are some methods implemented already for other data sets, but they are not based...

Geo SQL to find points near location

I using the below sql: based on http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL SELECT * , 3956 *2 * ASIN( SQRT( POWER( SIN( ( - 36.8812573 - abs( stop_lat ) ) * pi( ) /180 /2 ) , 2 ) + COS( - 36.8812573 * pi( ) /180 ) * COS( abs( stop_lat ) *...

PHP DataStore geo query

I'm using the PHP-GDS library to get access to the AppEngine DataStore, however this doesn't seem to support geolocation queries. I'm currently storing the latitude and longitude in separate columns. What's the recommended way in 2015 (there are lots of suggestions from 2010) to query the DataStore with geoqueries? Example...

unexpected “,” but can't find it for the life of me

I'm running a script to redirect users based on country code, and right now the response I get is Parse error: syntax error, unexpected ',' in /home2/mcp/public_html/redirect/index.php on line 15 This is line 15: $country_codes = 'US', 'CA', 'UK', 'AU', 'NZ', 'ZA', 'NL'; Used here: if (in_array($var_country_code, array($country_codes))) { When...

QGIS Copy paste points from one layer to another

Well I have an outline layer and a region layer. The region for sure sure using the outline, so it would be great if I could select some important point from the outline layer and than copy paste it to the region layer. How is that possible?...