336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


import java.io.File;

import org.geotools.data.DataStoreFinder;
import org.geotools.data.FeatureSource;
import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore;

public class LoaderShapeFile extends Loader{

 private String filename = null;
 private File file;
 private String tablename = null;
 
 public LoaderShapeFile(String filename)
 {
  this.filename = filename;
  file = new File(filename);
    
  try{
   params.put( "url", file.toURI().toURL() );
  }catch(Exception e){e.printStackTrace();}
   
 }
 
 public void setTableName(String tablename)
 {
  this.tablename = tablename;
 }
 
 public FeatureSource loadFeatureSource()
 {
  try{
   store = DataStoreFinder.getDataStore(params);
   
   System.out.println("table: " +store.getTypeNames()[0]);
   
   source = store.getFeatureSource(store.getTypeNames()[0]);
  }catch(Exception e){e.printStackTrace();}
  
  return source;
 }
}

+ Recent posts