Package org.opengis.feature.type

Examples of org.opengis.feature.type.FeatureType


     * @param lfts
     * @param fs
     * @throws FactoryException
     */
    void reprojectSpatialFilters(final ArrayList<LiteFeatureTypeStyle> lfts, FeatureSource fs) throws FactoryException {
        FeatureType schema = fs.getSchema();
        CoordinateReferenceSystem declaredCRS = getDeclaredSRS(schema);

        // reproject spatial filters in each fts
        for (LiteFeatureTypeStyle fts : lfts) {
            reprojectSpatialFilters(fts, declaredCRS, schema);
View Full Code Here


        // No geometry transformations -> we can modify geometries in place
        // Just one geometry transformation over an attribute -> we can modify geometries in place
        // Two tx over the same attribute, or straight usage and a tx -> we have to preserve the
        // original geometry as well, thus we need cloning
        StyleAttributeExtractor extractor = new StyleAttributeExtractor();
        FeatureType featureType = layer.getFeatureSource().getSchema();
        Set<String> plainGeometries = new java.util.HashSet<String>();
        Set<String> txGeometries = new java.util.HashSet<String>();
        for (LiteFeatureTypeStyle lft : lfts) {
            for(Rule r: lft.ruleList) {
                for(Symbolizer s: r.symbolizers()) {
                    if(s.getGeometry() == null) {
                        String attribute = featureType.getGeometryDescriptor().getName().getLocalPart();
                        if(txGeometries.contains(attribute))
                            return true;
                        plainGeometries.add(attribute);
                    } else if(s.getGeometry() instanceof PropertyName) {
                        String attribute = ((PropertyName) s.getGeometry()).getPropertyName();
View Full Code Here

            MapLayer currLayer, Object drawMe, Symbolizer s) {


        if( drawMe instanceof Feature) {
            Feature f = (Feature) drawMe;
            FeatureType schema = f.getType();

            Expression geometry = s.getGeometry();

            String geomName = null;
            if(geometry instanceof PropertyName) {
View Full Code Here

            FeatureSource featureSource, Query layerQuery, Query renderingQuery,
            GridGeometry2D gridGeometry, CoordinateReferenceSystem sourceCrs, RenderingHints hints) throws IOException, SchemaException, TransformException, FactoryException  {
        Object result = null;
       
        // check if it's a wrapper coverage or a wrapped reader
        FeatureType schema = featureSource.getSchema();
        boolean isRasterData = false;
        if(schema instanceof SimpleFeatureType) {
            SimpleFeatureType simpleSchema = (SimpleFeatureType) schema;
            GridCoverage2D coverage = null;
            if(FeatureUtilities.isWrappedCoverage(simpleSchema) || FeatureUtilities.isWrappedCoverageReader(simpleSchema)) {
View Full Code Here

        map.put(ShapefileDataStoreFactory.NAMESPACEP.key, namespace);
        map.put(ShapefileDataStoreFactory.URLP.key, TestData.url(STATE_POP));

        ShapefileDataStore store = (ShapefileDataStore) factory.createDataStore(map);
        FeatureType schema = store.getSchema();
        assertEquals(namespace.toString(), schema.getName().getNamespaceURI());
        store.dispose();
    }
View Full Code Here

        File file = new File("test.shp");
        URL toURL = file.toURI().toURL();

        ShapefileDataStore ds = new ShapefileDataStore(toURL);
        ds.createSchema(DataUtilities.createType("test", "geom:MultiPolygon"));
        FeatureType before = ds.getSchema();

        ds.forceSchemaCRS(CRS.decode("EPSG:3005"));
        FeatureType after = ds.getSchema();
        ds.dispose();

        assertNotSame(before, after);
        assertNull("4326", before.getCoordinateReferenceSystem());
        assertEquals("NAD83 / BC Albers", after.getCoordinateReferenceSystem().getName().getCode());

        file.deleteOnExit();
        file = new File("test.dbf");
        file.deleteOnExit();
        file = new File("test.shp");
View Full Code Here

        //special case, if the declaration is abstract it is probably "_Feautre"
        // which means we are parsing an elemetn which could not be found in the
        // schema, so instaed of using the element declaration to build the
        // type, just use the node given to us
        SimpleFeatureType sfType = null;
        FeatureType fType = null;
       
        if (!decl.isAbstract()) {
            //first look in cache
            fType = ftCache.get(new NameImpl(decl.getTargetNamespace(), decl.getName()));
View Full Code Here

        e.setMetadata(g, "gml:description", description);
    }

    public static Element AbstractFeatureType_encode(Object object, Document document, Element value) {
        Feature feature = (Feature) object;
        FeatureType featureType = feature.getType();

        String namespace = featureType.getName().getNamespaceURI();
        String typeName = featureType.getName().getLocalPart();

        Element encoding = document.createElementNS(namespace, typeName);
        encoding.setAttributeNS(null, "fid", feature.getIdentifier().getID());

        return encoding;
View Full Code Here

    // docs start queryFeatures
    private void queryFeatures() throws Exception {
        String typeName = (String) featureTypeCBox.getSelectedItem();
        SimpleFeatureSource source = dataStore.getFeatureSource(typeName);

        FeatureType schema = source.getSchema();
        String name = schema.getGeometryDescriptor().getLocalName();

        Filter filter = CQL.toFilter(text.getText());

        Query query = new Query(typeName, filter, new String[] { name });
View Full Code Here

        String typeName = (String) featureTypeCBox.getSelectedItem();
        SimpleFeatureSource source = dataStore.getFeatureSource(typeName);

        Filter filter = CQL.toFilter(text.getText());

        FeatureType schema = source.getSchema();
        String name = schema.getGeometryDescriptor().getLocalName();
        Query query = new Query(typeName, filter, new String[] { name });

        SimpleFeatureCollection features = source.getFeatures(filter);

        double totalX = 0.0;
View Full Code Here

TOP

Related Classes of org.opengis.feature.type.FeatureType

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.