Package org.geoserver.catalog

Examples of org.geoserver.catalog.FeatureTypeInfo


       
        // check that all required properties have a specified value
        UpdateElementType update = (UpdateElementType) element;

        try {
            FeatureTypeInfo meta = (FeatureTypeInfo) typeInfos.values().iterator().next();
            FeatureType featureType = meta.getFeatureType();

            for (Iterator prop = update.getProperty().iterator(); prop.hasNext();) {
                PropertyType property = (PropertyType) prop.next();

                //check that valus that are non-nillable exist
View Full Code Here


            namespaceURI = catalog.getDefaultNamespace().getURI();
        }

        try {
            //look for a FeatureType
            FeatureTypeInfo meta = catalog.getFeatureTypeByName( namespaceURI, name.getLocalPart() );

            if (meta != null) {
                //found it
                XSDSchema schema = schemaBuilder.build(meta, null);
View Full Code Here

        FeatureTypeCache featureTypeCache = (FeatureTypeCache) context
            .getComponentInstanceOfType(FeatureTypeCache.class);

        Collection featureTypes = catalog.getFeatureTypes();
        for (Iterator f = featureTypes.iterator(); f.hasNext();) {
            FeatureTypeInfo meta = (FeatureTypeInfo) f.next();
            if ( !meta.enabled() ) {
                continue;
            }

           
            FeatureType featureType =  null;
            try {
                featureType = meta.getFeatureType();
            } catch(Exception e) {
                LOGGER.log(Level.WARNING, "Could not load underlying feature type for type "
                        + meta.getName(), e);
                continue;
            }

            featureTypeCache.put(featureType);
        }
View Full Code Here

                List featureTypes = new ArrayList(catalog.getFeatureTypes());
               
                // filter out disabled feature types
                for (Iterator it = featureTypes.iterator(); it.hasNext();) {
                    FeatureTypeInfo ft = (FeatureTypeInfo) it.next();
                    if(!ft.enabled())
                        it.remove();
                }
               
                // filter the layers if a namespace filter has been set
                if(request.getNamespace() != null) {
                    String namespace = request.getNamespace();
                    for (Iterator it = featureTypes.iterator(); it.hasNext();) {
                        FeatureTypeInfo ft = (FeatureTypeInfo) it.next();
                        if(!namespace.equals(ft.getNamespace().getPrefix()))
                            it.remove();
                    }
                }
               
                Collections.sort(featureTypes, new FeatureTypeInfoTitleComparator());
                for (Iterator it = featureTypes.iterator(); it.hasNext();) {
                    FeatureTypeInfo ftype = (FeatureTypeInfo) it.next();
                    handleFeatureType(ftype);
                }

                end("FeatureTypeList");
            }
View Full Code Here

     * Sets the feature type in which templates are loaded against.
     * @deprecated use {@link #setFeatureType(FeatureTypeInfo)}
     */
    public void setFeatureType(SimpleFeatureType featureType) {
        this.featureType = featureType;
        FeatureTypeInfo ft = catalog.getFeatureTypeByName( featureType.getName() );
        if ( ft == null ) {
            return;
            //throw new IllegalArgumentException("No feature type named " + featureType.getName() + " in catalog");
        }
       
View Full Code Here

            }
        }
    }

    BBOX bboxFilter(QName typeName, Envelope bbox) throws Exception {
        FeatureTypeInfo featureTypeInfo =
            catalog.getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart());

        //JD: should this be applied to all geometries?
        //String name = featureType.getDefaultGeometry().getLocalName();
        //JD: changing to "" so it is
View Full Code Here

        catalog.add(dataStore);

        endTransaction();
        startNewTransaction();

        FeatureTypeInfo ft1 = catalog.getFactory().createFeatureType();
        ft1.setName(getName() + "1");
        ft1.setNativeName("native_" + ft1.getName());
        ft1.setNamespace(ns1);
        ft1.setStore(dataStore);
        catalog.add(ft1);

        FeatureTypeInfo ft2 = catalog.getFactory().createFeatureType();
        ft2.setName(getName() + "2");
        ft2.setNativeName("native_" + ft2.getName());
        ft2.setNamespace(ns2);
        ft2.setStore(dataStore);
        catalog.add(ft2);

        List resources = catalog.getResourcesByNamespace(ns1, FeatureTypeInfo.class);
        assertEquals(1, resources.size());
    }
