What3WordsSearchChannel extends SearchChannel { public Point getServiceCoordinates(double lon, double lat, String srs) throws Exception { final CoordinateReferenceSystem sourceCrs = CRS.decode(srs); final CoordinateReferenceSystem targetCrs = CRS.decode(SERVICE_SRS); Point point = new Point(lon, lat); final Point transformed = ProjectionHelper.transformPoint(point, sourceCrs, targetCrs); return transformed; }  @Override void init(); boolean isValidSearchTerm(SearchCriteria criteria); Capabilities getCapabilities(); ChannelSearchResult doSearch(SearchCriteria searchCriteria); Point getServiceCoordinates(double lon, double lat, String srs); ChannelSearchResult reverseGeocode(SearchCriteria sc); SearchResultItem parseResult(JSONObject dataItem, String targetSrs); int getRank(String type); static final String ID; static final String SERVICE_SRS; }
@Test public void testTransform() throws Exception { What3WordsSearchChannel channel = new What3WordsSearchChannel(); Point p = channel.getServiceCoordinates(385547.65760422836, 6675293.715526561, "EPSG:3067"); assertEquals(60.19837505386789, p.getLat(), 0.1); assertEquals(24.93546499999964, p.getLon(), 0.1); }