Index: Osm5XmlHandler.java =================================================================== --- Osm5XmlHandler.java (Revision 1445) +++ Osm5XmlHandler.java (Arbeitskopie) @@ -604,7 +604,6 @@ // "soft clip" each way that crosses a boundary by adding a point // at each place where it meets the boundary private void makeBoundaryNodes() { - log.info("Making boundary nodes"); int numBoundaryNodesDetected = 0; int numBoundaryNodesAdded = 0; for(Way way : wayMap.values()) { @@ -663,7 +662,6 @@ } } } - log.info("Making boundary nodes - finished (" + numBoundaryNodesAdded + " added, " + numBoundaryNodesDetected + " detected)"); } private void incArcCount(Map map, Coord p, int inc) { @@ -1114,7 +1112,7 @@ * border to Poland) * 2. Create a "sea sector" only for this shoreline segment. This may also be the best solution * (see German border to the Netherlands where the shoreline continues in the Netherlands) - * The first choice may lead to "flooded" areas, the second may lead to "triangles". + * The first choice may lead to "flooded" areas, the second may lead to "triangles" or inverted areas. * * Usually, the first choice is appropriate if the segment is "nearly" closed. */ @@ -1129,19 +1127,22 @@ if (nearlyClosed) { // close the way points.add(pStart); + log.warn("adding pseudo island " + w.toBrowseURL()); seaRelation.addElement("inner", w); } else { - seaId = (1L << 62) + nextFakeId++; - sea = new Way(seaId); - sea.getPoints().addAll(points); - sea.addPoint(new Coord(pEnd.getLatitude(), pStart.getLongitude())); - sea.addPoint(pStart); - sea.addTag("natural", "sea"); - log.info("sea: ", sea); - wayMap.put(seaId, sea); - seaRelation.addElement("outer", sea); - generateSeaBackground = false; + // create additional points at next border + if (null == hStart) { + hStart = getNextEdgeHit(seaBounds, pStart); + w.getPoints().add(0, hStart.getPoint(seaBounds)); + } + if (null == hEnd) { + hEnd = getNextEdgeHit(seaBounds, pEnd); + w.getPoints().add(hEnd.getPoint(seaBounds)); + } + log.debug("hits (second try): ", hStart, hEnd); + hitMap.put(hStart, w); + hitMap.put(hEnd, null); } } else { @@ -1179,17 +1180,17 @@ EdgeHit hNext; if (segment != null) { // add the segment and get the "ending hit" - log.info("adding: ", segment); + log.warn("adding: ", segment.getId()); w.getPoints().addAll(segment.getPoints()); hNext = getEdgeHit(seaBounds, segment.getPoints().get(segment.getPoints().size()-1)); } else { - w.addPoint(hit.getPoint(seaBounds)); + Coord p = hit.getPoint(seaBounds); + w.addPoint(p); hNext = hits.higher(hit); if (hNext == null) hNext = hFirst; - Coord p; if (hit.compareTo(hNext) < 0) { log.info("joining: ", hit, hNext); for (int i=hit.edge; i ways) { Map beginMap = new HashMap();