View Full Code Here

        dataStore.setDescription("store description");
        dataStore.setEnabled(true);
        dataStore.setWorkspace(ws);
        catalog.add(dataStore);

        FeatureTypeInfo refFeatureType = catalog.getFactory().createFeatureType();
        refFeatureType.setName("featureType");
        refFeatureType.setNativeName("nativefeatureType");
        refFeatureType.setTitle("featureType title");
        refFeatureType.setDescription("featureType description");
        refFeatureType.setAbstract("featureType abstract");
        refFeatureType.setSRS("EPSG:4326");
        refFeatureType.setNamespace(namespace);

        FilterFactory factory = CommonFactoryFinder.getFilterFactory(null);
        Filter filter = factory.id(Collections.EMPTY_SET);
        refFeatureType.setFilter(filter);

        CoordinateReferenceSystem crsNative = CRS
                .parseWKT("PROJCS[\"NAD83 / BC Albers\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"standard_parallel_1\",50],PARAMETER[\"standard_parallel_2\",58.5],PARAMETER[\"latitude_of_center\",45],PARAMETER[\"longitude_of_center\",-126],PARAMETER[\"false_easting\",1000000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"3005\"]]");
        BoundingBox nativeBoundingBox = new ReferencedEnvelope(0, 0, 0, 0, crsNative);
        BoundingBox latLonBoundingBox = new ReferencedEnvelope(-180, 180, -90, 90,
                DefaultGeographicCRS.WGS84);

        refFeatureType.setNativeBoundingBox((ReferencedEnvelope) nativeBoundingBox);
        refFeatureType.setLatLonBoundingBox((ReferencedEnvelope) latLonBoundingBox);

        refFeatureType.setStore(dataStore);

        catalog.add(refFeatureType);

        endTransaction();

        startNewTransaction();

        FeatureTypeInfo loadedFeatureType = catalog.getFeatureType(refFeatureType.getId());
        assertNotNull(loadedFeatureType);

        assertFalse(refFeatureType == loadedFeatureType);
        refFeatureType = loadedFeatureType;
View Full Code Here

            FeatureCollection<SimpleFeatureType, SimpleFeature> features = (FeatureCollection) fc.next();
            SimpleFeatureType featureType = features.getSchema();

            // load the metadata for the feature type
            String namespaceURI = featureType.getName().getNamespaceURI();
            FeatureTypeInfo meta = catalog.getFeatureTypeByName(namespaceURI, featureType.getTypeName() );

            if (meta == null)
                throw new WFSException("Could not find feature type "
                        + namespaceURI + ":" + featureType.getTypeName()
                        + " in the GeoServer catalog");

            // add it to the map
            Set metas = (Set) ns2metas.get(namespaceURI);

            if (metas == null) {
                metas = new HashSet();
                ns2metas.put(namespaceURI, metas);
            }

            metas.add(meta);
        }

        GeoServerInfo global = wfs.getGeoServer().getGlobal();
        Encoder encoder = new Encoder(configuration, configuration.schema());
        encoder.setEncoding(Charset.forName( global.getCharset() ));

        // declare wfs schema location
        BaseRequestType gft = (BaseRequestType) getFeature.getParameters()[0];

        encoder.setSchemaLocation(org.geoserver.wfsv.xml.v1_1_0.WFSV.NAMESPACE,
                buildSchemaURL(gft.getBaseUrl(), "wfs/1.1.0/wfs.xsd"));

        // declare application schema namespaces
        for (Iterator i = ns2metas.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();

            String namespaceURI = (String) entry.getKey();
            Set metas = (Set) entry.getValue();

            StringBuffer typeNames = new StringBuffer();

            for (Iterator m = metas.iterator(); m.hasNext();) {
                FeatureTypeInfo meta = (FeatureTypeInfo) m.next();
                typeNames.append(meta.getName());

                if (m.hasNext()) {
                    typeNames.append(",");
                }
            }
View Full Code Here

       
        if(featureType != null) {
            final Name name = featureType.getName();
            final WMS wms = getRequest().getWMS();

            FeatureTypeInfo featureTypeInfo = wms.getFeatureTypeInfo(name);

            if(featureTypeInfo == null){
                //It may be a wrapped coverage
                CoverageInfo cInfo = wms.getCoverageInfo(name);
                if(cInfo != null){
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.FeatureTypeInfo

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.