Ignore:
Timestamp:
2013-04-13T22:47:23+02:00 (11 years ago)
Author:
Don-vip
Message:

Search: fix invalid results for nodes: operator with closed ways

File:
1 edited

Legend:

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

    r5694 r5847  
    9696
    9797    /**
    98      * Replies the number of nodes in this ways.
    99      *
    100      * @return the number of nodes in this ways.
     98     * Replies the number of nodes in this way.
     99     *
     100     * @return the number of nodes in this way.
    101101     * @since 1862
    102102     */
     
    104104    public int getNodesCount() {
    105105        return nodes.length;
     106    }
     107   
     108    /**
     109     * Replies the real number of nodes in this way (full number of nodes minus one if this way is closed)
     110     *
     111     * @return the real number of nodes in this way.
     112     * @since 5847
     113     *
     114     * @see #getNodesCount()
     115     * @see #isClosed()
     116     */
     117    public int getRealNodesCount() {
     118        int count = getNodesCount();
     119        return isClosed() ? count-1 : count;
    106120    }
    107121
Note: See TracChangeset for help on using the changeset viewer.