Examples of GetFeatureParser


Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

            }
        }
        QName featureName = wfs.getFeatureTypeName(prefixedTypeName);
        InputStream in = response.getInputStream();

        GetFeatureParser featureReader = new XmlSimpleFeatureParser(in, schema, featureName, wfs.getAxisOrderForOutput(), mappedURIs);
        return featureReader;
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

        featureType = getTypeView(featureName, schemaLocation, GEOS_ARCHSITES.CRS, properties);

        final FeatureVisitor assertor = new FeatureAssertor(featureType);

        URL url = TestData.getResource(this, GEOS_ARCHSITES.DATA);
        GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
        assertEquals(expectedCount, nof);
        testParseGetFeatures(featureName, featureType, parser, assertor, expectedCount);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

                }
            }
        };

        URL url = TestData.getResource(this, GEOS_STATES.DATA);
        GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
        assertEquals(expectedCount, nof);

        testParseGetFeatures(featureName, featureType, parser, assertor, expectedCount);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

        featureType = getTypeView(featureName, schemaLocation, GEOS_ROADS.CRS, properties);

        final FeatureVisitor assertor = new FeatureAssertor(featureType);

        URL url = TestData.getResource(this, GEOS_ROADS.DATA);
        GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
        assertEquals(expectedCount, nof);

        testParseGetFeatures(featureName, featureType, parser, assertor, expectedCount);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

        featureType = getTypeView(featureName, schemaLocation, GEOS_CURVE_ROADS.CRS, properties);

        final FeatureVisitor assertor = new FeatureAssertor(featureType);

        URL url = TestData.getResource(this, GEOS_CURVE_ROADS.DATA);
        GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
        assertEquals(expectedCount, nof);

        testParseGetFeatures(featureName, featureType, parser, assertor, expectedCount);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

        featureType = getTypeView(featureName, schemaLocation, GEOS_TASMANIA_CITIES.CRS, properties);

        final FeatureVisitor assertor = new FeatureAssertor(featureType);

        URL url = TestData.getResource(this, GEOS_TASMANIA_CITIES.DATA);
        GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
        assertEquals(expectedCount, nof);

        testParseGetFeatures(featureName, featureType, parser, assertor, expectedCount);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

                CUBEWERX_GOVUNITCE.CRS, properties);

        final FeatureVisitor assertor = new FeatureAssertor(featureType);

        URL url = TestData.getResource(this, CUBEWERX_GOVUNITCE.DATA);
        GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);
        int nof = parser.getNumberOfFeatures();
        assertEquals(-1, nof);
        testParseGetFeatures(featureName, featureType, parser, assertor, expectedCount);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

        final String schemaLocation = CUBEWERX_ROADSEG.SCHEMA;
        final SimpleFeatureType featureType = getTypeView(featureName, schemaLocation,
                CUBEWERX_ROADSEG.CRS, properties);

        URL url = TestData.getResource(this, CUBEWERX_ROADSEG.DATA);
        final GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
        assertEquals(-1, nof);

        FeatureVisitor assertor = new FeatureAssertor(featureType);
        testParseGetFeatures(featureName, featureType, parser, assertor, 3);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

        final String schemaLocation = IONIC_STATISTICAL_UNIT.SCHEMA;
        final SimpleFeatureType featureType = getTypeView(featureName, schemaLocation,
                CUBEWERX_ROADSEG.CRS, properties);

        URL url = TestData.getResource(this, IONIC_STATISTICAL_UNIT.DATA);
        final GetFeatureParser parser = getParser(featureName, schemaLocation, featureType, url);

        int nof = parser.getNumberOfFeatures();
        assertEquals(-1, nof);

        FeatureVisitor assertor = new FeatureAssertor(featureType);
        testParseGetFeatures(featureName, featureType, parser, assertor, 2);
    }
View Full Code Here

Examples of org.geotools.data.wfs.protocol.wfs.GetFeatureParser

        FeatureVisitor assertor = new FeatureAssertor(featureType);
        testParseGetFeatures(featureName, featureType, parser, assertor, 2);
    }

    protected void runGetFeaturesParsing() throws Exception {
        GetFeatureParser reader;
        {
            final String[] properties = { "geometry", "instanceName", "instanceCode",
                    "governmentalUnitType" };

            final URL getFeatures = new URL(
                    "http://frameworkwfs.usgs.gov/framework/wfs/wfs.cgi?DATASTORE=Framework&DATASTORE=Framework&"
                            + "SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=gubs:GovernmentalUnitCE&"
                            + "PROPERTYNAME=geometry,instanceName,instanceCode,governmentalUnitType&maxFeatures=100");

            // create a subtype with only the required properties
            final SimpleFeatureType featureType = getTypeView(CUBEWERX_GOVUNITCE.TYPENAME,
                    CUBEWERX_GOVUNITCE.SCHEMA, CUBEWERX_GOVUNITCE.CRS, properties);

            System.out.println("Getting parser for " + getFeatures.toExternalForm());
            reader = getParser(CUBEWERX_GOVUNITCE.TYPENAME, CUBEWERX_GOVUNITCE.SCHEMA, featureType,
                    getFeatures);

            System.out.println("Got " + reader.getClass().getSimpleName());
        }

        int count = 0;
        SimpleFeature feature;
        Object defaultGeometry;
        System.out.println("Parsing features...");

        Runtime runtime = Runtime.getRuntime();
        long initialMem = runtime.totalMemory() - runtime.freeMemory();
        long startTime = System.currentTimeMillis();

        while ((feature = reader.parse()) != null) {
            defaultGeometry = feature.getDefaultGeometry();
            count++;
            System.out.print('.');
            if (count % 100 == 0) {
                System.out.print('\n');
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.