src/main/java/de/blau/android/util/Geometry.java
/**
     * calculate the centroid of a way
     * 
     * @param v current display bounding box
     * @param w screen width
     * @param h screen height
     * @param way the Way
     * @return WS84*17E coordinates of the centroid or null if they could not be determined
     */
calculate the centroid of a way


calculate the centroid of a way
@Nullable
    public static int[] centroid(int w, int h, @NonNull ViewBox v, @NonNull final Way way) {
        Coordinates c = centroidXY(w, h, v, way);
        if (c == null) {
            return null;
        }
        int lat = GeoMath.yToLatE7(h, w, v, (float) c.y);
        int lon = GeoMath.xToLonE7(w, v, (float) c.x);
        return new int[] { lat, lon };
    }
@ Nullable public static int [ ] centroid ( int w , int h , @ NonNull ViewBox v , @ NonNull final Way way ) { Coordinates c = centroidXY ( w , h , v , way ) ; if ( c == null ) { return null ; } int lat = GeoMath . yToLatE7 ( h , w , v , ( float ) c . y ) ; int lon = GeoMath . xToLonE7 ( w , v , ( float ) c . x ) ; return new int [ ] { lat , lon } ; }
calculate the centroid of a way
calculate the centroid of a way