diff --git a/src/osm/jp/coverage/busstop/ToCartoCSV.java b/src/osm/jp/coverage/busstop/ToCartoCSV.java index 6fa9f1e..834c2e0 100644 --- a/src/osm/jp/coverage/busstop/ToCartoCSV.java +++ b/src/osm/jp/coverage/busstop/ToCartoCSV.java @@ -38,18 +38,18 @@ try (BufferedWriter ow = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(csvFile), "UTF-8"))) { Connection con = DatabaseTool.openDb("postgis"); // CSV header - System.out.println("score,lon,lat"); - ow.write("score,lon,lat"); - PreparedStatement ps8 = con.prepareStatement("SELECT name,ST_X(ST_TRANSFORM(geom,4612)) as lon, ST_Y(ST_TRANSFORM(geom,4612)) as lat,fixed FROM t_busstop"); + System.out.println("gid,geom,score"); + ow.write("gid,geom,score"); + ow.newLine(); + PreparedStatement ps8 = con.prepareStatement("SELECT gid,geom,fixed FROM t_busstop"); try (ResultSet rset8 = ps8.executeQuery()) { while (rset8.next()) { - //String name = rset8.getString("name"); - Double lat = rset8.getDouble("lat"); - Double lon = rset8.getDouble("lon"); + String gid = rset8.getString("gid"); + String geom = rset8.getString("geom"); int score = rset8.getInt("fixed"); String osm_node; - osm_node = ""+ score +",\""+ Double.toString(lon) +"\",\""+ Double.toString(lat) +"\""; + osm_node = ""+ gid +","+ geom +","+ score +""; System.out.println(osm_node); ow.write(osm_node); ow.newLine();