Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.RevFeatureType.type()


            ImmutableList<PropertyDescriptor> oldDescriptors = oldRevFeatureType
                    .sortedDescriptors();
            ImmutableList<PropertyDescriptor> newDescriptors = newRevFeatureType
                    .sortedDescriptors();
            SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(
                    (SimpleFeatureType) newRevFeatureType.type());
            Map<Name, Optional<?>> attrs = Maps.newHashMap();
            for (int i = 0; i < oldDescriptors.size(); i++) {
                PropertyDescriptor descriptor = oldDescriptors.get(i);
                if (newDescriptors.contains(descriptor)) {
                    Optional<Object> value = values.get(i);
View Full Code Here


            boolean forbidSorting = !usePaging || !hasPrimaryKey;
            ((ForceTypeAndFidFeatureSource) featureSource).setForbidSorting(forbidSorting);

            if (destPathFeatureType != null && adaptToDefaultFeatureType && !alter) {
                featureSource = new FeatureTypeAdapterFeatureSource<FeatureType, Feature>(
                        featureSource, destPathFeatureType.type());
            }

            ProgressListener taskProgress = subProgress(100.f / typeNames.length);
            if (overwrite) {
                try {
View Full Code Here

                RevFeature revFeature = command(RevObjectParse.class).setObjectId(ref.objectId())
                        .call(RevFeature.class).get();
                RevFeatureType revFeatureType = command(RevObjectParse.class)
                        .setObjectId(ref.getMetadataId()).call(RevFeatureType.class).get();
                SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(
                        (SimpleFeatureType) revFeatureType.type());
                ImmutableList<PropertyDescriptor> descriptors = revFeatureType.sortedDescriptors();
                ImmutableList<Optional<Object>> values = revFeature.getValues();
                for (int i = 0; i < descriptors.size(); i++) {
                    PropertyDescriptor descriptor = descriptors.get(i);
                    Optional<Object> value = values.get(i);
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);
        SimpleFeatureType serializedFeatureType = (SimpleFeatureType) rft.type();
        assertEquals(serializedFeatureType.getDescriptors().size(), featureType.getDescriptors()
                .size());

        for (int i = 0; i < featureType.getDescriptors().size(); i++) {
            assertEquals(featureType.getDescriptor(i), serializedFeatureType.getDescriptor(i));
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

                            path = input.getOldObject().path();
                        }
                        if (feature.isPresent() && feature.get() instanceof RevFeature
                                && type.isPresent() && type.get() instanceof RevFeatureType) {
                            RevFeatureType featureType = (RevFeatureType) type.get();
                            Collection<PropertyDescriptor> attribs = featureType.type()
                                    .getDescriptors();

                            for (PropertyDescriptor attrib : attribs) {
                                PropertyType attrType = attrib.getType();
                                if (attrType instanceof GeometryType) {
View Full Code Here

                        GeometryConflict conflict = null;

                        if (feature != null && type != null) {
                            String crsCode = null;
                            Collection<PropertyDescriptor> attribs = type.type().getDescriptors();

                            for (PropertyDescriptor attrib : attribs) {
                                PropertyType attrType = attrib.getType();
                                if (attrType instanceof GeometryType) {
                                    GeometryType gt = (GeometryType) attrType;
View Full Code Here

                    @Override
                    public GeometryChange apply(FeatureInfo input) {
                        GeometryChange change = null;
                        RevFeature revFeature = RevFeatureBuilder.build(input.getFeature());
                        RevFeatureType featureType = input.getFeatureType();
                        Collection<PropertyDescriptor> attribs = featureType.type()
                                .getDescriptors();
                        String crsCode = null;

                        for (PropertyDescriptor attrib : attribs) {
                            PropertyType attrType = attrib.getType();
View Full Code Here

        private MathTransform getMathTransform(ObjectId mdid) {
            MathTransform transform = this.transformsByMetadataId.get(mdid);
            if (transform == null) {
                RevFeatureType revtype = source.getFeatureType(mdid);
                FeatureType type = revtype.type();
                CoordinateReferenceSystem sourceCrs = type.getCoordinateReferenceSystem();
                CoordinateReferenceSystem targetCrs = this.crs;
                if (sourceCrs == null) {
                    sourceCrs = targetCrs;
                }
View Full Code Here

    }

    private ReferencedEnvelope createProjectedFilter(ObjectId metadataId) {
        final ReferencedEnvelope boundsFilter = this.boundsFilter;
        RevFeatureType featureType = ftypeSource.getFeatureType(metadataId);
        CoordinateReferenceSystem nativeCrs = featureType.type().getCoordinateReferenceSystem();
        if (null == nativeCrs || nativeCrs instanceof DefaultEngineeringCRS) {
            return boundsFilter;
        }
        ReferencedEnvelope transformedFilter;
        try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.