package osm.jp.coverage.police; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; import jp.co.areaweb.tools.database.DatabaseTool; import osm.jp.postgis.CoverageAll; /** * 国土数値情報 警察署データ(平成24年:2012) * code = 派出所 * @author yuu */ public class Coverage6 { public static void main(String[] args) throws FileNotFoundException, ClassNotFoundException, SQLException, IOException, ParserConfigurationException, SAXException, TransformerException { File dir = new File("GML_POLICE"); File outputFileCsv = new File(dir, "coverage.police6.csv"); File outputFileJson = new File(dir, "coverage.police6.json"); CoverageAll obj = new CoverageAll(); obj.setTablename(DbPolice.TABLE_NAME); obj.setData(new ArrayList<>()); Connection conPost = DatabaseTool.openDb("postgis"); Connection conHsql = DatabaseTool.openDb("database"); try { obj.load(conPost, conHsql, DbPolice.TABLE_NAME, "code=6"); obj.outputCSV(outputFileCsv); obj.outputJson(outputFileJson, "国土数値情報 警察署データ(平成24年:2012)6:派出所"); } finally { DatabaseTool.closeDb(conHsql); DatabaseTool.closeDb(conPost); } } public Coverage6() throws ClassNotFoundException, SQLException, IOException { super(); } }