congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SpatialKey.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.h2.mvstore.rtree.SpatialKey
constructor

Best Java code snippets using org.h2.mvstore.rtree.SpatialKey.<init> (Showing top 15 results out of 315)

origin: com.h2database/h2

@Override
public Object read(ByteBuffer buff) {
  int flags = DataUtils.readVarInt(buff);
  if (flags == -1) {
    long id = DataUtils.readVarLong(buff);
    return new SpatialKey(id);
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    float min = buff.getFloat();
    float max;
    if ((flags & (1 << i)) != 0) {
      max = min;
    } else {
      max = buff.getFloat();
    }
    minMax[i + i] = min;
    minMax[i + i + 1] = max;
  }
  long id = DataUtils.readVarLong(buff);
  return new SpatialKey(id, minMax);
}
origin: com.h2database/h2

/**
 * Create a bounding box starting with the given object.
 *
 * @param objA the object
 * @return the bounding box
 */
Object createBoundingBox(Object objA) {
  SpatialKey a = (SpatialKey) objA;
  if (a.isNull()) {
    return a;
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    minMax[i + i] = a.min(i);
    minMax[i + i + 1] = a.max(i);
  }
  return new SpatialKey(0, minMax);
}
origin: com.h2database/h2

private SpatialKey getKey(SearchRow row) {
  Value v = row.getValue(columnIds[0]);
  if (v == ValueNull.INSTANCE) {
    return new SpatialKey(row.getKey());
  }
  Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
  Envelope env = g.getEnvelopeInternal();
  return new SpatialKey(row.getKey(),
      (float) env.getMinX(), (float) env.getMaxX(),
      (float) env.getMinY(), (float) env.getMaxY());
}
origin: com.h2database/h2

private SpatialKey getKey(SearchRow row) {
  if (row == null) {
    return null;
  }
  Value v = row.getValue(columnIds[0]);
  if (v == ValueNull.INSTANCE) {
    return null;
  }
  Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
  Envelope env = g.getEnvelopeInternal();
  return new SpatialKey(row.getKey(),
      (float) env.getMinX(), (float) env.getMaxX(),
      (float) env.getMinY(), (float) env.getMaxY());
}
origin: org.wowtools/h2

@Override
public Object read(ByteBuffer buff) {
  int flags = DataUtils.readVarInt(buff);
  if (flags == -1) {
    long id = DataUtils.readVarLong(buff);
    return new SpatialKey(id);
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    float min = buff.getFloat();
    float max;
    if ((flags & (1 << i)) != 0) {
      max = min;
    } else {
      max = buff.getFloat();
    }
    minMax[i + i] = min;
    minMax[i + i + 1] = max;
  }
  long id = DataUtils.readVarLong(buff);
  return new SpatialKey(id, minMax);
}
origin: com.h2database/h2-mvstore

@Override
public Object read(ByteBuffer buff) {
  int flags = DataUtils.readVarInt(buff);
  if (flags == -1) {
    long id = DataUtils.readVarLong(buff);
    return new SpatialKey(id);
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    float min = buff.getFloat();
    float max;
    if ((flags & (1 << i)) != 0) {
      max = min;
    } else {
      max = buff.getFloat();
    }
    minMax[i + i] = min;
    minMax[i + i + 1] = max;
  }
  long id = DataUtils.readVarLong(buff);
  return new SpatialKey(id, minMax);
}
origin: com.eventsourcing/h2

@Override
public Object read(ByteBuffer buff) {
  int flags = DataUtils.readVarInt(buff);
  if (flags == -1) {
    long id = DataUtils.readVarLong(buff);
    return new SpatialKey(id);
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    float min = buff.getFloat();
    float max;
    if ((flags & (1 << i)) != 0) {
      max = min;
    } else {
      max = buff.getFloat();
    }
    minMax[i + i] = min;
    minMax[i + i + 1] = max;
  }
  long id = DataUtils.readVarLong(buff);
  return new SpatialKey(id, minMax);
}
origin: com.eventsourcing/h2

/**
 * Create a bounding box starting with the given object.
 *
 * @param objA the object
 * @return the bounding box
 */
