Examples of FloatLatLng


Examples of org.apache.lucene.spatial.geometry.FloatLatLng

    writer.close();
  }


  public void testDistances() throws IOException, InvalidGeoException {
    LatLng p1 = new FloatLatLng( 7.06, 171.2 );
    LatLng p2 = new FloatLatLng( 21.6032207, -158.0 );
    double miles = p1.arcDistance( p2, DistanceUnits.MILES );
    System.out.println("testDistances");
    System.out.println("miles:" + miles);
    assertEquals(2288.82495932794, miles);
    LatLng p3 = new FloatLatLng( 41.6032207, -73.087749);
    LatLng p4 = new FloatLatLng( 55.0, 4.0 );
    miles = p3.arcDistance( p4, DistanceUnits.MILES );
    System.out.println("miles:" + miles);
    assertEquals(3474.331719997617, miles);
  }
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

  public Shape getBoxShape(double latitude, double longitude, double miles)
  { 
    if (miles < MILES_FLOOR) {
      miles = MILES_FLOOR;
    }
    LLRect box1 = LLRect.createBox( new FloatLatLng( latitude, longitude ), miles, miles );
    LatLng ll = box1.getLowerLeft();
    LatLng ur = box1.getUpperRight();

    double latY = ur.getLat();
    double latX = ll.getLat();
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

    writer.close();
  }


  public void testDistances() throws IOException, InvalidGeoException {
    LatLng p1 = new FloatLatLng( 7.06, 171.2 );
    LatLng p2 = new FloatLatLng( 21.6032207, -158.0 );
    double miles = p1.arcDistance( p2, DistanceUnits.MILES );
    if (VERBOSE) {
      System.out.println("testDistances");
      System.out.println("miles:" + miles);
    }
    assertEquals(2288.82495932794, miles);
    LatLng p3 = new FloatLatLng( 41.6032207, -73.087749);
    LatLng p4 = new FloatLatLng( 55.0, 4.0 );
    miles = p3.arcDistance( p4, DistanceUnits.MILES );
    if (VERBOSE) System.out.println("miles:" + miles);
    assertEquals(3474.331719997617, miles);
  }
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

   * @param miles
   * @return boundary rectangle where getY/getX is top left, getMinY/getMinX is bottom right
   */
  public Rectangle getBoundary (double x1, double y1, double miles) {

    LLRect box = LLRect.createBox( new FloatLatLng( x1, y1 ), miles, miles );
   
    //System.out.println("Box: "+maxX+" | "+ maxY+" | "+ minX + " | "+ minY);
    return box.toRectangle();

  }
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

  }
 
  public double getLLMDistance (double x1, double y1, double x2, double y2) { 

    LatLng p1 = new FloatLatLng( x1, y1 );
    LatLng p2 = new FloatLatLng( x2, y2 );
    return p1.arcDistance( p2, DistanceUnits.MILES );
  }
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

   
    double lngDelta=(widthMi/2)/miplngdeg;
    double latDelta=(heightMi/2)/miplatdeg;
   
    // TODO: Prob only works in northern hemisphere?
    LatLng ll=new FloatLatLng(center.getLat()-latDelta, center.getLng()-lngDelta);
    LatLng ur=new FloatLatLng(center.getLat()+latDelta, center.getLng()+lngDelta);
   
    return new LLRect(ll, ur);
  }
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

    writer.close();
  }


  public void testDistances() throws IOException, InvalidGeoException {
    LatLng p1 = new FloatLatLng( 7.06, 171.2 );
    LatLng p2 = new FloatLatLng( 21.6032207, -158.0 );
    double miles = p1.arcDistance( p2, DistanceUnits.MILES );
    System.out.println("testDistances");
    System.out.println("miles:" + miles);
    assertEquals(2288.82495932794, miles);
    LatLng p3 = new FloatLatLng( 41.6032207, -73.087749);
    LatLng p4 = new FloatLatLng( 55.0, 4.0 );
    miles = p3.arcDistance( p4, DistanceUnits.MILES );
    System.out.println("miles:" + miles);
    assertEquals(3474.331719997617, miles);
  }
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

  public Shape getBoxShape(double latitude, double longitude, double miles)
  { 
    if (miles < MILES_FLOOR) {
      miles = MILES_FLOOR;
    }
    LLRect box1 = LLRect.createBox( new FloatLatLng( latitude, longitude ), miles, miles );
    LatLng ll = box1.getLowerLeft();
    LatLng ur = box1.getUpperRight();

    double latY = ur.getLat();
    double latX = ll.getLat();
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

                lng = lng+180;
        } else {
                lng=lng-180;
        }
    }
    LatLng ll=new FloatLatLng(lat, lng);
    return ll;
  }
View Full Code Here

Examples of org.apache.lucene.spatial.geometry.FloatLatLng

        lng = -1.0*(180.0 - (lng - 180.0));
    }
    else if (lng < -180.0) {
        lng = (lng + 180.0)+180.0;
    }
    LatLng ll=new FloatLatLng(lat, lng);
    return ll;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.