Examples of KVP


Examples of org.geotools.util.KVP

       
        @SuppressWarnings({ "unchecked", "rawtypes" })
        public StoreBuilder source(String source){
            if( source.endsWith(".shp")){
                when(store.getConnectionParameters()).thenReturn(
                    (Map<String,Serializable>) (Map) new KVP("url", source) );
            }
            else if( source.endsWith(".png")||source.endsWith(".tif")||source.endsWith(".tiff")){
                when(store.getConnectionParameters()).thenReturn(
                    (Map<String,Serializable>) (Map) new KVP("raster", source) );
            }
            else if( source.startsWith("postgis")){
                String host = source.substring(8);
                when(store.getConnectionParameters()).thenReturn(
                    (Map<String,Serializable>) (Map) new KVP("dbtype", "postgis","host",host,"port","5432") );
            }
            else if( source.contains("service=wms")){
                when(store.getConnectionParameters()).thenReturn(
                    (Map<String,Serializable>) (Map) new KVP("wms", source) );
            }
            else {
                when(store.getConnectionParameters()).thenReturn(
                    (Map<String,Serializable>) (Map) new KVP("directory", source) );
            }
            return this;
        }
View Full Code Here

Examples of org.geotools.util.KVP

   
    @Test
    public void testFSTypeParameter() throws Exception {
        URL url = TestData.url(STATE_POP);
       
        KVP params = new KVP( URLP.key,url );
       
        assertTrue( "Sorting is optional", factory.canProcess(params) );
       
        params.put( FSTYPE.key, "shape-ng" );
        assertTrue( "Shape NG supported", factory.canProcess(params) );
       
        params.put(FSTYPE.key, "shape" );
        assertTrue( "Plain shape supported", factory.canProcess(params) );
       
        params.put(FSTYPE.key, "index" );
        assertTrue( "Plain index supported", factory.canProcess(params) );
       
        params.put( FSTYPE.key, "smurf" );
        assertFalse( "Feeling blue; don't try a smruf", factory.canProcess(params) );
    }
View Full Code Here

Examples of org.geotools.util.KVP

    }
    @Test
    public void testQueryCapabilities() throws Exception {
        URL url = TestData.url(STATE_POP);
       
        Map params = new KVP( URLP.key,url );
        DataStore dataStore = factory.createDataStore( params );
        Name typeName = dataStore.getNames().get(0);
        SimpleFeatureSource featureSource = dataStore.getFeatureSource( typeName);
       
        QueryCapabilities caps = featureSource.getQueryCapabilities();
View Full Code Here

Examples of org.geotools.util.KVP

        Process process = Processors.createProcess( name );
       
        ProcessExecutor engine = Processors.newProcessExecutor(2);
       
        // quick map of inputs
        Map<String,Object> input = new KVP("geom", geom);
        Progress working = engine.submit(process, input );
       
        // you could do other stuff whle working is doing its thing
        if( working.isCancelled() ){
            return;
View Full Code Here

Examples of org.geotools.util.KVP

     */
    private void getLayersAndDisplay() throws Exception {
        List<Parameter<?>> list = new ArrayList<Parameter<?>>();
        list.add(new Parameter<File>("image", File.class, "Image",
                "GeoTiff or World+Image to display as basemap",
                new KVP( Parameter.EXT, "tif", Parameter.EXT, "jpg")));
        list.add(new Parameter<File>("shape", File.class, "Shapefile",
                "Shapefile contents to display", new KVP(Parameter.EXT, "shp")));

        JParameterListWizard wizard = new JParameterListWizard("Image Lab",
                "Fill in the following layers", list);
        int finish = wizard.showModalDialog();

View Full Code Here

Examples of org.geotools.util.KVP

   
    @Test
    public void testSum() throws Exception {
        SimpleFeatureSource source = bugs.getFeatureSource("bugsites");
       
        Map<String,Object> input = new KVP(
                "features", source.getFeatures(),
                "aggregationAttribute","cat",
                "function",EnumSet.of(AggregationFunction.Sum),
                "singlePass", true);
       
View Full Code Here

Examples of org.geotools.util.KVP

        File lht = new File( vmap, "lht");
        assertTrue("lht check", lht.exists() );
       
        VPFDataStoreFactory factory = new VPFDataStoreFactory();
        URL url = DataUtilities.fileToURL( vmap );
        Map<String,Object> params = new KVP("url", url);
        DataStore store = factory.createDataStore( params );
        List<Name> names = store.getNames();
       
        Name name = names.get(0);
        SimpleFeatureType schema = store.getSchema(name);
View Full Code Here

Examples of org.geotools.util.KVP

   
    public void testFeatureReader() throws Exception {
        File lht = new File( vmap, "lht");
        VPFDataStoreFactory factory = new VPFDataStoreFactory();
        URL url = DataUtilities.fileToURL( vmap );
        Map<String,Object> params = new KVP("url", url);
        DataStore store = factory.createDataStore( params );
        List<Name> names = store.getNames();
       
        Name name = names.get(0);
        FeatureReader<SimpleFeatureType, SimpleFeature> reader = store.getFeatureReader(new Query(name.getLocalPart()), Transaction.AUTO_COMMIT );
View Full Code Here

Examples of org.geotools.util.KVP

    }
    public void testFeatureSource() throws Exception {
        File lht = new File( vmap, "lht");
        VPFDataStoreFactory factory = new VPFDataStoreFactory();
        URL url = DataUtilities.fileToURL( vmap );
        Map<String,Object> params = new KVP("url", url);
        DataStore store = factory.createDataStore( params );
        List<Name> names = store.getNames();
       
        Name name = names.get(0);
        SimpleFeatureSource source = store.getFeatureSource(name);
View Full Code Here

Examples of org.geotools.util.KVP

            this.defaultValue = defaultValue;
        }

        public WFSFactoryParam(String key, Class<T> type, String title, String description, T defaultValue,
                Object... metadata) {
            super(key, type, new SimpleInternationalString(title), new SimpleInternationalString(description), false, -1, -1, defaultValue, new KVP(metadata));
            this.defaultValue = defaultValue;
        }
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.