Package org.geotools.data

Examples of org.geotools.data.DataSourceException


        final Parser parser = new Parser(wsConfig);
        final Object parsed;
        try {
            parsed = parser.parse(capabilitiesReader);
        } catch (SAXException e) {
            throw new DataSourceException("Exception parsing WFS 1.1.0 capabilities", e);
        } catch (ParserConfigurationException e) {
            throw new DataSourceException("WFS 1.1.0 parsing configuration error", e);
        }
        if (parsed == null) {
            throw new DataSourceException("WFS 1.1.0 capabilities was not parsed");
        }
        if (!(parsed instanceof WFSCapabilitiesType)) {
            throw new DataSourceException("Expected WFS Capabilities, got " + parsed);
        }
        return (WFSCapabilitiesType) parsed;
    }
View Full Code Here


            URL url = null;
            try {
                ds = createNewDataStore(params);
                liveStores.put(params, ds);
            } catch (MalformedURLException mue) {
                throw new DataSourceException("Unable to attatch datastore to " + url, mue);
            }
        } else
            ds = (DataStore) liveStores.get(params);
        return ds;
    }
View Full Code Here

            return null;
        try {
            byteArrayInStream.setBytes(wkbBytes);
            return wkbr.read(byteArrayInStream);
        } catch (Exception e) {
            throw new DataSourceException("An exception occurred while parsing WKB data", e);
        }
    }
View Full Code Here

            return null;
        try {
            inputStreamInStream.setIn(inputStream);
            return wkbr.read(inputStreamInStream);
        } catch (Exception e) {
            throw new DataSourceException("An exception occurred while parsing WKB data", e);
        }
    }
View Full Code Here

                return readFromBlob(rs, columnIndex);
            default:
                return readFromBytes(rs, columnIndex);
            }
        } catch (SQLException e) {
            throw new DataSourceException("SQL exception occurred while reading the geometry.", e);
        }
    }
View Full Code Here

     */
    private Geometry readFromBytes(ResultSet rs, int columnIndex) throws IOException {
        try {
            return wkb2Geometry(rs.getBytes(columnIndex));
        } catch (SQLException e) {
            throw new DataSourceException("SQL exception occurred while reading the geometry.", e);
        }
    }
View Full Code Here

            if (is == null || is.available() == 0) // ie. its a 0 length column
                                                   // -> return a null geometry!
                return null;
            return wkb2Geometry(is);
        } catch (SQLException e) {
            throw new DataSourceException("SQL exception occurred while reading the geometry.", e);
        } finally {
            if (is != null) {
                is.close();
            }
        }
View Full Code Here

     */
    private Geometry readFromBlob(ResultSet rs, int columnIndex) throws IOException {
        try {
            return doReadFromBlob(rs.getBlob(columnIndex));
        } catch (SQLException e) {
            throw new DataSourceException("SQL exception occurred while reading the geometry.", e);
        }
    }
View Full Code Here

                ps.setNull(position, Types.OTHER);
            } else {
                ps.setBytes(position, new WKBWriter().write((Geometry) value));
            }
        } catch (SQLException e) {
            throw new DataSourceException("SQL exception occurred while reading the geometry.", e);
        }

    }
View Full Code Here

            ogr.DriverRelease(driver);
            if (!driverName.equalsIgnoreCase("georss") &&
                !driverName.equalsIgnoreCase("gpx") &&
                !driverName.equalsIgnoreCase("sosi") &&
                !ogr.LayerCanCreateField(layer)) {
                throw new DataSourceException(
                        "OGR reports it's not possible to create fields on this layer");
            }

            // create fields
            for (int i = 0; i < schema.getAttributeCount(); i++) {
View Full Code Here

TOP

Related Classes of org.geotools.data.DataSourceException

Copyright © 2018 www.massapicom. 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.