Package chunmap.data.provider.shp

Examples of chunmap.data.provider.shp.ShpDataSource


*
*/
public class LayerFactory {
  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


        pDR.close();
        return new VectorLayer(fc);
    }
    public static VectorLayer openShapeFile(String path, final int labelColum)
    {
      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

TOP

Related Classes of chunmap.data.provider.shp.ShpDataSource

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.