distance

Comparing string distance based on precomputed hashes

I have a large list (over 200,000) of strings that I'd like to compare to a given string. The given string is inserted by a user, so it may be slightly incorrect. What I was hoping to do was create some kind of precomputed hash on each string on adding it to the list. This hash would contain information such as string length, addition...

how can i access "Thing" class ???

In an ontology? i have an ontology that it doesnt have only one root class.it has 4 seperated classes(4 sub graph) ---1---- with listclasses() method i can't access 3 of them. this method lists one root class and its subclasses! i want to get all classes of ontology.then i want to get "Thing" class to access all of classes!!! is this ...

Zipcodes & Distance

Hi, I have a list of zipcoded in a MySQL Database together with their Latitude & Longitude data (Column names: ZipCode, Lat, Lon). Now I have to make a search requests (search for the zipcode) to extract information from a website. When I make this search requests the results include all information within a radius of 50km of the zipco...

Distance calculation between two zip codes(post codes) in php?

I am working on a website which requires distance calculation between two zip-codes. I have a database table which consists of zip-codes and their related latitudes and longitudes. I make use of this to calculate distance between the two places. But I have a problem that this gives me straight line distance and not driving distance - h...

Determine distance from coastline in Matlab

In MATLAB, I have an array of latitude and longitude pairs that represents locations in the United States. I need to determine the distance to the nearest coastline. I think MATLAB has a built in database of lat/lon points of the United States. How do I access it and use it? Also any suggestions on how to efficiently determine the di...

Returning distance and Searching by radius in Solr 1.5

Does anyone know of a means of returning the distance in the result set using Solr 1.5? An example of the function we're using is: dist(2, store, vector(43.517030,-96.789603)) where "store" is a LatLon field containing both latitude and longitude of each item in the index. Can you give an example URL that would return a distance field ...

Google maps - Near positions

On my website members are tagging photo position on Google maps API. Longitude and latitude are saved in database (SQL). Does anyone know how to find tagged photos that are in radius 100km of tagged photo? Let say that latitude and longitude are 46.03765154061627 | 14.5404052734375. Is there any kind of math formula that would check 1...

Shortest distance between point and path

Hi, for a geo-based online game I'm looking for an algorithm which finds the shortest distance between a specified point and a known path connected by x/y-coordinates, so that I can kill all redundant points/nodes. A link or keyword for this algorithm would help me a lot! thanks for reading For better understanding: ...

Efficient way of finding all items within a given distance of a point.

Possible Duplicates: which data structure is appropriate to query all points within distance d from point p Storing objects for locating by x,y coordinates I have a list of items, each with a location in 2D space (specified using euclidean geometry, i.e. as an (x, y) coordinate pair). How should I store this list (e.g. hash...

MySQL User Defined Function for Latitude Longitude Syntax

I have created a MySQL function to determine if a set of latitude and longitude coordinates are within a certain range of another set of latitude and longitude coordinates. However, the function is giving me a syntax error so I cannot test to see if it is working properly. Any help figuring out what is causing the error would be greatly ...

Postcode distance calculation

Hey, I have just been developing a postcode distance calculator for my Dads company, where all our customers are kept on file and every time a new potential customer makes an enquiry the system will check against all other customers' postcodes. The problem is that it doesn't yet do the distance calculation. Typing in a DT1 postcode with...

Finding points on a bezier curve based on distance from another point.

So I have a 3D cubic bezier curve and a start point found anywhere along the curve and need to find a second point further down the curve that is a specific worldspace distance (not arclength distance) away from the first point. Another issue would be if the second point reached the end of the curve and still wasn't at the desired world...

Distance between 2 MKAnnotations ?

I am nearly sure, that i have seen a method (provided by the Apple-SDK) a time ago, that could find the distance between 2 MKAnnotations. That time i havent seen a use in the funktion. But, how it goes, now i would like to have this function but i can´t find it anymore. Can anyone please help me ? Maybe i have just something wrong in my...

What is the fastest algorithm to calculate the minimum distance between two sets of points?

I wanna find the minimum distance between two polygon. I mean, I have to find the minimum of shortest distance between each vertex of first shape with the all the vertexes of the other one. Something like Hausdorff Distance but I need minimum instead of maximum. I appreciate any suggestion. Thank you. ...

Getting MULTIPLE distances with google maps

So.. I have 10 latitude/longitude values in a database. Using the V3 JS API i plot these on a map. I then have an 11th point which is 'users current location' I want to find the distance between the user location and each of the other points. I have created a javascript which does this - essentially, it gets the lat/long, plots the ...

How can i calculate the distance between two gps points in Java?

I used this code but it doesnt work: Need the distance between two gps coordinates like 41.1212, 11.2323 in kilometers (Java) double d2r = (180 / Math.PI); double distance = 0; try{ double dlong = (endpoint.getLon() - startpoint.getLon()) * d2r; double dlat = (endpoint.getLat() - startpoint.getLat()) * d2r; double a = ...

Clustering with a distance matrix

Hi, I have a (symmetric) matrix M that represents the distance between each pair of nodes. For example, A B C D E F G H I J K L A 0 20 20 20 40 60 60 60 100 120 120 120 B 20 0 20 20 60 80 80 80 120 140 140 140 C 20 20 0 20 60 80 80 80 120 140 140 140 D 20 20 20 0 60 80 80 8...

Mysql: Calculate visit frequency.

I have this table CREATE OR REPLACE TABLE hits (ip bigint, page VARCHAR(256), agent VARCHAR(1000), date datetime) and I want to calculate googlebot visit frequency for every page. ... WHERE agent like '%Googlebot%' group by page ...

Google Maps API 3 Directions - Adding trip duration and distance to infoWindow

Howdy Gang, I'm so close on this one right now, but can't quite get the result I'm looking for. This is an attempt to pull a series of geolocations - along with a title and text. These are then assigned to markers which are populated on a google map. My ultimate goal is to get the distance and duration of travel between each of the marke...

Fastest way to calculate euclidian distance in 2D space

What is the fastes way of determening which point q out of n points in 2D space is the closest (smallest euclidian distance) to point p, see attached imgage. My current method of doing this in Python is storing all the distances in a list and then running numpy.argmin(list_of_distances) This is however a bit slow when calculating ...