private void handleXyCircle(Query query, String xy, Location target) {
        int xcoord;
        int ycoord;
        // parse xy
        int semipos = xy.indexOf(';');
        if (semipos > 0 && semipos < xy.length()) {
            xcoord = Integer.parseInt(xy.substring(0, semipos));
            ycoord = Integer.parseInt(xy.substring(semipos+1, xy.length()));
        } else {
            throw new IllegalArgumentException("pos.xy must be in the format 'digits;digits' but was: '"+xy+"'");
        }

        String radius = query.properties().getString(posRadius);
        int radiusUnits;
        if (radius == null) {
            double radiuskm = 50.0;
            double radiusdegrees = radiuskm * km2deg;
            radiusUnits = (int)(radiusdegrees * 1000000);
        } else if (radius.endsWith("km")) {
            double radiuskm = Double.parseDouble(radius.substring(0, radius.length()-2));
            double radiusdegrees = radiuskm * km2deg;
            radiusUnits = (int)(radiusdegrees * 1000000);
        } else if (radius.endsWith("m")) {
            double radiusm = Double.parseDouble(radius.substring(0, radius.length()-1));
            double radiusdegrees = radiusm * km2deg / 1000.0;
            radiusUnits = (int)(radiusdegrees * 1000000);
        } else if (radius.endsWith("mi")) {
            double radiusmiles = Double.parseDouble(radius.substring(0, radius.length()-2));
            double radiusdegrees = radiusmiles * mi2deg;
            radiusUnits = (int)(radiusdegrees * 1000000);
        } else {
            radiusUnits = Integer.parseInt(radius);
        }
        target.setXyCircle(xcoord, ycoord, radiusUnits);
    }
A searcher converting human-readable position parameters
into internal format.
<br>
Reads the following query properties:
<ul>
 <li> pos.ll (geographical latitude and longitude)
 <li> pos.xy (alternate to pos.ll - direct x and y in internal units)
 <li> pos.radius (distance in one of:
       internal units (no suffix), meter (m), kilometer (km) or miles (mi)
</ul>

@author arnej27959
container-search/src/main/java/com/yahoo/prelude/searcher/PosSearcher.java