diff --git a/src/osmCoverage.style b/src/osmCoverage.style index cdb166c..c75ee45 100644 --- a/src/osmCoverage.style +++ b/src/osmCoverage.style @@ -81,13 +81,13 @@ # end up in the tags hstore column regardless of the style file. # OsmType Tag DataType Flags -node,way access text linear -node,way addr:housename text linear -node,way addr:housenumber text linear -node,way addr:interpolation text linear -node,way admin_level text linear -node,way aerialway text linear -node,way aeroway text polygon +#node,way access text linear +#node,way addr:housename text linear +#node,way addr:housenumber text linear +#node,way addr:interpolation text linear +#node,way admin_level text linear +#node,way aerialway text linear +#node,way aeroway text polygon node,way amenity text polygon node,way abandoned:amenity text linear node,way demolished:amenity text linear @@ -96,88 +96,87 @@ node,way historic:amenity text linear node,way no:amenity text linear node,way was:amenity text linear -node,way area text polygon # hard coded support for area=1/yes => polygon is in osm2pgsql -node,way barrier text linear -node,way bicycle text linear +#node,way area text polygon # hard coded support for area=1/yes => polygon is in osm2pgsql +#node,way barrier text linear +#node,way bicycle text linear node,way brand text linear -node,way bridge text linear -node,way boundary text linear -node,way building text polygon +#node,way bridge text linear +#node,way boundary text linear +#node,way building text polygon node,way bus text linear -node capital text linear -node,way construction text linear -node,way covered text linear -node,way culvert text linear -node,way cutting text linear +#node capital text linear +#node,way construction text linear +#node,way covered text linear +#node,way culvert text linear +#node,way cutting text linear node,way denomination text linear node,way disused text linear -node ele text linear -node,way embankment text linear +#node ele text linear +#node,way embankment text linear node,way fixme text linear -node,way foot text linear -node,way generator:source text linear -node,way harbour text polygon -node,way highway text linear -node,way abandoned:highway text linear -node,way demolished:highway text linear -node,way disused:highway text linear -node,way removed:highway text linear -node,way historic:highway text linear -node,way no:highway text linear -node,way historic text polygon -node,way horse text linear -node,way intermittent text linear -node,way junction text linear -node,way landuse text polygon -node,way layer text linear -node,way leisure text polygon -node,way lock text linear +#node,way foot text linear +#node,way generator:source text linear +#node,way harbour text polygon +node highway text linear +node abandoned:highway text linear +node demolished:highway text linear +node disused:highway text linear +node removed:highway text linear +node no:highway text linear +#node,way historic text polygon +#node,way horse text linear +#node,way intermittent text linear +#node,way junction text linear +#node,way landuse text polygon +#node,way layer text linear +#node,way leisure text polygon +#node,way lock text linear node,way man_made text polygon -node,way military text polygon -node,way motorcar text linear +#node,way military text polygon +#node,way motorcar text linear node,way name text linear node,way natural text polygon # natural=coastline tags are discarded by a hard coded rule in osm2pgsql -node,way office text polygon -node,way oneway text linear -node,way operator text linear -node,way place text polygon -node,way population text linear -node,way power text polygon -node,way power_source text linear -node,way public_transport text polygon -node,way disused:public_transport text polygon -node,way abandoned:public_transport text polygon -node,way removed:public_transport text polygon -node,way no:public_transport text polygon -node,way railway text linear -node,way ref text linear -node,way religion text linear -node,way route text linear -node,way service text linear -node,way shop text polygon -node,way sport text polygon -node,way surface text linear -node,way toll text linear -node,way tourism text polygon -node,way tower:type text linear -way tracktype text linear -node,way tunnel text linear -node,way water text polygon -node,way waterway text polygon -node,way wetland text polygon -node,way width text linear -node,way wood text linear -node,way z_order int4 linear # This is calculated during import -way way_area real linear # This is calculated during import +#node,way office text polygon +#node,way oneway text linear +#node,way operator text linear +#node,way place text polygon +#node,way population text linear +#node,way power text polygon +#node,way power_source text linear +node public_transport text linear +node disused:public_transport text linear +node abandoned:public_transport text linear +node demolished:public_transport text linear +node no:public_transport text linear +#node,way railway text linear +#node,way ref text linear +#node,way religion text linear +#node,way route text linear +#node,way service text linear +#node,way shop text polygon +#node,way sport text polygon +#node,way surface text linear +#node,way toll text linear +#node,way tourism text polygon +#node,way tower:type text linear +#way tracktype text linear +#node,way tunnel text linear +#node,way water text polygon +#node,way waterway text polygon +#node,way wetland text polygon +#node,way width text linear +#node,way wood text linear +#node,way z_order int4 linear # This is calculated during import +#way way_area real linear # This is calculated during import # Area tags # We don't make columns for these tags, but objects with them are areas. # Mainly for use with hstore -way abandoned:aeroway text polygon,nocolumn -way abandoned:building text polygon,nocolumn -way abandoned:landuse text polygon,nocolumn -way abandoned:power text polygon,nocolumn -way area:highway text polygon,nocolumn +#way abandoned:aeroway text polygon,nocolumn +#way abandoned:building text polygon,nocolumn +#way abandoned:landuse text polygon,nocolumn +#way abandoned:power text polygon,nocolumn +#way area:highway text polygon,nocolumn # Deleted tags # These are tags that are generally regarded as useless for most rendering. diff --git a/test/osm/jp/coverage/busstop/AllCheck.java b/test/osm/jp/coverage/busstop/AllCheck.java new file mode 100644 index 0000000..91ebc72 --- /dev/null +++ b/test/osm/jp/coverage/busstop/AllCheck.java @@ -0,0 +1,36 @@ +package osm.jp.coverage.busstop; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + DbBusstopCheck.class, + DbExistBusstopTest.class, + BusstopTest.class, + ToPostgisTest.class, + CoverageTest.class +}) +public class AllCheck { + + @BeforeClass + public static void setUpClass() throws Exception { + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + } + + @After + public void tearDown() throws Exception { + } + +} diff --git a/test/osm/jp/coverage/busstop/DbBusstopCheck.java b/test/osm/jp/coverage/busstop/DbBusstopCheck.java index 180bf9f..f3c16ef 100644 --- a/test/osm/jp/coverage/busstop/DbBusstopCheck.java +++ b/test/osm/jp/coverage/busstop/DbBusstopCheck.java @@ -1,6 +1,5 @@ package osm.jp.coverage.busstop; -import hayashi.tools.files.DeleteDir; import java.io.File; import java.sql.Connection; import jp.co.areaweb.tools.database.DatabaseTool; @@ -14,7 +13,6 @@ import org.junit.runners.MethodSorters; import osm.jp.api.Coverage; import osm.jp.coverage.DbTest; -import tools.Copy; @FixMethodOrder (MethodSorters.NAME_ASCENDING) public class DbBusstopCheck extends DbTest { @@ -35,22 +33,11 @@ @BeforeClass public static void setUpClass() throws Exception { DbTest.gmlFolderName = gmlFolderName; - DbTest.setUpClass(); - - Copy.copyFile( - new File("data", REMOVED_FILE_NAME), - new File(gmlFolderName, REMOVED_FILE_NAME) - ); } @AfterClass public static void tearDownClass() throws Exception { DbTest.gmlFolderName = gmlFolderName; - DbTest.tearDownClass(); - File file = new File(REMOVED_FILE_NAME); - if (file.exists()) { - DeleteDir.delete(file); - } } /** @@ -59,7 +46,7 @@ * @throws Exception */ @Test - public void t10_main_init() throws Exception { + public void c10_main_init() throws Exception { DbTest.checkDatabase(databaseName); try (Connection hsqldb = DatabaseTool.openDb(databaseName)) { assertThat(DbTest.isTable(hsqldb, tableName), is(true)); @@ -76,7 +63,7 @@ * @throws Exception */ @Test - public void t25_main_import() throws Exception { + public void c25_main_import() throws Exception { try (Connection hsqldb = DatabaseTool.openDb(databaseName)) { int cnt = DbTest.getRecordCount(hsqldb, tableName); System.out.println("'"+ tableName +"' table count = " + cnt); @@ -98,15 +85,31 @@ */ @Test public void t30_main_removed() throws Exception { - File file = new File(gmlFolderName, REMOVED_FILE_NAME); - if (!file.exists()) { - Copy.copyFile(new File("data",REMOVED_FILE_NAME), file); // Apache common-io - } - int tableCount; try (Connection hsqldb = DatabaseTool.openDb(databaseName)) { tableCount = DbTest.getRecordCount(hsqldb, tableName, "REMOVED=TRUE"); - System.out.println("'FUEL REMOVED=TRUE' table count = " + tableCount); + System.out.println("'BUSSTOP REMOVED=TRUE' table count = " + tableCount); + assertThat(tableCount >= REMOVED_COUNT, is(true)); + } + catch (Exception e) { + fail(e.toString()); + } + } + + /** + * (31)DISUSEDなPOIを読み込む + * ノード: 6187422333 + * 場所: 35.3973238, 139.4108981 + * demolished:public_transport=platform + * + * @throws Exception + */ + @Test + public void t31_main_removed() throws Exception { + int tableCount; + try (Connection hsqldb = DatabaseTool.openDb(databaseName)) { + tableCount = DbTest.getRecordCount(hsqldb, tableName, "REMOVED=TRUE"); + System.out.println("'BUSSTOP REMOVED=TRUE' table count = " + tableCount); assertThat(tableCount >= REMOVED_COUNT, is(true)); } catch (Exception e) { diff --git a/test/osm/jp/coverage/busstop/DbExistBusstopCheck.java b/test/osm/jp/coverage/busstop/DbExistBusstopCheck.java index b4f2a13..bd30a19 100644 --- a/test/osm/jp/coverage/busstop/DbExistBusstopCheck.java +++ b/test/osm/jp/coverage/busstop/DbExistBusstopCheck.java @@ -38,10 +38,9 @@ /** * (2)GMLファイルを読み取る(国土数値情報の読み取り) * - * @throws Exception */ @Test - public void t21_main_import() { + public void c21_main_import() { try (Connection hsqldb = DatabaseTool.openDb(databaseName)) { int cnt = DbTest.getRecordCount(hsqldb, tableName); System.out.println("'BUSSTOP' table count = " + cnt); @@ -173,6 +172,20 @@ fail(); } } + + // ノード: (6187422333) demolished:public_transport=platform + // 場所: 35.3973238, 139.4108981 + // demolished:public_transport=platform + ps1 = hsqldb.prepareStatement(sql + "idref='6187422333'"); + try (ResultSet rset1 = ps1.executeQuery()) { + if (rset1.next()) { + assertThat(rset1.getInt("score"), is(50)); + assertThat(rset1.getBoolean("removed"), is(true)); + } + else { + fail(); + } + } } catch (Exception e) { fail(e.toString());