Examples of readFeature()


Examples of org.geotools.data.vpf.file.VPFFile.readFeature()

        String vpfTableName = new File(dir, LIBRARY_HEADER_TABLE).toString();
        VPFFile lhtFile = VPFFileFactory.getInstance().getFile(vpfTableName);
        lhtFile.reset();
  this.namespace = namespace;
        try {
            lhtFile.readFeature(); // check for errors
        } catch (IllegalAttributeException exc) {
            exc.printStackTrace();
            throw new IOException("Illegal values in library attribute table");
        }
        xmin = -180;
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile.readFeature()

        VPFFile file = (VPFFile) featureType.getFeatureClass().getFileList().get(0);
        hasNext = false;
        SimpleFeature row = null;
        try {
            if(file.hasNext()){
                row = file.readFeature();
            }
        } catch (IOException exc1) {
            // TODO Auto-generated catch block
            exc1.printStackTrace();
        } catch (IllegalAttributeException exc1) {
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

       
        JSONArray data = loadJSON("italy.json", "countries");
        JSONObject italy = (JSONObject) data.get(0);
        FeatureJSON json = new FeatureJSON();
        json.setFeatureType(CouchDBUtils.createFeatureType(italy, "countries"));
        Feature feature = json.readFeature(italy.toString());
       
        ContentFeatureStore featureStore = (ContentFeatureStore) store.getFeatureSource("gttestdb.countries");
        featureStore.addFeatures(Collections.singleton(feature));
       
        // single add case
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

        fj.writeFeature(feature, os);
       
        String json = os.toString();
       
        // here it would break because the written json was incorrect
        SimpleFeature feature2 = fj.readFeature(json);
        assertEquals(feature.getID(), feature2.getID());
    }
   
    public void testFeatureRead() throws Exception {
        SimpleFeature f1 = feature(1);
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

        /* Get the layer describing URL*/
        String jsonString = ods.resourceToString("data/" + contentEntry.getName().getLocalPart() + "/" + fnID, null);

        FeatureJSON fjson = new FeatureJSON();

        SimpleFeature feature = fjson.readFeature(new StringReader(SFSDataStoreUtil.strip(jsonString)));

        return feature;
    }

    /**
 
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

    public static void main(String[] args) throws Exception {
        String json = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[43.3599,-11.6515]},\"properties\": {},\"id\":\"null\"}]}";
        FeatureJSON fj = new FeatureJSON();
//        URL url = new URL("http://www.glews-test.net/eisurvtest/data/outbreakMarker?mode=features&bbox=-218.20632812500003%2C-85.6734453125%2C361.860109375%2C116.8704140625&limit=1");
//        InputStream is = url.openStream();
        System.out.println(fj.readFeature(json));
    }
}
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

    @Override
    protected SimpleFeatureType buildFeatureType() throws IOException {
        FeatureJSON fjson = new FeatureJSON();
        InputStream in = new URL(url.toString() + "?limit=1").openStream();
        SimpleFeature feature = fjson.readFeature(new StringReader(streamToString(in)));
        return feature.getFeatureType();
    }

    // Added methods:
View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

    /* Test feature flipping with point geometry*/
    public void testFeatureFlippingWithPointGeom() throws IOException {
        FeatureJSON fjson = new FeatureJSON();

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

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

        SFSDataStoreUtil.flipFeatureYX(fnG);

View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

    /* Test feature flipping with LineString geometry*/
    public void testFeatureFlippingWithLineStringGeom() throws IOException {
        FeatureJSON fjson = new FeatureJSON();

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

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

        SFSDataStoreUtil.flipFeatureYX(fnG);

View Full Code Here

Examples of org.geotools.geojson.feature.FeatureJSON.readFeature()

    /* Test feature flipping with Polygon w/o holes geometry*/
    public void testFeatureFlippingWithPolygonNoHolesGeom() throws IOException {
        FeatureJSON fjson = new FeatureJSON();

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

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

        SFSDataStoreUtil.flipFeatureYX(fnG);

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.