Codota Logo
GeoUtils.checkLatitude
Code IndexAdd Codota to your IDE (free)

How to use
checkLatitude
method
in
org.apache.lucene.geo.GeoUtils

Best Java code snippets using org.apache.lucene.geo.GeoUtils.checkLatitude (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: org.apache.lucene/lucene-core

/**
 * Quantizes double (64 bit) latitude into 32 bits (rounding up: in the direction of +90)
 * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
 * @return encoded value as a 32-bit {@code int}
 * @throws IllegalArgumentException if latitude is out of bounds
 */
public static int encodeLatitudeCeil(double latitude) {
 GeoUtils.checkLatitude(latitude);
 // the maximum possible value cannot be encoded without overflow
 if (latitude == 90.0D) {
  latitude = Math.nextDown(latitude);
 }
 return (int) Math.ceil(latitude / LAT_DECODE);
}
origin: org.apache.lucene/lucene-core

/**
 * Quantizes double (64 bit) latitude into 32 bits (rounding down: in the direction of -90)
 * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
 * @return encoded value as a 32-bit {@code int}
 * @throws IllegalArgumentException if latitude is out of bounds
 */
public static int encodeLatitude(double latitude) {
 checkLatitude(latitude);
 // the maximum possible value cannot be encoded without overflow
 if (latitude == 90.0D) {
  latitude = Math.nextDown(latitude);
 }
 return (int) Math.floor(latitude / LAT_DECODE);
}
origin: org.apache.lucene/lucene-core

/**
 * Constructs a bounding box by first validating the provided latitude and longitude coordinates
 */
public Rectangle(double minLat, double maxLat, double minLon, double maxLon) {
 GeoUtils.checkLatitude(minLat);
 GeoUtils.checkLatitude(maxLat);
 GeoUtils.checkLongitude(minLon);
 GeoUtils.checkLongitude(maxLon);
 this.minLon = minLon;
 this.maxLon = maxLon;
 this.minLat = minLat;
 this.maxLat = maxLat;
 assert maxLat >= minLat;
 // NOTE: cannot assert maxLon >= minLon since this rect could cross the dateline
}
origin: org.apache.lucene/lucene-core

public LatLonPointDistanceQuery(String field, double latitude, double longitude, double radiusMeters) {
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 if (Double.isFinite(radiusMeters) == false || radiusMeters < 0) {
  throw new IllegalArgumentException("radiusMeters: '" + radiusMeters + "' is invalid");
 }
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 this.field = field;
 this.latitude = latitude;
 this.longitude = longitude;
 this.radiusMeters = radiusMeters;
}
origin: org.apache.lucene/lucene-core

LatLonDocValuesDistanceQuery(String field, double latitude, double longitude, double radiusMeters) {
 if (Double.isFinite(radiusMeters) == false || radiusMeters < 0) {
  throw new IllegalArgumentException("radiusMeters: '" + radiusMeters + "' is invalid");
 }
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 this.field = field;
 this.latitude = latitude;
 this.longitude = longitude;
 this.radiusMeters = radiusMeters;
}
origin: org.apache.lucene/lucene-core

LatLonPointSortField(String field, double latitude, double longitude) {
 super(field, SortField.Type.CUSTOM);
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 this.latitude = latitude;
 this.longitude = longitude;
 setMissingValue(Double.POSITIVE_INFINITY);
}

origin: org.apache.lucene/lucene-core

LatLonDocValuesBoxQuery(String field, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude) {
 GeoUtils.checkLatitude(minLatitude);
 GeoUtils.checkLatitude(maxLatitude);
 GeoUtils.checkLongitude(minLongitude);
 GeoUtils.checkLongitude(maxLongitude);
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 this.field = field;
 this.crossesDateline = minLongitude > maxLongitude; // make sure to compute this before rounding
 this.minLatitude = GeoEncodingUtils.encodeLatitudeCeil(minLatitude);
 this.maxLatitude = GeoEncodingUtils.encodeLatitude(maxLatitude);
 this.minLongitude = GeoEncodingUtils.encodeLongitudeCeil(minLongitude);
 this.maxLongitude = GeoEncodingUtils.encodeLongitude(maxLongitude);
}
origin: org.apache.lucene/lucene-core

GeoUtils.checkLatitude(polyLats[i]);
GeoUtils.checkLongitude(polyLons[i]);
origin: org.apache.lucene/lucene-core

checkLatitude(centerLat);
checkLongitude(centerLon);
final double radLat = toRadians(centerLat);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Quantizes double (64 bit) latitude into 32 bits (rounding down: in the direction of -90)
 * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
 * @return encoded value as a 32-bit {@code int}
 * @throws IllegalArgumentException if latitude is out of bounds
 */
public static int encodeLatitude(double latitude) {
 checkLatitude(latitude);
 // the maximum possible value cannot be encoded without overflow
 if (latitude == 90.0D) {
  latitude = Math.nextDown(latitude);
 }
 return (int) Math.floor(latitude / LAT_DECODE);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Quantizes double (64 bit) latitude into 32 bits (rounding up: in the direction of +90)
 * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
 * @return encoded value as a 32-bit {@code int}
 * @throws IllegalArgumentException if latitude is out of bounds
 */
public static int encodeLatitudeCeil(double latitude) {
 GeoUtils.checkLatitude(latitude);
 // the maximum possible value cannot be encoded without overflow
 if (latitude == 90.0D) {
  latitude = Math.nextDown(latitude);
 }
 return (int) Math.ceil(latitude / LAT_DECODE);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/**
 * Constructs a bounding box by first validating the provided latitude and longitude coordinates
 */
public Rectangle(double minLat, double maxLat, double minLon, double maxLon) {
 GeoUtils.checkLatitude(minLat);
 GeoUtils.checkLatitude(maxLat);
 GeoUtils.checkLongitude(minLon);
 GeoUtils.checkLongitude(maxLon);
 this.minLon = minLon;
 this.maxLon = maxLon;
 this.minLat = minLat;
 this.maxLat = maxLat;
 assert maxLat >= minLat;
 // NOTE: cannot assert maxLon >= minLon since this rect could cross the dateline
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

public LatLonPointDistanceQuery(String field, double latitude, double longitude, double radiusMeters) {
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 if (Double.isFinite(radiusMeters) == false || radiusMeters < 0) {
  throw new IllegalArgumentException("radiusMeters: '" + radiusMeters + "' is invalid");
 }
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 this.field = field;
 this.latitude = latitude;
 this.longitude = longitude;
 this.radiusMeters = radiusMeters;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

LatLonPointSortField(String field, double latitude, double longitude) {
 super(field, SortField.Type.CUSTOM);
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 this.latitude = latitude;
 this.longitude = longitude;
 setMissingValue(Double.POSITIVE_INFINITY);
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

LatLonDocValuesDistanceQuery(String field, double latitude, double longitude, double radiusMeters) {
 if (Double.isFinite(radiusMeters) == false || radiusMeters < 0) {
  throw new IllegalArgumentException("radiusMeters: '" + radiusMeters + "' is invalid");
 }
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 this.field = field;
 this.latitude = latitude;
 this.longitude = longitude;
 this.radiusMeters = radiusMeters;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

LatLonDocValuesBoxQuery(String field, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude) {
 GeoUtils.checkLatitude(minLatitude);
 GeoUtils.checkLatitude(maxLatitude);
 GeoUtils.checkLongitude(minLongitude);
 GeoUtils.checkLongitude(maxLongitude);
 if (field == null) {
  throw new IllegalArgumentException("field must not be null");
 }
 this.field = field;
 this.crossesDateline = minLongitude > maxLongitude; // make sure to compute this before rounding
 this.minLatitude = GeoEncodingUtils.encodeLatitudeCeil(minLatitude);
 this.maxLatitude = GeoEncodingUtils.encodeLatitude(maxLatitude);
 this.minLongitude = GeoEncodingUtils.encodeLongitudeCeil(minLongitude);
 this.maxLongitude = GeoEncodingUtils.encodeLongitude(maxLongitude);
}
origin: org.apache.lucene/lucene-spatial3d

/**
 * Convert input parameters to a box.
 * @param minLatitude latitude lower bound: must be within standard +/-90 coordinate bounds.
 * @param maxLatitude latitude upper bound: must be within standard +/-90 coordinate bounds.
 * @param minLongitude longitude lower bound: must be within standard +/-180 coordinate bounds.
 * @param maxLongitude longitude upper bound: must be within standard +/-180 coordinate bounds.
 * @return the box.
 */
static GeoBBox fromBox(final double minLatitude, final double maxLatitude, final double minLongitude, final double maxLongitude) {
 GeoUtils.checkLatitude(minLatitude);
 GeoUtils.checkLongitude(minLongitude);
 GeoUtils.checkLatitude(maxLatitude);
 GeoUtils.checkLongitude(maxLongitude);
 return GeoBBoxFactory.makeGeoBBox(PlanetModel.WGS84, 
  Geo3DUtil.fromDegrees(maxLatitude), Geo3DUtil.fromDegrees(minLatitude), Geo3DUtil.fromDegrees(minLongitude), Geo3DUtil.fromDegrees(maxLongitude));
}
origin: org.apache.lucene/lucene-spatial

/**
 * Main encoding method to quantize lat/lon points and bit interleave them into a binary morton code
 * in the range of 0x00000000... : 0xFFFFFFFF...
 *
 * @param latitude latitude value: must be within standard +/-90 coordinate bounds.
 * @param longitude longitude value: must be within standard +/-180 coordinate bounds.
 * @return bit interleaved encoded values as a 64-bit {@code long}
 * @throws IllegalArgumentException if latitude or longitude is out of bounds
 */
public static final long encode(double latitude, double longitude) {
 checkLatitude(latitude);
 checkLongitude(longitude);
 // encode lat/lon flipping the sign bit so negative ints sort before positive ints
 final int latEnc = encodeLatitude(latitude) ^ 0x80000000;
 final int lonEnc = encodeLongitude(longitude) ^ 0x80000000;
 return BitUtil.interleave(lonEnc, latEnc);
}
origin: org.apache.lucene/lucene-spatial3d

/**
 * Convert input parameters to a circle.
 * @param latitude latitude at the center: must be within standard +/-90 coordinate bounds.
 * @param longitude longitude at the center: must be within standard +/-180 coordinate bounds.
 * @param radiusMeters maximum distance from the center in meters: must be non-negative and finite.
 * @return the circle.
 */
static GeoCircle fromDistance(final double latitude, final double longitude, final double radiusMeters) {
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 return GeoCircleFactory.makeGeoCircle(PlanetModel.WGS84, fromDegrees(latitude), fromDegrees(longitude), fromMeters(radiusMeters));
}

origin: org.apache.lucene/lucene-spatial3d

/** 
 * Creates a new Geo3DPoint field with the specified latitude, longitude (in degrees).
 *
 * @throws IllegalArgumentException if the field name is null or latitude or longitude are out of bounds
 */
public Geo3DPoint(String name, double latitude, double longitude) {
 super(name, TYPE);
 GeoUtils.checkLatitude(latitude);
 GeoUtils.checkLongitude(longitude);
 // Translate latitude/longitude to x,y,z:
 final GeoPoint point = new GeoPoint(PlanetModel.WGS84, Geo3DUtil.fromDegrees(latitude), Geo3DUtil.fromDegrees(longitude));
 fillFieldsData(point.x, point.y, point.z);
}
org.apache.lucene.geoGeoUtilscheckLatitude

Javadoc

validates latitude value is within standard +/-90 coordinate bounds

Popular methods of GeoUtils

  • checkLongitude
    validates longitude value is within standard +/-180 coordinate bounds
  • orient
    Returns a positive value if points a, b, and c are arranged in counter-clockwise order, negative val
  • distanceQuerySortKey
    binary search to find the exact sortKey needed to match the specified radius any sort key lte this i
  • lineCrossesLine
    uses orient method to compute whether two line segments cross
  • relate
    Compute the relation between the provided box and distance query. This only works for boxes that do
  • sloppySin
    Returns the trigonometric sine of an angle converted as a cos operation. Note that this is not quite
  • within90LonDegrees
    Return whether all points of [minLon,maxLon] are within 90 degrees of lon.

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • addToBackStack (FragmentTransaction)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now