Examples of CSVStrategy


Examples of org.geoserver.importer.csv.parse.CSVStrategy

    }

    @Test
    public void testCSVStrategyDefault() throws Exception {
        CSVDataStore datastore = (CSVDataStore) csvDataStoreFactory.createDataStoreFromFile(file);
        CSVStrategy csvStrategy = datastore.getCSVStrategy();
        assertEquals("Unexpected default csv strategy", CSVAttributesOnlyStrategy.class,
                csvStrategy.getClass());
    }
View Full Code Here

Examples of org.geoserver.importer.csv.parse.CSVStrategy

    public void testCSVStrategyGuess() throws Exception {
        Map<String, Serializable> params = new HashMap<String, Serializable>();
        params.put("strategy", "guess");
        params.put("file", file);
        CSVDataStore datastore = (CSVDataStore) csvDataStoreFactory.createDataStore(params);
        CSVStrategy csvStrategy = datastore.getCSVStrategy();
        assertEquals("Unexpected strategy", CSVLatLonStrategy.class, csvStrategy.getClass());
    }
View Full Code Here

Examples of org.geoserver.importer.csv.parse.CSVStrategy

        params.put("strategy", "specify");
        params.put("file", file);
        params.put("latField", "foo");
        params.put("lngField", "bar");
        CSVDataStore datastore = (CSVDataStore) csvDataStoreFactory.createDataStore(params);
        CSVStrategy csvStrategy = datastore.getCSVStrategy();
        assertEquals("Unexpected strategy", CSVSpecifiedLatLngStrategy.class,
                csvStrategy.getClass());
    }
View Full Code Here

Examples of org.geoserver.importer.csv.parse.CSVStrategy

    private FileDataStore createDataStoreFromFile(File file, URI namespace,
            Map<String, Serializable> params) throws IOException {
        CSVFileState csvFileState = new CSVFileState(file, namespace);
        Object strategyParam = STRATEGYP.lookUp(params);
        CSVStrategy csvStrategy = null;
        if (strategyParam != null) {
            String strategyString = strategyParam.toString();
            if (strategyString.equalsIgnoreCase("guess")) {
                csvStrategy = new CSVLatLonStrategy(csvFileState);
            } else if (strategyString.equalsIgnoreCase("specify")) {
View Full Code Here

Examples of org.geoserver.importer.csv.parse.CSVStrategy

        Map<String, Serializable> params = new HashMap<String, Serializable>();
        params.put("strategy", "wkt");
        params.put("wktField", "whatever");
        params.put("file", file);
        CSVDataStore datastore = (CSVDataStore) csvDataStoreFactory.createDataStore(params);
        CSVStrategy csvStrategy = datastore.getCSVStrategy();
        assertEquals("Unexpected strategy", CSVSpecifiedWKTStrategy.class, csvStrategy.getClass());
    }
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.