Newer
Older
osmCoverage / src / osm / jp / coverage / police / ExportCSV.java
@hayashi hayashi on 7 Jul 2018 1 KB export csv file
package osm.jp.coverage.police;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import osm.jp.postgis.PostgisItem;
import osm.jp.postgis.PostgisItems;

public class ExportCSV {
    public static String tableName;
    public static String CSV_FILE_NAME = "t_police.csv";
    
    public static void main (String[] argv) throws ClassNotFoundException, SQLException, IOException, FileNotFoundException, ParserConfigurationException, SAXException {
        
        PostgisItems items = new PostgisItems();
        items.add(new PostgisItem("gmlid", "idref"));
        items.add(new PostgisItem("area", "area"));
        items.add(new PostgisItem("code", "code"));
        items.add(new PostgisItem("fixed", "fixed1"));
        items.add(new PostgisItem("lat", "lat"));
        items.add(new PostgisItem("lon", "lon"));

        ToPostgis model = new ToPostgis();
        model.items = items;
        model.toCsv(new File(CSV_FILE_NAME));
    }
}