Package org.opengis.feature.type

Examples of org.opengis.feature.type.FeatureType


            CloseableIterator<FeatureTypeInfo> it =
                catalog.list(FeatureTypeInfo.class, equal("store.id", store.getId()));
        ) {
            while(it.hasNext()) {
                FeatureTypeInfo ft = it.next();
                FeatureType schema = ft.getFeatureType();
                if (!(schema instanceof SimpleFeatureType)) {
                    LOG.warning("Skipping feature type: " + ft.getName() + ", only simple schema are supported");
                    continue;
                }

                FeatureEntry fe = new FeatureEntry();
                fe.setTableName(ft.getName());
                fe.setIdentifier(ft.getTitle());
                fe.setDescription(ft.getAbstract());
                try {
                    fe.setBounds(ft.boundingBox());
                } catch (Exception e) {
                    throw new IOException(e);
                }
                fe.setSrid(srid(ft.getSRS()));

                GeometryDescriptor geom = schema.getGeometryDescriptor();
                if (geom != null) {
                    fe.setGeometryColumn(geom.getLocalName());
                    fe.setGeometryType(Geometries.getForBinding(
                        (Class<? extends com.vividsolutions.jts.geom.Geometry>) geom.getType().getBinding()));
                }
View Full Code Here


        proj(obj.putObject("proj"), r.getCRS(), r.getSRS());
        bbox( obj.putObject("bbox"), r );
       
        if (r instanceof FeatureTypeInfo) {
            FeatureTypeInfo ft = (FeatureTypeInfo) r;
            FeatureType schema;
            try {
                schema = ft.getFeatureType();
                obj.put("geometry", geometry(schema));
                IO.schema(obj.putObject("schema"), schema, true );
            } catch (IOException e) {
View Full Code Here

        if(store instanceof DataStoreInfo){
            DataStoreInfo data = (DataStoreInfo) store;
           
            @SuppressWarnings("rawtypes")
            DataAccess dataStore = data.getDataStore(new NullProgressListener());
            FeatureType schema;
            org.geotools.data.ResourceInfo info;
            if (dataStore instanceof DataStore) {
                schema = ((DataStore) dataStore).getSchema(name);
                info = ((DataStore) dataStore).getFeatureSource(name).getInfo();
            } else {
View Full Code Here

     * @param parentTreePath path of the parent tree to insert the feature into
     * @param feature the feature to insert
     */
    public Node insert(final String parentTreePath, final Feature feature) {

        final FeatureType featureType = feature.getType();

        NodeRef treeRef;

        Optional<NodeRef> typeTreeRef = context.command(FindTreeChild.class).setIndex(true)
                .setParent(getTree()).setChildPath(parentTreePath).call();
View Full Code Here

                    .setParent(getTree()).setChildPath(treePath).call();

            if (typeTreeRef.isPresent()) {
                treeRef = typeTreeRef.get();
            } else {
                FeatureType featureType = source.getSchema();
                treeRef = createTypeTree(treePath, featureType);
            }
        }
        return treeRef;
    }
View Full Code Here

                            final RevFeature revFeature = RevFeatureBuilder.build(feature);

                            ObjectId id = revFeature.getId();
                            String name = feature.getIdentifier().getID();
                            BoundingBox bounds = feature.getBounds();
                            FeatureType type = feature.getType();

                            builder.putFeature(id, name, bounds, type);
                            return revFeature;
                        }
View Full Code Here

                return new ForwardingFeatureCollection(features) {

                    @Override
                    public FeatureIterator features() {

                        final FeatureType featureType = getSchema();
                        final String fidPrefix = featureType.getName().getLocalPart() + ".";

                        FeatureIterator iterator = delegate.features();

                        return new FidAndFtReplacerIterator(iterator, fidAttribute, fidPrefix,
                                (SimpleFeatureType) featureType);
View Full Code Here

        ObjectReader<RevFeatureType> reader = factory.createObjectReader(TYPE.FEATURETYPE);
        ByteArrayInputStream input = new ByteArrayInputStream(data);
        RevFeatureType rft = reader.read(revFeatureType.getId(), input);

        assertNotNull(rft);
        FeatureType serializedFeatureType = rft.type();

        assertEquals("EPSG:4326", CRS.toSRS(serializedFeatureType.getCoordinateReferenceSystem()));

    }
View Full Code Here

        final RevTreeBuilder2 treeBuilder = getTreeBuilder(feature);

        String fid = feature.getIdentifier().getID();
        BoundingBox bounds = feature.getBounds();
        FeatureType type = feature.getType();

        final Node node = treeBuilder.putFeature(revFeatureId, fid, bounds, type);
        return node;
    }
View Full Code Here

    private RevTreeBuilder2 getTreeBuilder(final Feature feature) {

        final String treePath = treePathResolver.apply(feature);
        RevTreeBuilder2 builder = treeBuilders.get(treePath);
        if (builder == null) {
            FeatureType type = feature.getType();
            builder = createBuilder(treePath, type);
            treeBuilders.put(treePath, builder);
        }
        return builder;
    }
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.