Examples of FeatureJSON


Examples of org.geotools.geojson.feature.FeatureJSON

        assertEquals(fnG.getCoordinates()[1].y, 101.1);
    }

    /* Test feature flipping with Multi-Line String geometry*/
    public void testFeatureFlippingWithMultiLineStringGeom() throws IOException {
        FeatureJSON fjson = new FeatureJSON();

        SimpleFeature sf = fjson.readFeature(reader(strip(getFeatureWithMultiLineGeometry())));

        Geometry fnG = (Geometry) sf.getDefaultGeometry();

        SFSDataStoreUtil.flipFeatureYX(fnG);

View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

        assertEquals(fnG.getCoordinates()[3].y, 103.1);
    }

    /* Test feature flipping with Multi-Polygongeometry*/
    public void testFeatureFlippingWithMultiPolygonGeom() throws IOException {
        FeatureJSON fjson = new FeatureJSON();

        SimpleFeature sf = fjson.readFeature(reader(strip(getFeatureWithMultiPolygonGeometry())));

        Geometry fnG = (Geometry) sf.getDefaultGeometry();

        SFSDataStoreUtil.flipFeatureYX(fnG);

View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

    /**
     * Test Whether the boundingbox params get flipped properly or not
     * @throws IOException
     */
    public void testForBBoxFlipping() throws IOException {
        FeatureJSON fjson = new FeatureJSON();

        SimpleFeature sf = fjson.readFeature(reader(strip(getFeatureWithLineStringGeometry())));

        ArrayList al = (ArrayList) sf.getAttribute("boundedBy");

        SFSDataStoreUtil.flipYXInsideTheBoundingBox(al);

View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

    }

    @Override
    protected void write(Object object, OutputStream out) throws IOException {
        SimpleFeatureCollection features = (SimpleFeatureCollection) object;
        final FeatureJSON json = new FeatureJSON();
        boolean geometryless = features.getSchema().getGeometryDescriptor() == null;
        json.setEncodeFeatureCollectionBounds(!geometryless);
        json.setEncodeFeatureCollectionCRS(!geometryless);
        json.writeFeatureCollection(features, out);
    }
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

        super(FeatureCollection.class, FeatureCollection.class, "application/json");
    }

    @Override
    public void encode(Object value, OutputStream os) throws IOException {
        FeatureJSON json = new FeatureJSON();
        // commented out due to GEOT-3209
        // json.setEncodeFeatureCRS(true);
        // json.setEncodeFeatureCollectionCRS(true);
        json.writeFeatureCollection((FeatureCollection) value, os);
    }
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

        json.writeFeatureCollection((FeatureCollection) value, os);
    }

    @Override
    public Object decode(InputStream input) throws Exception {
        return new FeatureJSON().readFeatureCollection(input);
    }
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

        return new FeatureJSON().readFeatureCollection(input);
    }

    @Override
    public Object decode(String input) throws Exception {
        return new FeatureJSON().readFeatureCollection(input);
    }
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

            super(FeatureCollection.class);
        }

        @Override
        public void encode(Object value, OutputStream os) throws IOException {
            FeatureJSON json = new FeatureJSON();
            // commented out due to GEOT-3209
            // json.setEncodeFeatureCRS(true);
            // json.setEncodeFeatureCollectionCRS(true);
            json.writeFeatureCollection((FeatureCollection) value, os);
        }
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

            json.writeFeatureCollection((FeatureCollection) value, os);
        }

        @Override
        public Object decode(InputStream input) throws Exception {
            return new FeatureJSON().readFeatureCollection(input);
        }
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON

            return new FeatureJSON().readFeatureCollection(input);
        }

        @Override
        public Object decode(String input) throws Exception {
            return new FeatureJSON().readFeatureCollection(input);
        }
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.