Introduce fast check for boundaries

This commit is contained in:
Victor Shcherb 2012-10-22 01:34:20 +02:00
parent 5f39f05ae0
commit ed71b91423

View file

@ -303,6 +303,10 @@ public class Multipolygon {
private void updateCacheOfRings() { private void updateCacheOfRings() {
if (outerRings == null) { if (outerRings == null) {
outerRings = Ring.combineToRings(getOuterWays()); outerRings = Ring.combineToRings(getOuterWays());
maxLat = -90;
minLat = 90;
maxLon = -180;
minLon = 180;
for(Ring r : outerRings) { for(Ring r : outerRings) {
for(Node n : r.getBorder()){ for(Node n : r.getBorder()){
maxLat = (float) Math.max(maxLat, n.getLatitude()); maxLat = (float) Math.max(maxLat, n.getLatitude());