Package org.opengis.feature.type

Examples of org.opengis.feature.type.Name


        workTree = repo.workingTree();
    }

    @Test
    public void testInsertSingle() throws Exception {
        Name name = points1.getType().getName();
        String parentPath = name.getLocalPart();
        Node ref = workTree.insert(parentPath, points1);
        ObjectId objectId = ref.getObjectId();

        assertEquals(objectId, workTree.findUnstaged(appendChild(pointsName, idP1)).get()
                .getObjectId());
View Full Code Here


        List<Feature> deleteFeatures = new LinkedList<Feature>();
        deleteFeatures.add(points1);
        deleteFeatures.add(points3);

        Name typeName = points1.getName();

        workTree.delete(typeName, null, deleteFeatures.iterator());

        assertFalse(workTree.findUnstaged(appendChild(pointsName, idP1)).isPresent());
        assertTrue(workTree.findUnstaged(appendChild(pointsName, idP2)).isPresent());
View Full Code Here

        assertFalse(workTree.findUnstaged(appendChild(pointsName, idP3)).isPresent());

        List<Feature> deleteFeatures = new LinkedList<Feature>();
        deleteFeatures.add(points3);

        Name typeName = points1.getName();

        workTree.delete(typeName, null, deleteFeatures.iterator());

        assertTrue(workTree.findUnstaged(appendChild(pointsName, idP1)).isPresent());
        assertTrue(workTree.findUnstaged(appendChild(pointsName, idP2)).isPresent());
View Full Code Here

    }

    @Test
    public void testHasRoot() throws Exception {
        insert(points1);
        Name typeName = points1.getName();
        assertFalse(workTree.hasRoot(typeName));
    }
View Full Code Here

        String namespace = "http://www.geogig.org/test";
        dataStore.setNamespaceURI(namespace);
        insertAndAdd(lines1);
        commit();
        SimpleFeatureType lines = dataStore.getSchema(RepositoryTestCase.linesTypeName);
        Name expectedName = new NameImpl(namespace, linesName);
        assertEquals(expectedName, lines.getName());
        assertEquals(super.linesType.getAttributeDescriptors(), lines.getAttributeDescriptors());

        insertAndAdd(points1);
        commit();
View Full Code Here

        final List<Attribute> originalValues = (List<Attribute>) originalFeature.getValue();
        final List<Attribute> actualValues = (List<Attribute>) modifiedFeature.getValue();
        for (int i = 0; i < originalValues.size(); i++) {
            Attribute originalAtt = originalValues.get(i);
            Attribute actualAtt = actualValues.get(i);
            Name name = originalAtt.getName();
            // bah, date equals does not work, I don't care for this test
            String localName = name.getLocalPart();
            if (!"INT32_COL".equals(localName) && !"SHAPE".equals(localName)
                    && !"DATE_COL".equals(localName)) {
                assertEquals(name + " does not match", originalAtt.getValue(), actualAtt.getValue());
            }
        }
View Full Code Here

     * @see FeatureStore#modifyFeatures(AttributeDescriptor[], Object[], Filter)
     */
    public final void modifyFeatures(AttributeDescriptor[] type, Object[] value, Filter filter)
            throws IOException {

        Name attributeNames[] = new Name[type.length];
        for (int i = 0; i < type.length; i++) {
            attributeNames[i] = type[i].getName();
        }
        modifyFeatures(attributeNames, value, filter);
    }
View Full Code Here

            throws IOException {
        modifyFeatures(new Name[] { new NameImpl(name), }, new Object[] { attributeValue, }, filter);
    }

    public void modifyFeatures(String[] names, Object[] values, Filter filter) throws IOException {
        Name attributeNames[] = new Name[names.length];
        for (int i = 0; i < names.length; i++) {
            attributeNames[i] = new NameImpl(names[i]);
        }
        modifyFeatures(attributeNames, values, filter);
    }
View Full Code Here

        final AppSchemaFeatureTypeRegistry typeRegistry = new AppSchemaFeatureTypeRegistry();
        try {
            typeRegistry.addSchemas(schemaIndex);
   
            final Name typeName = Types.typeName(AWNS, "SiteSinglePhenomTimeSeriesType");
            final ComplexType testType = (ComplexType) typeRegistry.getAttributeType(typeName);
   
            assertNotNull(testType);
            assertTrue(testType instanceof FeatureType);
   
            AttributeType superType = testType.getSuper();
            assertNotNull(superType);
   
            Name superTypeName = Types.typeName(AWNS, "SamplingSitePurposeType");
            assertEquals(superTypeName, superType.getName());
            // assertTrue(superType instanceof FeatureType);
   
            // ensure all needed types were parsed and aren't just empty proxies
            Map samplingProperties = new HashMap();
View Full Code Here

    private void assertPropertyNamesAndTypeNames(ComplexType parentType,
            Map expectedPropertiesAndTypes) throws Exception {

        for (Iterator it = expectedPropertiesAndTypes.entrySet().iterator(); it.hasNext();) {
            Map.Entry entry = (Entry) it.next();
            Name dName = (Name) entry.getKey();
            Name expectedDescriptorTypeName = (Name) entry.getValue();

            AttributeDescriptor d = (AttributeDescriptor) Types.descriptor(parentType, dName);
            assertNotNull("Descriptor " + dName + " not found for type " + parentType.getName(), d);
            AttributeType type;
            try {
                type = (AttributeType) d.getType();
            } catch (Exception e) {
                LOGGER.log(Level.SEVERE, "type not parsed for "
                        + ((AttributeDescriptor) d).getName(), e);
                throw e;
            }
            assertNotNull(type);
            Name actualTypeName = type.getName();
            assertNotNull(actualTypeName);
            assertNotNull(type.getBinding());
            if (expectedDescriptorTypeName != null) {
                assertEquals("type mismatch for property " + dName, expectedDescriptorTypeName,
                        actualTypeName);
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.