﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
18097	MapCSSTagChecker.getLocation does not work for US	Don-vip	Don-vip	"From https://josm.openstreetmap.de/ticket/17058#comment:19

{{{
#!rule
*[aeroway=aerodrome][!icao][faa!~/\d/][inside(""US"")],
*[aeroway=aerodrome][!iata][faa!~/\d/][inside(""US"")] {
  throwOther: tr(""{0} without {1}"", ""{0.tag}"", ""{1.key}"");
  group: tr(""Airport tagging"");
  /* assertNoMatch: ""way aeroway=aerodrome faa=OK12""; not properly working due to inside() */
  /* assertMatch: ""way aeroway=aerodrome faa=ORD""; */
}
}}}

does not work. US bounds resolve to:
{{{
[x=-180,y=-15,width=360,height=88]
}}}

center of the bbox resolve to
{{{
LatLon[lat=29.0,lon=0.0]
}}}

which is not in the US.

{{{
#!java
    private static LatLon getLocation(TagCheck check, Method insideMethod) {
        Optional<String> inside = getFirstInsideCountry(check, insideMethod);
        if (inside.isPresent()) {
            GeoPropertyIndex<Boolean> index = Territories.getGeoPropertyIndex(inside.get());
            if (index != null) {
                GeoProperty<Boolean> prop = index.getGeoProperty();
                if (prop instanceof DefaultGeoProperty) {
                    Rectangle bounds = ((DefaultGeoProperty) prop).getArea().getBounds();
                    return new LatLon(bounds.getCenterY(), bounds.getCenterX());
                }
            }
        }
        return LatLon.ZERO;
    }
}}}"	defect	closed	normal	19.09	Core validator		fixed	inside territory	Klumbumbus
