Examples of WKBReader


Examples of com.vividsolutions.jts.io.WKBReader

        if (bytes == null) {
            return null;
        }

        try {
            return new WKBReader(factory).read(bytes);
        } catch (ParseException e) {
            throw (IOException) new IOException().initCause(e);
        }

    }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

        if (bytes == null) {
            return null;
        }

        try {
            return new WKBReader(factory).read(bytes);
        } catch (ParseException e) {
            throw (IOException) new IOException().initCause(e);
        }

        //return JTS.geometryFromBytes( bytes );
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

            while (r.next()) {
                // byte[] tileBytes = getTileBytes(r,2);
                byte[] tileBytes = r.getBytes(2);
                byte[] envBytes = r.getBytes(1);
                WKBReader reader = new WKBReader();
                Geometry g;
                try {
                    g = reader.read(envBytes);
                } catch (ParseException e) {
                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
                    throw new IOException(e);
                }
                Envelope env = g.getEnvelopeInternal();
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

                    + " ) select st_asbinary(st_extent(env)) from envelopes";

            Envelope envelope = null;
            PreparedStatement s = con.prepareStatement(envSelect);
            ResultSet r = s.executeQuery();
            WKBReader reader = new WKBReader();

            if (r.next()) {
                byte[] bytes = r.getBytes(1);
                Geometry g;

                try {
                    g = reader.read(bytes);
                } catch (ParseException e) {
                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
                    throw new IOException(e);
                }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

            s = con.prepareStatement(extentSelectLBX);
            s.setString(1, getConfig().getCoverageName());
            r = s.executeQuery();
            r.next();
            byte[] wkb = r.getBytes(1);
            Geometry geom = new WKBReader().read(wkb);
            extent = geom.getEnvelopeInternal();
            LOGGER.fine("creating Extent");

        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

            } else if (binding == java.sql.Timestamp.class) {
                return new java.sql.Timestamp(raf.readLong());
            } else if (binding == java.util.Date.class) {
                return new java.util.Date(raf.readLong());
            } else if (Geometry.class.isAssignableFrom(binding)) {
                WKBReader reader = new WKBReader();
                int length = raf.readInt();
                byte[] buffer = new byte[length];
                raf.read(buffer);
                try {
                    return reader.read(buffer);
                } catch (ParseException e) {
                    throw new IOException("Failed to parse the geometry WKB", e);
                }
            } else {
                int length = raf.readInt();
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

        // read the header
        Header h = readHeader(input);
       
        // read the geometry
        try {
            Geometry g = new WKBReader().read(input);
            g.setSRID(h.srid);
            return g;
        } catch (ParseException e) {
            throw new IOException(e);
        }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

        WKBWriter wkbWriter;

        public WKB(GeometryFactory geomFactory) {
            this.geomFactory = geomFactory;
            this.wkbReader = new WKBReader(geomFactory);
            this.wkbWriter = new WKBWriter();
        }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

          byte bytes[] = rs.getBytes(column);
         
          if(bytes == null) {
            return null;
          }
            return new WKBReader(factory).read(bytes);
        }
        catch (Exception e) {
            throw new DataSourceException("An exception occurred while parsing WKB data", e);
        }
    }
View Full Code Here

Examples of com.vividsolutions.jts.io.WKBReader

        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
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.