diff --git a/src/coverage_POSTOFFICE.sh b/src/coverage_POSTOFFICE.sh new file mode 100644 index 0000000..f3eb063 --- /dev/null +++ b/src/coverage_POSTOFFICE.sh @@ -0,0 +1,64 @@ +# dummy +cd /home/yuu/workspace/osmCoverageBin +pwd + +git config --global user.name "hayashi" +git config --global user.email hayashi.yuu@gmail.com +git fetch +git pull gitbucket master + +rm -rf GML_POSTOFFICE +mkdir GML_POSTOFFICE +cd GML_POSTOFFICE +curl --user yuu:yuu8844 -O http://surveyor.mydns.jp/coverage/GML_POSTOFFICE/P30-13.xml + +cd .. +pwd +curl --user yuu:yuu8844 -O http://localhost:8080/job/osmCoverage/lastSuccessfulBuild/artifact/osmCoverage.jar +cp ../hayashi/dist/hayashi.jar . + + +# make to PostGIS +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.postoffice.DbPostoffice +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.postoffice.DbExist +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.postoffice.Postoffice +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.postoffice.ToPostgis + + +#git add -f GML_FUEL/*.json GML_FUEL/*.csv t_fuel.carto.csv +#git commit -a -m "coverage fuel update $(date +%Y-%m-%d_%H:%M)" +#git push origin HEAD:master + + + +# +# +# osmCoverage_PostofficeJson +# + +## export from PostGIS to JSON +### export from PostGIS +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.postoffice.CoverageAll +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.postoffice.ToGeoJSON + +ls -l +rm -rf vtile +mkdir -m +w vtile +cp ./GML_POSTOFFICE/postoffice?.json vtile +tar czvf postofficeJSON.tgz vtile/*.json + +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.fuel.ToGeoJSON -slim + +tar czvf coverage.postofficeJSON.tgz ./GML_POSTOFFICE/*.json ./GML_POSTOFFICE/*.csv + +git add GML_POSTOFFICE/*.json +git commit --allow-empty -m "coverage postoffice update $(date +%Y-%m-%d_%H:%M)" + +git remote -v +git push gitbucket master + + +# +# +# osmCoverage_PostofficeTile +# diff --git a/src/osm/jp/coverage/postoffice/CoverageAll.java b/src/osm/jp/coverage/postoffice/CoverageAll.java index 2018c6f..8502837 100644 --- a/src/osm/jp/coverage/postoffice/CoverageAll.java +++ b/src/osm/jp/coverage/postoffice/CoverageAll.java @@ -16,8 +16,8 @@ public static void main(String[] args) throws FileNotFoundException, ClassNotFoundException, SQLException, IOException, ParserConfigurationException, SAXException, TransformerException { - File outputFileCsv = new File("coverage.postoffice.csv"); - File outputFileJson = new File("coverage.postoffice.json"); + File outputFileCsv = new File("GML_POSTOFFICE", "coverage.postoffice.csv"); + File outputFileJson = new File("GML_POSTOFFICE", "coverage.postoffice.json"); osm.jp.postgis.CoverageAll obj = new osm.jp.postgis.CoverageAll(DbPostoffice.TABLE_NAME); diff --git a/src/osm/jp/coverage/postoffice/ToGeoJSON.java b/src/osm/jp/coverage/postoffice/ToGeoJSON.java index 9941fc2..8be1a3b 100644 --- a/src/osm/jp/coverage/postoffice/ToGeoJSON.java +++ b/src/osm/jp/coverage/postoffice/ToGeoJSON.java @@ -28,12 +28,12 @@ } osm.jp.postgis.ToGeoJSON obj = new osm.jp.postgis.ToGeoJSON(DbPostoffice.TABLE_NAME); - Connection con = DatabaseTool.openDb("osmdb"); + Connection con = DatabaseTool.openDb("postgis"); try { - obj.outputDb(con, "", new File("postoffice.json"), false); - obj.outputDb(con, "WHERE fixed=0", new File("postoffice0.json"), slim); - obj.outputDb(con, "WHERE fixed>0 and fixed<50", new File("postoffice1.json"), slim); - obj.outputDb(con, "WHERE fixed>49", new File("postoffice2.json"), slim); + obj.outputDb(con, "", new File("GML_POSTOFFICE", "postoffice.json"), false); + obj.outputDb(con, "WHERE fixed=0", new File("GML_POSTOFFICE", "postoffice0.json"), slim); + obj.outputDb(con, "WHERE fixed>0 and fixed<50", new File("GML_POSTOFFICE", "postoffice1.json"), slim); + obj.outputDb(con, "WHERE fixed>49", new File("GML_POSTOFFICE", "postoffice2.json"), slim); } finally { DatabaseTool.closeDb(con); diff --git a/src/osm/jp/postgis/ToGeoJSON.java b/src/osm/jp/postgis/ToGeoJSON.java index 7fdc7ea..b183d0e 100644 --- a/src/osm/jp/postgis/ToGeoJSON.java +++ b/src/osm/jp/postgis/ToGeoJSON.java @@ -54,13 +54,6 @@ public void outputDb(Connection con, String whereStr, File outputFile, boolean slim) throws Exception { try (BufferedWriter ow = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"))) { - String line = "{" + - "\"type\": \"FeatureCollection\"," + - "\"features\": ["; - System.out.println(line); - ow.write(line); - ow.newLine(); - String sql = "SELECT row_to_json(feature) FROM (" + "select 'Feature' As type, " + "ST_AsGeoJSON(ST_Transform(t_"+ this.tableName +".geom,4326))::json As geometry, row_to_json((" @@ -70,6 +63,15 @@ sql = "SELECT row_to_json(feature) FROM (" + "select 'Feature' As type, ST_AsGeoJSON(ST_Transform(t_"+ this.tableName +".geom,4326))::json As geometry From t_"+ this.tableName +" "+ whereStr +" order by area,idref) As feature"; } + System.out.println(sql); + + String line = "{" + + "\"type\": \"FeatureCollection\"," + + "\"features\": ["; + System.out.println(line); + ow.write(line); + ow.newLine(); + PreparedStatement ps8 = con.prepareStatement(sql); try (ResultSet rset8 = ps8.executeQuery()) { boolean top = true; diff --git a/src/postoffice.activity.violet.html b/src/postoffice.activity.violet.html index 5c040a4..9c45868 100644 --- a/src/postoffice.activity.violet.html +++ b/src/postoffice.activity.violet.html @@ -181,25 +181,21 @@ - 国土数値情報:燃料給油所 + 国土数値情報郵便局データ +./GML_POSTOFFICE/P30-13.xml - - 255 - 228 - 181 - 255 - + - - - - + + + + 1 - - OpenStreatMap + + POSTGIS.osmdb (OpenStreatMap) node/area: amenity=post_office node/area: disused:amenity=post_office node/area: abandoned:amenity=post_office @@ -211,325 +207,326 @@ - - - - + + + + 1 - - - - + + + + 1 - - - - + + + + 1 - + Postoffice.main() HSQL_DB.OSM_EXITのscoreを集計して、 HSQL_DB.POSTOFFICEのfixedに反映させる - - - - + + + + 1 - + update (fixed) - - - - + + + + 1 - - - - + + + + 1 - + [POSTGIS] t_POSTOFFICE - - - - + + + + 1 - - - - + + + + 1 - - - - + + + + 1 - + ToPostgis.main() HSQLDB.POSTOFFICEの結果を POSTGIS.t_POSTOFFICEへ反映させる - - - - + + + + 1 - + Insert or Update - - - - + + + + 1 - - - - + + + + 1 - + 255 255 255 255 - + 0 0 0 255 - + - - - - + + + + 1 - + 255 255 255 255 - + 0 0 0 255 - + - - - - + + + + 1 - - - + + + - - - - + + + + 1 - + 255 255 255 255 - + 0 0 0 255 - - + + CoverageAll.main() - - - - + + + + 1 - + 255 255 255 255 - + 0 0 0 255 - + - - - - + + + + 1 - - - + + + - - - - + + + + 1 - - - - - coverage.postoffice.csv -coverage.postoffice.json + + + + + ./GML_POSTOFFICE/ + coverage.postoffice.csv + coverage.postoffice.json - - - - + + + + 1 - + 255 255 255 255 - + 0 0 0 255 - + - - - - + + + + 1 - + 255 255 255 255 - + 0 0 0 255 - - + + ToGeoJSON.main() - - - - + + + + 1 - - - - - // GeoJSON -postoffice.json -postoffice0.json -postoffice1.json -postoffice2.json + + + + + ./GML_POSTOFFICE/ + postoffice.json + postoffice0.json + postoffice1.json + postoffice2.json - - - - + + + + 1 - + 255 255 255 255 - + 0 0 0 255 - + - - + + - - - - + + + + 1 @@ -538,13 +535,13 @@ - + - - - - + + + + 1 @@ -553,13 +550,13 @@ - + - - - - + + + + 1 @@ -568,13 +565,13 @@ - + - - - - + + + + 1 @@ -583,13 +580,13 @@ - + - - - - + + + + 1 @@ -598,13 +595,13 @@ - + - - - - + + + + 1 @@ -613,13 +610,13 @@ - + - - - - + + + + 1 @@ -628,13 +625,13 @@ - + - - - - + + + + 1 @@ -643,22 +640,22 @@ - - + + - - - - + + + + 1 - - - - - - - + + + + + + + 1 @@ -667,13 +664,13 @@ - - - - - - - + + + + + + + 1 @@ -682,22 +679,22 @@ - + - - - - - + + + + + 1 - - - - - - - + + + + + + + 1 @@ -706,22 +703,22 @@ - + - - - - - + + + + + 1 - - - - - - - + + + + + + + 1 @@ -730,13 +727,13 @@ - - - - - - - + + + + + + + 1 @@ -745,13 +742,13 @@ - - - - - - - + + + + + + + 1 @@ -760,13 +757,13 @@ - + - - - - + + + + 1 @@ -775,13 +772,13 @@ - + - - - - + + + + 1 @@ -790,13 +787,13 @@ - - - - - - - + + + + + + + 1 @@ -805,13 +802,13 @@ - - + + - - - - + + + + 1 @@ -820,13 +817,13 @@ - - - - - - - + + + + + + + 1 @@ -835,13 +832,13 @@ - - - - - - - + + + + + + + 1 @@ -850,13 +847,13 @@ - - - - - - - + + + + + + + 1 @@ -865,31 +862,31 @@ - - - - - - - + + + + + + + 1 - + - - - - + + + + 1 - - - - - - - + + + + + + + 1 @@ -898,22 +895,22 @@ - - - - - - - + + + + + + + 1 - - - - - - - + + + + + + + 1 @@ -922,13 +919,13 @@ - - - - - - - + + + + + + + 1 @@ -941,1276 +938,1307 @@ ]]>

- embedded diagram image + embedded diagram image \ No newline at end of file