diff --git a/src/coverage_PoliceGet.sh b/src/coverage_PoliceGet.sh new file mode 100644 index 0000000..b8f3e60 --- /dev/null +++ b/src/coverage_PoliceGet.sh @@ -0,0 +1,60 @@ +# 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_POLICE/P18-12-??.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.police.DbPolice +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.DbExist +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.Police +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.ToPostgis + + + +# +# +# osmCoverage_PoliceJson +# + +## 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.police.Coverage2 +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.Coverage4 +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.Coverage5 +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.ToGeoJSON + +ls -l +rm -rf vtile +mkdir -m +w vtile +cp ./GML_POLICE/police?.json vtile +tar czvf policeJSON.tgz vtile/*.json + +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.ToGeoJSON -slim + +tar czvf coverage.postofficeJSON.tgz ./GML_POLICE/*.json ./GML_POLICE/*.csv + +git add GML_POLICE/*.json +git commit --allow-empty -m "coverage police update $(date +%Y-%m-%d_%H:%M)" +git remote -v +git push gitbucket master + + +# +# +# osmCoverage_PostofficeTile +# diff --git a/src/coverage_PoliceJson.sh b/src/coverage_PoliceJson.sh new file mode 100644 index 0000000..4436825 --- /dev/null +++ b/src/coverage_PoliceJson.sh @@ -0,0 +1,42 @@ +### dummy +pwd + +curl --user yuu:yuu8844 -O http://surveyor.mydns.jp/gitbucket/yuu/osmCoverage/raw/master/lib/hsqldb_2.2.9.jar +curl --user yuu:yuu8844 -O http://surveyor.mydns.jp/gitbucket/yuu/osmCoverage/raw/master/lib/postgresql-9.4.1212.jar +curl --user yuu:yuu8844 -O http://localhost:8080/job/hayashiLib/lastSuccessfulBuild/artifact/dist/hayashi.jar +curl --user yuu:yuu8844 -O http://localhost:8080/job/osmCoverage/lastSuccessfulBuild/artifact/osmCoverage.jar + +mkdir GML_POLICE +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.ToGeoJSON + +ls -l +rm -rf vtile +mkdir -m +w vtile +cp ./GML_POLICE/police?.json vtile +tar czvf policeJSON.tgz vtile/*.json + +### export from PostGIS +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.ToGeoJSON -slim + +# output file "coverage.police2.csv" and "coverage.police2.json" +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.Coverage2 + +# output file "coverage.police4.csv" and "coverage.police4.json" +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.Coverage4 + +# output file "coverage.police5.csv" and "coverage.police5.json" +java -cp .:osmCoverage.jar:hayashi.jar:hsqldb_2.2.9.jar:postgresql-9.4.1212.jar osm.jp.coverage.police.Coverage5 + + +ls -l +tar czvf coverage.policeJSON.tgz GML_POLICE/*.json GML_POLICE/*.csv + +git config --global user.name "hayashi" +git config --global user.email hayashi.yuu@gmail.com +git add *.json +git add GML_POLICE/*.json +git commit --allow-empty -m "coverage police update $(date +%Y-%m-%d_%H:%M)" + +git remote -v +#git push gitbucket HEAD:master + diff --git a/src/coverage_PoliceTile.sh b/src/coverage_PoliceTile.sh new file mode 100644 index 0000000..405d9ed --- /dev/null +++ b/src/coverage_PoliceTile.sh @@ -0,0 +1,15 @@ +curl --user yuu:yuu8844 -O http://surveyor.mydns.jp/gitbucket/yuu/osmCoverage/raw/master/src/coverage_POLICE_after.sh +chmod +x *.sh +cat coverage_POLICE_after.sh +./coverage_POLICE_after.sh + +ls -l +cp pbfDate.json GML_POLICE/tileDate.json + +git config --global user.name "hayashi" +git config --global user.email hayashi.yuu@gmail.com +git add GML_POLICE/tileDate.json +git add *.json +git commit --allow-empty -m "Police tile created $(date +%Y-%m-%d_%H:%M)" + +git remote -v diff --git a/src/osm/jp/coverage/police/ToGeoJSON.java b/src/osm/jp/coverage/police/ToGeoJSON.java index 871057a..04fdcc6 100644 --- a/src/osm/jp/coverage/police/ToGeoJSON.java +++ b/src/osm/jp/coverage/police/ToGeoJSON.java @@ -33,8 +33,12 @@ Connection con = DatabaseTool.openDb("postgis"); try { obj.outputDb(con, "", new File(dir, "police.json"), false); - obj.outputDb(con, "WHERE fixed=0", new File(dir, "police0.json"), slim); - obj.outputDb(con, "WHERE fixed>0", new File(dir, "police1.json"), slim); + obj.outputDb(con, "WHERE fixed=0 and code=2", new File(dir, "police2z.json"), slim); + obj.outputDb(con, "WHERE fixed>0 and code=2", new File(dir, "police2.json"), slim); + obj.outputDb(con, "WHERE fixed=0 and code=4", new File(dir, "police4z.json"), slim); + obj.outputDb(con, "WHERE fixed>0 and code=4", new File(dir, "police4.json"), slim); + obj.outputDb(con, "WHERE fixed=0 and code=5", new File(dir, "police5z.json"), slim); + obj.outputDb(con, "WHERE fixed>0 and code=5", new File(dir, "police5.json"), slim); } finally { DatabaseTool.closeDb(con); diff --git a/test/osm/jp/coverage/police/AllTest.java b/test/osm/jp/coverage/police/AllTest.java index 7290e24..452b3bb 100644 --- a/test/osm/jp/coverage/police/AllTest.java +++ b/test/osm/jp/coverage/police/AllTest.java @@ -14,6 +14,7 @@ DbExistTest.class, PoliceTest.class, ToPostgisTest.class, + ToGeoJSONTest.class, Coverage2Test.class, Coverage4Test.class, Coverage5Test.class diff --git a/test/osm/jp/coverage/police/Coverage2Test.java b/test/osm/jp/coverage/police/Coverage2Test.java index 01e8dbd..f3694a4 100644 --- a/test/osm/jp/coverage/police/Coverage2Test.java +++ b/test/osm/jp/coverage/police/Coverage2Test.java @@ -16,8 +16,8 @@ @Test public void testMain() { + System.out.println("Coverage2Test"); try { - System.out.println("main"); String[] args = new String[0]; Coverage2.main(args); } diff --git a/test/osm/jp/coverage/police/ToGeoJSONTest.java b/test/osm/jp/coverage/police/ToGeoJSONTest.java new file mode 100644 index 0000000..bdf485b --- /dev/null +++ b/test/osm/jp/coverage/police/ToGeoJSONTest.java @@ -0,0 +1,23 @@ +package osm.jp.coverage.police; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class ToGeoJSONTest { + + public ToGeoJSONTest() { + } + + @Test + public void testMain() { + System.out.println("ToGeoJSONTest"); + try { + String[] args = new String[]{"-slim"}; + ToGeoJSON.main(args); + } + catch (Exception e) { + fail("The test case is a prototype."); + } + } + +}