diff --git a/src/osm/jp/postgis/UnMapped.java b/src/osm/jp/postgis/UnMapped.java index 93aadcc..87c6d80 100644 --- a/src/osm/jp/postgis/UnMapped.java +++ b/src/osm/jp/postgis/UnMapped.java @@ -30,6 +30,7 @@ public class UnMapped { ToPostgis type; String dbname; + public static final int MAX_DATA_COUNT = 300; @SuppressWarnings({"UseSpecificCatch", "CallToPrintStackTrace"}) public static void main(String[] args) { @@ -112,6 +113,7 @@ public UnMapped toKml (File kmlFile, String name, double lat0, double lon0, double km) throws FileNotFoundException, ClassNotFoundException, SQLException, IOException, ParserConfigurationException, SAXException { + int count = 0; try (Connection conPost = DatabaseTool.openDb(Coverage.DB_PORP_GISDB); BufferedWriter ow = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(kmlFile), "UTF-8"))) { @@ -165,10 +167,13 @@ double lon = Double.parseDouble(lonStr); double dd = Japan.distanceKm(lat0,lon0,lat,lon); if (dd < km) { - String poiname = String.format("%02d - %s", area, gmlid); - String color = decideColor(fixed); - ow.write(getStringPlacemark(poiname, latStr, lonStr, color)); - ow.newLine(); + count++; + if (count <= MAX_DATA_COUNT) { + String poiname = String.format("%02d - %s", area, gmlid); + String color = decideColor(fixed); + ow.write(getStringPlacemark(poiname, latStr, lonStr, color)); + ow.newLine(); + } } } }