Distance Calculation

HI all
I need to calculate distance between two addresses(from southern california) in my JSP. Does any one know a way to do this? Is there any database or tool available to achieve this?
Please let me know.
Thank you.

Thank for the info tolmank. Do you know any Address verification software? Also can you please send me more info(where can i get that mapquest webservice) about MapQuest WebService?
Thanks once again.

Similar Messages

  • Question about iPod nano 7 gen. distance calculations (without iPod+nike).

    How do iPod nano 7 gen. calculate the distance i ran? (without iPod nike). Are those calculations are accurate? I'm a runner, so i need to know distance that i ran. Only distance, nothing more. Thank you

    It actually goes back to the theory of accelerometer. It calculates the velocity and from the recorded time you ran, it will be able to calculate the distance.

  • Distance calculation with the help of mappoint and sql server integration services

    How to use mappoint 2011 with SSIS 2012 to calculate the distance between two zip codes? is there any process to calculate the distancein ssis?

    SSIS being an ETL tool (moving and transforming data) does not have native integration with mapPoint, nor it exposes any 'Geo' functions to operate on geometry or geoshape data.
    I imagine to achieve what you need SSIS should not be used solely, if you can read the ZIP codes then you can calculate the distance in C# (say) code which in turn can be used in SSIS Script Task if needed: http://www.wiredprairie.us/blog/index.php/archives/688
    Arthur
    MyBlog
    Twitter

  • Distance Calculation - from Isometric view

    I need a lot of help with this one. I uploaded an image so
    you can see what I am talking about because I know this will help
    explain what I am trying to do.
    I made an isometric world and am trying to calculate the
    distance from the center to the outter edge of the circle (or map).
    The red dot in the middle is the middle. Looking at the image its
    obvious that the green line is longer than the blue line, yet
    BECAUSE its an isometric world, the distance is exactly the same.
    Right? So here is the real problem: How do I calculate, or
    determine, the distance of the orange dots from within red dot in
    the middle? I know it isn't using the a^2 + b^2 = c^2 method -
    because that doesn't relate to isometric stuff. My guess is some
    how using angles, but I have had no luck :(.
    What do you guys suggest, and can you provide some small
    snippets to help me? Many thank yous
    *Here is the example picture:
    http://www.gmajr.com/example.jpg

    nice :) (i knew you'd hit this one, lol)
    here's my 'limp' animated demo version, using a couple of
    known ratios of the conic plane, in relation to an actual circular
    region:
    FLA
    ...does it, but not very elegant ;)

  • Calculating co-ordinate distances between specific atoms

    Hi,
    Below is some code to calculate distances between all pairs of atoms. However, i need to make it slightly more specific by only calculating the distance between certain pairs of atoms
    input
    ATOM 5 CA PHE 1 113.142 75.993 130.862
    ATOM 119 CA LEU 7 113.101 72.808 140.110
    ATOM 138 CA ASP 8 109.508 74.207 140.047
    ATOM 150 CA LYS 9 108.132 70.857 141.312
    ATOM 172 CA LEU 10 110.758 70.962 144.119
    e.g distance between all pairs for atoms 5, 119, 150 and 172 (say), last three columns are x,y and z co-ordinates
    code it self
    import java.util.*;
    import java.io.*;
    public class Distance {
    public static void main(String[] args) {
    System.out.println("***Campbells PDB Distance Calculator***" + "\n");
    new Distance();
    System.out.println("\nResults printed to file DistanceCalculations" + "\n");
    System.out.println("\nDue to nature of code, if rerun results will be appended to the end of previous run.");
    public Distance() {
    Vector atomArray = new Vector();
    String line;
    try{
    System.out.println("Enter PDB file:" + "\n");
    BufferedReader inputReader =new BufferedReader (new InputStreamReader(System.in));
    String fileName = inputReader.readLine();
    if ( fileName !=null) {
    BufferedReader inputDistance = new BufferedReader (new FileReader (fileName));
    while (( line = inputDistance.readLine()) !=null && !line.equals(""))
    Atom atom = new Atom(line);
    atomArray.addElement(atom);
    for (int j=0; j<atomArray.size(); j++) {
    for (int k=j+1; k<atomArray.size(); k++) {
    Atom a = (Atom) atomArray.elementAt(j);
    Atom b = (Atom) atomArray.elementAt(k);
    Atom.printDistance (a,b);
    } //if
    } //try
    catch (IOException e) {
    System.out.println("Input file problem");
    } catch (Exception ex) {
    System.out.println (ex);
    class Atom {
    public double x, y, z;
    public String name;
    public Atom(String s) throws IllegalArgumentException {
    try {
    StringTokenizer t = new StringTokenizer (s, " ");
    t.nextToken();
    this.name = t.nextToken();
    for (int j=0; j<3; j++) t.nextToken();
    this.x = new Double(t.nextToken()).doubleValue();
    this.y = new Double(t.nextToken()).doubleValue();
    this.z = new Double(t.nextToken()).doubleValue();
    catch (Exception ex) {
    throw new IllegalArgumentException ("Problem!!!! :-(");
    public String toString() {
    return "atom : " + name + "(x=" + x + " y=" + y + " z=" + z + ")";
    public double distanceFrom (Atom other) {
    return calculateDistance (x, y, z, other.x, other.y, other.z);
    public static double calculateDistance (double x1, double y1, double z1, double x2, double y2, double z2) {
    return Math.sqrt(Math.sqrt(Math.pow(Math.abs(x1-x2),2)+Math.pow(Math.abs(y1-y2),2))+Math.pow(Math.abs(z1-z2),2));
    public static void printDistance (Atom a, Atom b) {
    try{
    FileWriter fw = new FileWriter("DistanceCalculations", true);
    PrintWriter pw = new PrintWriter (fw, true);
    if
    (a.distanceFrom(b) <9){
    pw.println("Distance between " + a.toString() + " and " + b.toString() + " is " + a.distanceFrom(b));
    pw.flush();
    pw.close();
    } // if??
    } //try loop
    catch(IOException e) {
    System.out.println("System error");
    }

    ok, essentially
    want to calculate distance between to ranges. Say
    range 1 is the first three, range 2 the rest. THen
    calculate distance between all possible pairs between
    these two rangesYes - and no doubt that any number of people here could write it for you. But that's not what the forum is about. So what, exactly, is preventing you from doing it?
    Sylvia.

  • Distance between two points with degrees and minutes

    I would like to store several points in the database given degrees and minutes as position. In this example I have point 1 that is E 150, 0/S 30, 0 and points 2 that is E 150, 0/S 30.1. For example if I enter 2 km as distance from position of point 1 I would like the search to return all points witin 2 km.(should return points 2 that is very near)
    If I run the query
    SELECT c.name
    FROM cola_markets_cs c
    WHERE
    SDO_WITHIN_DISTANCE(c.shape,
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(150.0, 30.1, NULL), NULL, NULL),
    'distance=10000 unit=KM')
    = 'TRUE';
    I get result both position 1 and 2, but if I decrease to distance=1000 no rows is returned.
    Can you see what I am doing wrong here?
    Can I also combine SDO_WITHIN_DISTANCE with SDO_NN_DISTANCE so I can ask for all points 10 km in distance from the reference point and I can also see the actual distance for each point?
    Thank you
    I have tested with the following code. Do I save the position wrong..?
    CREATE TABLE cola_markets_cs (
    mkt_id NUMBER PRIMARY KEY,
    name VARCHAR2(32),
    shape MDSYS.SDO_GEOMETRY);
    INSERT INTO cola_markets_cs VALUES (
    1,
    'Point 1',
    MDSYS.SDO_GEOMETRY(
    2001,
    8307,
    MDSYS.SDO_POINT_TYPE(150.0, 30.0, NULL),
    NULL,
    NULL
    INSERT INTO cola_markets_cs VALUES (
    2,
    'Point 2',
    MDSYS.SDO_GEOMETRY(
    2001,
    8307,
    MDSYS.SDO_POINT_TYPE(150.0, 30.1, NULL),
    NULL,
    NULL
    -- UPDATE METADATA VIEW --
    -- Update the USER_SDO_GEOM_METADATA view. This is required
    -- before the Spatial index can be created. Do this only once for each
    -- layer (i.e., table-column combination; here: cola_markets_cs and shape).
    INSERT INTO USER_SDO_GEOM_METADATA
    VALUES (
    'cola_markets_cs',
    'shape',
    MDSYS.SDO_DIM_ARRAY(
    MDSYS.SDO_DIM_ELEMENT('Longitude', -180, 180, 10), -- 10 meters tolerance
    MDSYS.SDO_DIM_ELEMENT('Latitude', -90, 90, 10) -- 10 meters tolerance
    8307 -- SRID for 'Longitude / Latitude (WGS 84)' coordinate system
    -- CREATE THE SPATIAL INDEX --
    -- Must be R-tree; quadtree not supported for geodetic data.
    CREATE INDEX cola_spatial_idx_cs
    ON cola_markets_cs(shape)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    --This search only return if distance is 10 000 km...
    SELECT c.name
    FROM cola_markets_cs c
    WHERE
    SDO_WITHIN_DISTANCE(c.shape,
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(150.0, 30.1, NULL), NULL, NULL),
    'distance=10000 unit=KM')
    = 'TRUE';
    --According to this search the distance to point 1 is 3331198,72256398,
    --this  should be zero..
    SELECT
    c.mkt_id, c.name, SDO_NN_DISTANCE(1) dist
    FROM cola_markets_cs c
    WHERE SDO_NN(c.shape,
    sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL),
    'sdo_num_res=2', 1) = 'TRUE' ORDER BY dist

    Hi,
    What version of Oracle are you using? I got this using your example:
    SELECT
    c.mkt_id, c.name, SDO_NN_DISTANCE(1) dist
    FROM cola_markets_cs c
    WHERE SDO_NN(c.shape,
    sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL), 'sdo_num_res=2', 1) = 'TRUE'
    ORDER BY dist ;
    MKT_ID NAME DIST
    2 Point 2 0
    1 Point 1 11085.3285
    This is 10.1.0.4
    Also:
    Can I also combine SDO_WITHIN_DISTANCE with SDO_NN_DISTANCE so I can ask for all points 10 km in distance from the reference point and I can also see the actual distance for each point?
    No, but you can add a distance calculation:
    SELECT
    c.mkt_id, c.name, SDO_GEOM.SDO_DISTANCE(c.shape,sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL),1) dist
    FROM cola_markets_cs c
    WHERE SDO_WITHIN_DISTANCE(c.shape,
    sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL), 'distance=10 unit=km') = 'TRUE'
    ORDER BY dist ;

  • PayPal and a shipping calculator... or Webassist

    I wrote a very simple web store for my wife, at www.direct2usales.com which uses PayPal for a shopping cart (her sales are seasonal, so a merchant account via authorize.net doesn't work, since there are monthly fees even if there are no sales)
    The one drawback to PayPal is that it does not allow for shipping by weight & distance calculations
    Searching this forum, I do not find any way to do such in Dreamweaver... but I did find mention of http://www.webassist.com/php-scripts-and-solutions/powerstore/ as a pre-built solution that will allow her to continue using PayPal... with one example site in their gallery that uses powerstore
    Has anyone here used powerstore?
    Comments... good or bad... about the product?
    Especially comments about using powerstore with PayPal
    Thanks, John

    Hi John
    You could program your own shipping calculator, see - http://www.adobe.com/devnet/dreamweaver/articles/shipping_charges.html.
    PZ

  • How to Determine the Shortest Distance

    It's been a while since I last pestered the group, but I'm back with a new problem.
    This one is not so much one I can't solve, but one that I can't solve gracefully.
    At times, doctors will leave our organization and that doctor's patients must be handed over to a new doctor. What I need to do is figure out which doctor is closest to them.
    I've already geocoded the address data for the relevant patients and will be doing so for the doctors as soon as I am given the correct criteria to search for which ones are relevant. The addresses for both groups will be in lat/lon.
    I could slog through the list, figuring the distance for each patient to all of the doctors and then take the minimum, but that seems a bit too neanderthal to me and sounds slow.
    I'm wondering if there is a nice, graceful - and quick - means to determine for each patient the nearest doctor.
    Thanx in advance!

    I could slog through the list, figuring the distance for each patient to all of the doctors and then take the minimum, but that seems a bit too neanderthal to me and sounds slow.
    If you have a limited number of doctors, then Patrick's suggestion should be pretty fast for an individual patient.
    If you have a long list of patients, it may take more time. But even then, with modern hardware and a doctor's list that is probably not particularly long, it probably a viable solution, and has the benefit that you can be quite sure the answers are correct.
    The spatial index on a geography column already has most of the generic optimizations in it, and you can tailor "the grid" to your data. If you were to write the distance calculation yourself, it would be much much slower.
    If you have many patients compared to "new" doctors, you could copy the doctor if all patients immediately north, south, east and west of that patient all have the same new doctor. But it would be hard to make that approach better performing than
    the geograph.STDistance approach.
    Gert-Jan

  • Java algorithm calculation

    At first, I want to get the distance calculation from Damansara and Punchong. Below is the x, y position in graph (map)
    /** Calculate the direct distance between 2 cities**/
    * @param from the first city*
         * @param to the second city*
         * @return the distance between them*
    *private double calculateDistance(City from, City to) {*
    double xDiffSqr = ( from.x - to.x ) * ( from.x - to.x );
    double yDiffSqr = ( from.y - to.y ) * ( from.y - to.y );
    return Math.sqrt(xDiffSqr + yDiffSqr);
    Base on the calculation I apply to this answer�
    Damansara� 288 - 39
    Puchong � 216 - 390
    Formula calculation
    xDiffSqr = (288 � 216) (288 � 216)*
    yDiffSqr = (39 � 390) (39 � 390)*
    return Math sqrt(5184 + 123201) = 358.31 //square root
    then�follow with this function to get the total short distance
    *     * To calculate this path total distance in KM*
    *     * @return*
    *     public String getDistance() {*
    *          String distance = totalDistance / 20 + "";*
    *          for (int i = 0; i < distance.length() ; i++) {*
    *               if(distance.charAt(i) == '.') {*
    *                    if(distance.length() - 1 - i > 2) {*
    *                         distance = distance.substring(0, i + 3);*
    *                         break;*
    *                    else*
    *                         break;*
    *          return distance + " Km";*
    I try to use 358.31 to divide 20 = 17.91km
    The system return 18.72km..why why why?

    First you calculate distance using double arithmetic.
    Then you follow with code (which is not a function and is all commented out) where suddenly distance is a String and you are doing some kind of string parsing...
    why why why?
    What you supply is NOT code. We can neither debug nor explain the results of, "I did some stuff that I don't explain to you and got a result that surprised me."

  • Most efficient way to make an ordered list?

    Hi all,
    I have a simulation where I have agents running around in an environment. These agents need to get the closest agent near them, and they have to do this a whole bunch of times each cycle -- closest predator to them, closest prey, closest mate, next-closest mate if that one isn't interested, etc. etc.
    I realized that it would be faster if I just got all the agents in the vicinity ONCE, kept them in a sorted list, and then everytime you want the closest agent of a certain type, just search from the bottom of the list up until you find the first one of that type.
    So here's the question: to make that list, I ask the environment for all the agents in the vicinity, and then go through them one-by-one. I find out the distance between myself and that agent. I then.... what?
    I could put them all into an ArrayList, and then apply some sorting algorithm to that ArrayList. Or I can try to insert them in the right order WHILE I'm making the ArrayList. Or maybe there's some better Collection object that would be even more efficient -- somehow pushing them in and out of stacks, or whatever else smart programmers think up.
    Can anyone suggest the most efficient way to do this? This is something that every agent has to do every step, so efficiency is key.
    Thanks!
    Edit: As a note, calculating the distance between two agents isn't free, and if I either sort or insert as I'm making it, the naive implementation (i.e. the way I would do it...) would require re-checking this distance for every agent in the list every single time a new agent was added. So maybe I could make some use of a HashMap, so that I can store these distances?
    Edited by: TimQuinn on Oct 15, 2009 9:35 AM

    TimQuinn wrote:
    Ok, thanks for all the great suggestions. I think that caching the distance in a wrapper object is a big plus, and then I can run some tests and see if using a built-in collections sorting algorithm or using a treeset is faster in my specific case. Thanks!
    Any thoughts as to the idea of creating one giant map of the distance from each agent to every other agent just once, rather than having each agent work out their own distances to each other agent? I feel like this would be faster (at the expense of memory), but don't know how I'd start approaching it.Well, your idea of the Map would probably work. You would have to make some object that pairs up two agents, something like this:
    public class AgentPair {
       private final Agent a1, a2;
       public AgentPair(Agent a1, Agent a2) { //...
       public boolean equals(Object other) {
          //if distance is a symmetric operation (a.distanceTo(b) == b.distanceTo(a)) then the reverse pair should also be equal
       public int hashCode() {
          return 37*a1.hashCode() + a2.hashCode();
    }This assumes either that you don't override equals or hashCode in Agent, or that you properly override both.
    Then you would have a map that you can populate, given an array of all agents:
    Map<AgentPair, Double> distMap;
    Agent[] agents;
    for ( int i = 0; i < agents.length-1; i++ ) {
       for ( int j = i; j < agents.length; j++ ) {
          distMap.put(new AgentPair(agents, agents[j]), agents[i].distanceTo(agents[j]));
    }Alternatively, if you're not sure you'll definitely use all of the computations, you could alternatively test to see if the computation result is in the map, and if not, perform it; otherwise, use the cached result.
    Any thoughts? Should I make a new post? Abandon the idea?As always, try it and see.  Essentially, it will be faster assuming these two conditions:
    1) You would have to do more than n ^2^ (well actually n choose 2) distance calculations otherwise, and
    2) Computing the distance costs more than retrieving from distMap (this +isn't+ a given!).  If each Agent had a sequential ID, you could do a two-dimensional array of doubles which would speed up lookups.
    Edited by: endasil on 15-Oct-2009 3:39 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Transparency and color falloff with depth effect?

    Videocopilot's 3D Falloff effect isn't compatible beyond CS4. How would I create this effect in CS5 or above?
    http://www.videocopilot.net/tutorials/3d_falloff/

    It's an easy expression involving distance calculation with length(point A, point B) and then feeding the result into a linear() on whatever property you need it, in this case obviously camera distance tied to a DOF filter or whatever... So in this case it would look like
    camPos=thisComp.layeer("Camera").transform.position;
    layPos=thisComp.layeer("XYZ").transform.position;
    camDist=length(camPos,layPos);
    linear(camDist(minDist,maxDist,minBlur,maxBlur)
    Just fill in values for the min/max stuff...
    Mylenium

  • AP1310 outdoor AP migration - AP1550

    Hello to all,
    the good old AP1310 is not anymore supported on WLC Release 7.4 and later (moreover is not possible to configure it in Flexconnect Mode) so the only chance is to replace it with the 1550 Series...I thought to use the model 1552I with Integrated Antenna but after checking the Datasheet of both families I've noticed that the antenna is gain of the 1552I is a lot weaker than the 1310:
    Cisco Aironet 1310 Outdoor Access Point/Bridge with 13-dBi integrated antenna, ETSI config
    Cisco Aironet 1552I Integrated Antenna Access Point has the following Integrated Dual Band Omnidirectional Antenna Radome (1552C/1552I)  2 dBi (2.4 GHz), 4 dBi (5 GHz)
    So... I won't been able to reach the coverage of the installed 1310 with a 1552I and I have to go with a 1552E and its external antennas (i.e. External Single Band Antennas 2.4 GHz - AIR-ANT2413P2M-N= (13 dBi, dual polarized patch))
    Has anyone already had experience with the 1552 after a migration from a 1310???
    Any info are appreciated
    BR and Thnks
    OG

    Marco,
    I have had deployments up to 2-3 miles. Nothing really long.
    Check this link below. It is the distance calculator for 1552 using different antennas. Keep in minid that distance will depend on application throughput requirements, antennas, cables used, regulatory domain, terrain features etc.
    http://www.cisco.com/en/US/docs/wireless/access_point/1550/range/calculator/1552_Link_Calculator_V1.xls

  • Walking   running issue with IOS 8.2

    Hello,
    It seems that since I installed IOS 8.2 the Walking + Running Distance calculation is not working well. I was averaging 2 to 3 km a day, since the update 0.08km per day! How can I calibrate this correctly.
    Thank you for some assistance.
    Philippe

    I think I found a solution. Somehow IOS 8.2 did not read my height (in Health Data) as 1.74m but as 1.74cm.... I added a data point for my height of 174 this morning and now my Walking + Running Distance seems to reflect a closer reality. I hope this helps you too

  • HDTV Question

    I plan on buying a new tv to mount on the wall...I'm a Sony fan, and have been for quite sometime when it comes to TV's, but my dilemma is this-how do you know what size is appropriate?  I want to be able to get the biggest size that will still be a good fit for my living room.  I don't want it so small you can't see it, but I don't want to feel like it's to big either...any suggestions on how to pick the size?

    There is a science to selecting the right size for your room and viewing distance.
    Try using this viewing distance calculator
    http://myhometheater.homestead.com/viewingdistancecalculator.html
    or this one
    http://www.carltonbale.com/home-theater/home-theater-calculator/
    I do not work for Best Buy and am not affiliated with them in any way. I like HT and want to help people improve their HT experience. "There is a LOT more than just having a TV to make a home theater"

  • Mapviewer - common javascript

    Just looking into mapviewer and wanted to add some useful functionality to my map image on a jsp. Was curious if anyone knew of our had some of the more commonly needed javascript functionality for mapping applications.
    1) Coordinate display with mouse over / coordinate transformation
    2) static ruler bar ( measuring stick ) or possibly a way to measure distance using two mouse clicks on the image.
    3) ft/meter conversions for distance calculations and buffering.

    We didn't want people to see it and wonder what they were missing out on, so we disabled it everywhere.
    JS_Hide_AddReview_Button() {
        for(i=0; i //    alert(document.forms["serviceForm"].elements[i].value)
        if (document.forms["serviceForm"].elements[i].value == "Add & Review Order") {
    //    alert("Found it!");
         document.forms["serviceForm"].elements[i].style.display = "none";
    It is set to add the script on all forms.

Maybe you are looking for

  • Problems connecting MSOLAP with Analisys Service in XMII?

    Values Data server MSOLAP in XMII <b>version 11.5</b> Name Value Catalog BANCO_OLAP ColumnNameAttribute sql:field Connector OLAP ConnectorType OLP DataSourceInfo Provider=SQLNCLI.1;Data Source=danilosantos;Persist Security Info=True;Password=;User ID

  • File Export menu in CS6 does not work properly?

    Two main issues: 1. If I downsample a 96kHz audio file to 44k1 for example I have the option to impose an anti-alias low-pass brickwall filter in the export path or not. This is a good idea. However as implemented in the Audition CS6 system we have,

  • Black and white disaster!!!!!!

    everytime i put a picture into black and white then i try to remove the black and white to make a little color show IT DOESNT WORK!!! please help me!!!!

  • Login Issue EAS

    Hello I am unable to login into the EAS , Given Provision Manager Access to the Essabase in Shared Services? what could be the reason Regards, Raj

  • Automate create xml with HTML blocks

    Hi, I have to base on certain trigger, database query result create an XML file. In the XML file I'm passing an HTML page. I have the HTML page saved on the local server.. page1.html, page2.html etcs.. Any suggestions on how I can do this would be gr