Ignore:
Timestamp:
2018-12-08T14:19:23+01:00 (5 years ago)
Author:
Don-vip
Message:

see #16073 - handle entries where centroid does not lie in shape (like Canadian 'British Columbia Mosaic')

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Bounds.java

    r14095 r14521  
    500500     */
    501501    public Rectangle2D.Double asRect() {
    502         double w = getWidth();
    503         return new Rectangle2D.Double(minLon, minLat, w, maxLat-minLat);
    504     }
    505 
    506     private double getWidth() {
     502        return new Rectangle2D.Double(minLon, minLat, getWidth(), getHeight());
     503    }
     504
     505    /**
     506     * Returns the bounds width.
     507     * @return the bounds width
     508     * @since 14521
     509     */
     510    public double getHeight() {
     511        return maxLat-minLat;
     512    }
     513
     514    /**
     515     * Returns the bounds width.
     516     * @return the bounds width
     517     * @since 14521
     518     */
     519    public double getWidth() {
    507520        return maxLon-minLon + (crosses180thMeridian() ? 360.0 : 0.0);
    508521    }
     
    513526     */
    514527    public double getArea() {
    515         return getWidth() * (maxLat - minLat);
     528        return getWidth() * getHeight();
    516529    }
    517530
Note: See TracChangeset for help on using the changeset viewer.