Object createBoundingBox(Object objA) {
  SpatialKey a = (SpatialKey) objA;
  if (a.isNull()) {
    return a;
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    minMax[i + i] = a.min(i);
    minMax[i + i + 1] = a.max(i);
  }
  return new SpatialKey(0, minMax);
}
origin: com.h2database/h2-mvstore

/**
 * Create a bounding box starting with the given object.
 *
 * @param objA the object
 * @return the bounding box
 */
Object createBoundingBox(Object objA) {
  SpatialKey a = (SpatialKey) objA;
  if (a.isNull()) {
    return a;
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    minMax[i + i] = a.min(i);
    minMax[i + i + 1] = a.max(i);
  }
  return new SpatialKey(0, minMax);
}
origin: org.wowtools/h2

/**
 * Create a bounding box starting with the given object.
 *
 * @param objA the object
 * @return the bounding box
 */
Object createBoundingBox(Object objA) {
  SpatialKey a = (SpatialKey) objA;
  if (a.isNull()) {
    return a;
  }
  float[] minMax = new float[dimensions * 2];
  for (int i = 0; i < dimensions; i++) {
    minMax[i + i] = a.min(i);
    minMax[i + i + 1] = a.max(i);
  }
  return new SpatialKey(0, minMax);
}
origin: org.wowtools/h2

private SpatialKey getKey(SearchRow row) {
  Value v = row.getValue(columnIds[0]);
  if (v == ValueNull.INSTANCE) {
    return new SpatialKey(row.getKey());
  }
  Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
  Envelope env = g.getEnvelopeInternal();
  return new SpatialKey(row.getKey(),
      (float) env.getMinX(), (float) env.getMaxX(),
      (float) env.getMinY(), (float) env.getMaxY());
}
origin: com.eventsourcing/h2

private SpatialKey getKey(SearchRow row) {
  Value v = row.getValue(columnIds[0]);
  if (v == ValueNull.INSTANCE) {
    return new SpatialKey(row.getKey());
  }
  Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
  Envelope env = g.getEnvelopeInternal();
  return new SpatialKey(row.getKey(),
      (float) env.getMinX(), (float) env.getMaxX(),
      (float) env.getMinY(), (float) env.getMaxY());
}
origin: org.gridgain/gridgain-indexing

/**
 * @param row Row.
 * @param rowId Row id.
 * @return Envelope.
 */
private SpatialKey getEnvelope(SearchRow row, long rowId) {
  Value v = row.getValue(columnIds[0]);
  Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometry();
  Envelope env = g.getEnvelopeInternal();
  return new SpatialKey(rowId,
    (float) env.getMinX(), (float) env.getMaxX(),
    (float) env.getMinY(), (float) env.getMaxY());
}
origin: com.eventsourcing/h2

private SpatialKey getKey(SearchRow row) {
  if (row == null) {
    return null;
  }
  Value v = row.getValue(columnIds[0]);
  if (v == ValueNull.INSTANCE) {
    return null;
  }
  Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
  Envelope env = g.getEnvelopeInternal();
  return new SpatialKey(row.getKey(),
      (float) env.getMinX(), (float) env.getMaxX(),
      (float) env.getMinY(), (float) env.getMaxY());
}
origin: org.wowtools/h2

private SpatialKey getKey(SearchRow row) {
  if (row == null) {
    return null;
  }
  Value v = row.getValue(columnIds[0]);
  if (v == ValueNull.INSTANCE) {
    return null;
  }
  Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
  Envelope env = g.getEnvelopeInternal();
  return new SpatialKey(row.getKey(),
      (float) env.getMinX(), (float) env.getMaxX(),
      (float) env.getMinY(), (float) env.getMaxY());
}
org.h2.mvstore.rtreeSpatialKey<init>

Javadoc

Create a new key.

Popular methods of SpatialKey

  • getId
  • equalsIgnoringId
    Check whether two objects are equals, but do not compare the id fields.
  • isNull
  • max
    Get the maximum value for the given dimension.
  • min
    Get the minimum value for the given dimension.
  • setMax
    Set the maximum value for the given dimension.
  • setMin
    Set the minimum value for the given dimension.
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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