Examples of FeatureCollection


Examples of chunmap.data.feature.FeatureCollection

  public static VectorLayer openShapeFile(String path)
    {
    ShpDataSource pDR = new ShpDataSource(path);
        GeoDataAdapter pDA = new GeoDataAdapter(pDR);

        FeatureCollection fc = pDA.createFeatureList();
        pDR.close();
        return new VectorLayer(fc);
    }
View Full Code Here

Examples of chunmap.data.feature.FeatureCollection

    {
      final ShpDataSource pDR = new ShpDataSource(path,Charset.forName("GBK"));
      //System.out.print(Charset.defaultCharset());
        GeoDataAdapter pDA = new GeoDataAdapter(pDR);

        FeatureCollection fc = pDA.createFeatureList();
        fc.each(new VisitAction(){
      @Override
      public void execute(Feature obj) {
        ShapeFeature shp = (ShapeFeature)obj;
        Object[] data=pDR.data(shp.getId());
        shp.setValues(data);
              String s = data[labelColum].toString();
              shp.setLabel(s);
      }});
        fc.setFeatureSchama(pDR.getFeatureSchama());
        pDR.close();
        return new VectorLayer(fc);
    }
View Full Code Here

Examples of chunmap.data.feature.FeatureCollection

    public static VectorLayer createGeometryLayer(List<Geometry> gs)
    {
        if (gs.size() == 0) return null;

        FeatureCollection fc = new FeatureList();
        EnvelopeBuf eb = new EnvelopeBuf();
        for(Geometry g : gs){
          ShapeFeature f = createFeature(g);
            fc.insert(f);
            f.setFeatureClass(fc);
            eb.mergeEnvelop(g.getEnvelop());
        }

        fc.setMetadata( new LayerMetadata("Geometry",gs.get(0).getGeometryType()));
        fc.setEnvelope(eb.toEnvelop());

        return new VectorLayer(fc);
    }
View Full Code Here

Examples of chunmap.data.feature.FeatureCollection

        return featureClass;
    }
    public FeatureCollection createQuartTree()
    {
        Envelope allEnvelope = dataResources.getEnvelop();
        FeatureCollection featureClass = new QuartTree(allEnvelope);
        initFeatureCollection(featureClass);
        return featureClass;
    }
View Full Code Here

Examples of com.simplegeo.client.types.FeatureCollection

      String jsonString = client.search(lat, lon, params);
      JSONObject json = new JSONObject(jsonString);
     
      Assert.assertNotNull(json);
     
      FeatureCollection collection = FeatureCollection.fromJSON(json);
     
      Assert.assertNotNull(collection);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    } catch (JSONException e) {
View Full Code Here

Examples of com.simplegeo.client.types.FeatureCollection

      String jsonString = client.search("salad dressing", params);
      JSONObject json = new JSONObject(jsonString);
     
      Assert.assertNotNull(json);
     
      FeatureCollection collection = FeatureCollection.fromJSON(json);
     
      Assert.assertNotNull(collection);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    } catch (JSONException e) {
View Full Code Here

Examples of com.simplegeo.client.types.FeatureCollection

      String jsonString = client.searchByAddress(address, params);
      JSONObject json = new JSONObject(jsonString);
     
      Assert.assertNotNull(json);
     
      FeatureCollection collection = FeatureCollection.fromJSON(json);
     
      Assert.assertNotNull(collection);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    } catch (JSONException e) {
View Full Code Here

Examples of com.simplegeo.client.types.FeatureCollection

  public void testSearchSync() {
    try {
      HashMap<String, String[]> params = new HashMap<String, String[]>();
      params.put("limit", new String[] {"10"});
      String jsonString = client.search(37.761809d, -122.422832d, "casey.testing.layer", params);
      FeatureCollection featureCollection = FeatureCollection.fromJSONString(jsonString);
     
      Assert.assertNotNull(featureCollection.getFeatures());
    } catch (IOException e) {
      Assert.fail(e.getMessage());     
    } catch (JSONException e) {
      Assert.fail(e.getMessage());     
    }
View Full Code Here

Examples of com.simplegeo.client.types.FeatureCollection

  public void testSearchByAddressSync() {
    try {
      HashMap<String, String[]> params = new HashMap<String, String[]>();
      params.put("limit", new String[] {"10"});
      String jsonString = client.searchByAddress("41 decatur st, san francisco, ca", "casey.testing.layer", params);
      FeatureCollection featureCollection = FeatureCollection.fromJSONString(jsonString);
     
      Assert.assertNotNull(featureCollection.getFeatures());
    } catch (IOException e) {
      Assert.fail(e.getMessage());     
    } catch (JSONException e) {
      Assert.fail(e.getMessage());     
    }
View Full Code Here

Examples of com.simplegeo.client.types.FeatureCollection

 
  @Test
  public void testSearchByIPSync() {
    try {
      String jsonString = client.searchByIP("173.164.219.53", "casey.testing.layer", null);
      FeatureCollection featureCollection = FeatureCollection.fromJSONString(jsonString);
     
      Assert.assertNotNull(featureCollection.getFeatures());
    } catch (IOException e) {
      Assert.fail(e.getMessage());     
    } catch (JSONException e) {
      Assert.fail(e.getMessage());     
    }
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.