Package org.geotools.factory

Examples of org.geotools.factory.Hints


public class FactoryUsingOracleSQLOnlineTest extends OracleOnlineTestCase {

    public void testDatumCreation() throws Exception {
        Connection connection = datasource.getConnection();
        try{
            Hints hints = new Hints(Hints.EPSG_DATA_SOURCE, "jdbc/EPSG");
       
            OracleDialectEpsgFactory oracle = new OracleDialectEpsgFactory(hints, connection);
   
            GeodeticDatum datum = oracle.createGeodeticDatum("6326");
            assertNotNull(datum);
View Full Code Here


    }
   
    public void testCRSCreation() throws Exception {
        Connection connection = datasource.getConnection();
        try{
            Hints hints = new Hints(Hints.EPSG_DATA_SOURCE, "jdbc/EPSG");
            OracleDialectEpsgFactory oracle = new OracleDialectEpsgFactory(hints, connection );
           
            CoordinateReferenceSystem crs = oracle.createCoordinateReferenceSystem("4326");
            assertNotNull(crs);
        }
View Full Code Here

        } else {
            bgValues = null;
        }
        try {
            return Resampler2D.reproject(source, targetCRS, targetGG, interpolation,
                (hints instanceof Hints) ? hints : new Hints(hints), bgValues);
        } catch (FactoryException exception) {
            throw new CannotReprojectException(Errors.format(
                    ErrorKeys.CANT_REPROJECT_$1, source.getName()), exception);
        } catch (TransformException exception) {
            throw new CannotReprojectException(Errors.format(
View Full Code Here

     * Makes sure the datastore works when the renderer uses the typical rendering hints
     * @throws Exception
     */
    public void testRendererBehaviour() throws Exception {
        Query query = new Query(featureSource.getSchema().getTypeName());
        query.setHints(new Hints(new Hints(Hints.JTS_COORDINATE_SEQUENCE_FACTORY, new LiteCoordinateSequenceFactory())));
        FeatureCollection fc = featureSource.getFeatures(query);
        FeatureIterator fi = fc.features();
        while(fi.hasNext()) {
            fi.next();
        }
View Full Code Here

        Query query = new Query();
        query.setFilter(filter);

        // check we're respecting the geometry factory hint
        GeometryFactory gf1 = new GeometryFactory();
        query.setHints(new Hints(Hints.JTS_GEOMETRY_FACTORY, gf1));
        SimpleFeature f1 = getFirstFeature(featureSource.getFeatures(query));
        assertSame(gf1, ((Geometry) f1.getDefaultGeometry()).getFactory());
       
        // check we're respecting the geometry factory when changing it
        GeometryFactory gf2 = new GeometryFactory();
        query.setHints(new Hints(Hints.JTS_GEOMETRY_FACTORY, gf2));
        SimpleFeature f2 = getFirstFeature(featureSource.getFeatures(query));
        assertSame(gf2, ((Geometry) f2.getDefaultGeometry()).getFactory());

    }
View Full Code Here

          final AbstractGridFormat format = new GeoTiffFormat();
          assertTrue(format.accepts(noCrs));

          // hint for CRS
          final CoordinateReferenceSystem crs = CRS.decode("EPSG:32632", true);
          final Hints hint = new Hints();
          hint.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, crs);

          // getting a reader
          GeoTiffReader reader = new GeoTiffReader(noCrs, hint);

          // reading the coverage
View Full Code Here

        assertTrue(mosaic.mkdirs());
       
        File file = TestData.file(this, "O3-NO2.nc");
        FileUtils.copyFileToDirectory(file, mosaic);
        file = new File(mosaic, "O3-NO2.nc");
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
View Full Code Here

       
        File file = TestData.file(this, "O3-NO2.nc");
        FileUtils.copyFileToDirectory(file, mosaic);
        file = new File(mosaic, "O3-NO2.nc");
       
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
View Full Code Here

       
        File file = TestData.file(this, "O3-NO2-noZ.nc");
        FileUtils.copyFileToDirectory(file, mosaic);
        file = new File(mosaic, "O3-NO2-noZ.nc");
       
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));
        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
        assertNotNull(format);
View Full Code Here

        File auxFile = TestData.file(this, "O3NO2-noZ.xml");
        FileUtils.copyFileToDirectory(file, mosaic);
        FileUtils.copyFileToDirectory(auxFile, mosaic);
        file = new File(mosaic, "O3NO2-noZ.nc");
       
        final Hints hints= new Hints(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, CRS.decode("EPSG:4326", true));     
        hints.put(Utils.AUXILIARY_FILES_PATH, new File(mosaic,"O3NO2-noZ.xml").getAbsolutePath()); // impose def

        // Get format
        final AbstractGridFormat format = (AbstractGridFormat) GridFormatFinder.findFormat(file.toURI().toURL(),hints);
        final NetCDFReader reader = (NetCDFReader) format.getReader(file.toURI().toURL(), hints);
       
View Full Code Here

TOP

Related Classes of org.geotools.factory.Hints

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.