diff --git a/src/coverage_BUSSTOP.sh b/src/coverage_BUSSTOP.sh index 7eb4d4d..7facd50 100755 --- a/src/coverage_BUSSTOP.sh +++ b/src/coverage_BUSSTOP.sh @@ -17,6 +17,7 @@ git commit -a -m "coverage update BUSSTOP $(date +%Y-%m-%d_%H:%M)" cp coverage.busstop.json ../www-root/coverage +# cp busstop.carto.csv ../www-root/coverage cd ../www-root git add . git commit -a -m "coverage busstop update $(date +%Y-%m-%d_%H:%M)" diff --git a/src/osm/jp/coverage/fuel/ToCartoCSV.java b/src/osm/jp/coverage/fuel/ToCartoCSV.java index 0e17afb..d47dd33 100644 --- a/src/osm/jp/coverage/fuel/ToCartoCSV.java +++ b/src/osm/jp/coverage/fuel/ToCartoCSV.java @@ -22,31 +22,31 @@ * */ public class ToCartoCSV { - public static final String CSV_FILE_NAME = "t_fuel"; + public static final String CSV_FILE_NAME = "t_fuel.carto.csv"; public static void main (String[] argv) throws Exception { outputDb(DatabaseTool.openDb("postgis")); } public static void outputDb(Connection con) throws Exception { - File csvFile = new File(CSV_FILE_NAME+".csv"); + File csvFile = new File(CSV_FILE_NAME); try (BufferedWriter ow = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(csvFile), "UTF-8"))) { - System.out.println("idref,score,lon,lat"); - ow.write("idref,score,lon,lat"); + String line = "idref,score,geom"; + System.out.println(line); + ow.write(line); ow.newLine(); - PreparedStatement ps8 = con.prepareStatement("SELECT idref,ST_X(ST_TRANSFORM(geom,4612)) as lon, ST_Y(ST_TRANSFORM(geom,4612)) as lat,fixed FROM t_fuel"); + PreparedStatement ps8 = con.prepareStatement("SELECT idref,geom,fixed FROM t_fuel"); try (ResultSet rset8 = ps8.executeQuery()) { while (rset8.next()) { String idref = rset8.getString("idref"); - Double lat = rset8.getDouble("lat"); - Double lon = rset8.getDouble("lon"); + String geom = rset8.getString("geom"); int score = rset8.getInt("fixed"); + score = (score > 1 ? 2 : score); - String osm_node; - osm_node = "\""+ idref +"\",\""+ score +"\",\""+ Double.toString(lon) +"\",\""+ Double.toString(lat) +"\""; - System.out.println(osm_node); - ow.write(osm_node); + line = ""+ idref +","+ score +","+ geom +""; + System.out.println(line); + ow.write(line); ow.newLine(); } }