Examples of WKBReader


Examples of com.vividsolutions.jts.io.WKBReader

            Connection cx) throws SQLException, IOException {
        byte[] wkb = rs.getBytes(column);

        try {
            //TODO: srid
            Polygon polygon = (Polygon) new WKBReader().read(wkb);

            return polygon.getEnvelopeInternal();
        } catch (ParseException e) {
            String msg = "Error decoding wkb for envelope";
            throw (IOException) new IOException(msg).initCause(e);
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

    public WKBAttributeIO() {
        this(new GeometryFactory());
    }
   
    public WKBAttributeIO(GeometryFactory gf) {
        wkbr = new WKBReader(gf);
    }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

    public WKBAttributeIO(GeometryFactory gf) {
        wkbr = new WKBReader(gf);
    }
   
    public void setGeometryFactory(GeometryFactory gf) {
        wkbr = new WKBReader(gf);
    }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

        //String wkb = rs.getString( column );
        byte[] wkb = rs.getBytes(column);

        try {
            //TODO: srid
            Polygon polygon = (Polygon) new WKBReader().read(wkb);

            return polygon.getEnvelopeInternal();
        } catch (ParseException e) {
            String msg = "Error decoding wkb for envelope";
            throw (IOException) new IOException(msg).initCause(e);
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

        byte[] bytes = rs.getBytes(name);
        if ( bytes == null ) {
            return null;
        }
        try {
            return new WKBReader(factory).read(bytes);
        } catch (ParseException e) {
            String msg = "Error decoding wkb";
            throw (IOException) new IOException(msg).initCause(e);
        }
    }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

    // Public methods
 
  public Geometry decodeGeometry(PropertyContainer container) {
    try {
      WKBReader reader = new WKBReader(layer.getGeometryFactory());
      return reader.read((byte[]) container.getProperty(geomProperty));
    } catch (ParseException e) {
      throw new SpatialDatabaseException(e.getMessage(), e);
    }
  }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

  @Override
  public void fromBinary(
      final byte[] bytes ) {
    if (bytes.length > 0) {
      try {
        footprint = new WKBReader().read(bytes);
      }
      catch (final ParseException e) {
        LOGGER.warn(
            "Unable to parse WKB",
            e);
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

   * @return The JTS geometry
   */
  public static Geometry geometryFromBinary(
      final byte[] binary ) {
    try {
      return new WKBReader().read(binary);
    }
    catch (final ParseException e) {
      LOGGER.warn(
          "Unable to deserialize geometry data",
          e);
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

    buf.get(superBinary);
    super.fromBinary(superBinary);
    final byte[] geometryBinary = new byte[bytes.length - superLength - 4];
    buf.get(geometryBinary);
    try {
      queryGeometry = new WKBReader().read(geometryBinary);
    }
    catch (final ParseException e) {
      LOGGER.warn(
          "Unable to read query geometry as well-known binary",
          e);
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

      else if (binding == java.util.Date.class) {
        return new java.util.Date(
            input.readLong());
      }
      else if (Geometry.class.isAssignableFrom(binding)) {
        final WKBReader reader = new WKBReader();
        final int length = input.readInt();
        final byte[] buffer = new byte[length];
        input.readFully(buffer);
        try {
          return reader.read(buffer);
        }
        catch (final ParseException e) {
          throw new IOException(
              "Failed to parse the geometry WKB",
              e);
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.