Tabnine Logo
Rectangle.fromPolygon
Code IndexAdd Tabnine to your IDE (free)

How to use
fromPolygon
method
in
org.apache.lucene.geo.Rectangle

Best Java code snippets using org.apache.lucene.geo.Rectangle.fromPolygon (Showing top 4 results out of 315)

origin: org.apache.lucene/lucene-core

/** Create a predicate that checks whether points are within a polygon.
 *  It works the same way as {@link #createDistancePredicate}.
 *  @lucene.internal */
public static PolygonPredicate createPolygonPredicate(Polygon[] polygons, Polygon2D tree) {
 final Rectangle boundingBox = Rectangle.fromPolygon(polygons);
 final Function<Rectangle, Relation> boxToRelation = box -> tree.relate(
   box.minLat, box.maxLat, box.minLon, box.maxLon);
 final Grid subBoxes = createSubBoxes(boundingBox, boxToRelation);
 return new PolygonPredicate(
   subBoxes.latShift, subBoxes.lonShift,
   subBoxes.latBase, subBoxes.lonBase,
   subBoxes.maxLatDelta, subBoxes.maxLonDelta,
   subBoxes.relations,
   tree);
}
origin: org.apache.lucene/lucene-core

final Rectangle box = Rectangle.fromPolygon(polygons);
final byte minLat[] = new byte[Integer.BYTES];
final byte maxLat[] = new byte[Integer.BYTES];
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** Create a predicate that checks whether points are within a polygon.
 *  It works the same way as {@link #createDistancePredicate}.
 *  @lucene.internal */
public static PolygonPredicate createPolygonPredicate(Polygon[] polygons, Polygon2D tree) {
 final Rectangle boundingBox = Rectangle.fromPolygon(polygons);
 final Function<Rectangle, Relation> boxToRelation = box -> tree.relate(
   box.minLat, box.maxLat, box.minLon, box.maxLon);
 final Grid subBoxes = createSubBoxes(boundingBox, boxToRelation);
 return new PolygonPredicate(
   subBoxes.latShift, subBoxes.lonShift,
   subBoxes.latBase, subBoxes.lonBase,
   subBoxes.maxLatDelta, subBoxes.maxLonDelta,
   subBoxes.relations,
   tree);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

final Rectangle box = Rectangle.fromPolygon(polygons);
final byte minLat[] = new byte[Integer.BYTES];
final byte maxLat[] = new byte[Integer.BYTES];
org.apache.lucene.geoRectanglefromPolygon

Javadoc

Returns the bounding box over an array of polygons

Popular methods of Rectangle

  • <init>
    Constructs a bounding box by first validating the provided latitude and longitude coordinates
  • crossesDateline
    Returns true if this bounding box crosses the dateline
  • containsPoint
    returns true if rectangle (defined by minLat, maxLat, minLon, maxLon) contains the lat lon point
  • fromPointDistance
    Compute Bounding Box for a circle using WGS-84 parameters
  • axisLat
    Calculate the latitude of a circle's intersections with its bbox meridians.NOTE: the returned value
  • equals

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JPanel (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now