Package org.opengis.feature.type

Examples of org.opengis.feature.type.Name


        final CoverageSource source = access.access(TEST_NAME, null, AccessType.READ_ONLY, null,
                null);

        // Checking proper coverage name
        final List<Name> names = access.getNames(null);
        final Name coverageName = names.get(0);

        // Creation of a dummy Request
        CoverageReadRequest request = new CoverageReadRequest();
        // Definition of the parameters
        CoordinateReferenceSystem crs = source.getCoordinateReferenceSystem();
View Full Code Here


                            continue;
                        }

                        // COVERAGE NAME
                        // Add the accepted variable to the list of coverages name
                        final Name coverageName = getCoverageName(varName);
                        final CoordinateSystem cs = NetCDFCRSUtilities.getCoordinateSystem(variable);

                        final SimpleFeatureType indexSchema = getIndexSchema(coverageName, cs);
                        // get variable adapter which maps to a coverage in the end
                        final VariableAdapter vaAdapter = getCoverageDescriptor(coverageName);
View Full Code Here

            }
        }
    }

    private Name getCoverageName(String varName) {
        Name coverageName = ancillaryFileManager.getCoverageName(varName);
        if (coverageName == null) {
            ancillaryFileManager.addCoverage(varName);
            coverageName = new NameImpl(varName);
        }
        coverages.add(coverageName);
View Full Code Here

        AttributeDescriptor targetFeature = tf.createAttributeDescriptor(targetType, targetType
                .getName(), 0, Integer.MAX_VALUE, true, null);
        targetName = targetFeature.getName();
        List mappings = TestData.createMappingsColumnsAndValues(targetFeature);

        Name sourceName = TestData.WATERSAMPLE_TYPENAME;
        FeatureSource<SimpleFeatureType, SimpleFeature> source = ds.getFeatureSource(sourceName);

        // empty nssupport as the sample types have no namespace defined
        NamespaceSupport namespaces = new NamespaceSupport();
        mapping = new FeatureTypeMapping(source, targetFeature, mappings, namespaces);
View Full Code Here

    @Test
    public void testGetBounds() throws IOException {
        final String namespaceUri = "http://online.socialchange.net.au";
        final String localName = "RoadSegment";
        final Name typeName = Types.typeName(namespaceUri, localName);

        URL configUrl = getClass().getResource("/test-data/roadsegments.xml");

        AppSchemaDataAccessDTO config = new XMLConfigDigester().parse(configUrl);
View Full Code Here

     */
    @Test
    public void testWithConfig() throws Exception {
        final String nsUri = "http://online.socialchange.net.au";
        final String localName = "RoadSegment";
        final Name typeName = new NameImpl(nsUri, localName);

        final URL configUrl = getClass().getResource("/test-data/roadsegments.xml");

        AppSchemaDataAccessDTO config = new XMLConfigDigester().parse(configUrl);

        Set/* <FeatureTypeMapping> */mappings = AppSchemaDataAccessConfigurator
                .buildMappings(config);

        dataStore = new AppSchemaDataAccess(mappings);
        FeatureSource<FeatureType, Feature> source = dataStore.getFeatureSource(typeName);

        FeatureType type = source.getSchema();

        AttributeDescriptor node;
        node = (AttributeDescriptor) Types.descriptor(type, Types.typeName(nsUri, "the_geom"));
        assertNotNull(node);
        assertEquals("LineStringPropertyType", node.getType().getName().getLocalPart());

        assertNotNull(Types.descriptor(type, Types.typeName(nsUri, "name")));

        Name ftNodeName = Types.typeName(nsUri, "fromToNodes");
        assertNotNull(Types.descriptor(type, ftNodeName));

        AttributeDescriptor descriptor = (AttributeDescriptor) Types.descriptor(type, ftNodeName);

        ComplexType fromToNodes = (ComplexType) descriptor.getType();

        assertFalse(descriptor.isNillable());
        assertTrue(fromToNodes.isIdentified());

        Name fromNodeName = Types.typeName(nsUri, "fromNode");
        AttributeDescriptor fromNode = (AttributeDescriptor) Types.descriptor(fromToNodes,
                fromNodeName);
        assertNotNull(fromNode);

        Name toNodeName = Types.typeName(nsUri, "toNode");
        AttributeDescriptor toNode = (AttributeDescriptor) Types
                .descriptor(fromToNodes, toNodeName);
        assertNotNull(fromNode);

        assertEquals(Point.class, fromNode.getType().getBinding());
        assertEquals(Point.class, toNode.getType().getBinding());

        // test to see if the mapping can successfully substitute a valid narrower type
        Name subName = Types.typeName(nsUri, "broadTypeEl");
       
        descriptor = (AttributeDescriptor) Types.descriptor(type, subName);

        ComplexType subbedType = (ComplexType) descriptor.getType();

View Full Code Here

        //TODO: this doesn't actually handle the case of an extended operator that does not take
        // any arguments
        if (node.hasChild(Expression.class)) {
            //case of a single operator containing a single expression
            Node n = node.getChild(Expression.class);
            Name opName = new NameImpl(n.getComponent().getNamespace(), n.getComponent().getName());
           
            Filter extOp = lookupExtendedOperator(opName, Arrays.asList((Expression) n.getValue()), factory);
            if (extOp != null) {
                extOps.add(extOp);
            }
        }
        else if (node.hasChild(Map.class)) {
            List<Node> children = node.getChildren(Map.class);
            for (Node n : children) {
                Name opName = new NameImpl(n.getComponent().getNamespace(), n.getComponent().getName());
                Map map = (Map) n.getValue();
               
                List<Expression> expressions = new ArrayList();
                for (Object o : map.values()) {
                    if (o instanceof Expression) {
View Full Code Here

    public boolean removeCoverage(String coverageName, boolean forceDelete) throws IOException,
            UnsupportedOperationException {
        if (setNames.contains(coverageName)) {
            setNames.remove(coverageName);
        }
        Name name = new NameImpl(coverageName);
        if (names.contains(name)) {
            access.delete(name, null, hints);
        } else {
            return false;
        }
View Full Code Here

                    {
                            // get the feature
                            final SimpleFeature sourceFeature = (SimpleFeature) feature;
                            final SimpleFeature destFeature = DataUtilities.template(indexSchema);
                            Collection<Property> props = sourceFeature.getProperties();
                            Name propName = null;
                            Object propValue = null;
                           
                            // Assigning value to dest feature for matching attributes
                            for (Property prop: props) {
                                propName = prop.getName();
View Full Code Here

            if (names == null) {
                names = new ArrayList<Name>();
                final Collection<Name> originalNames = reader.getCoveragesNames();
                for (Name name : originalNames) {
                    Name coverageName = new NameImpl(/*namePrefix + */name.toString());
                    names.add(coverageName);
                }
            }
        } catch (Exception e) {
            throw new DataSourceException(e);
View Full Code Here

TOP

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

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.