0

我已经制作了这个 Java 程序来从 nominatim 获取地址,但我得到一个空结果作为回报。代码中有错误吗?

String address = "Ctra. Ibiza a San Antonio, Km 5, 07816 San Rafael, Illes Balears, Spain";

StringBuilder urlStringConnection = new StringBuilder();

urlStringConnection.append  ("http://nominatim.openstreetmap.org/search/");
urlStringConnection.append  (ESAPI.encoder().encodeForURL(address));
urlStringConnection.append  ("?format=json&addressdetails=1&limit=1&polygon_svg=1");

URL url = new URL(urlStringConnection.toString());
URLConnection uc = url.openConnection ();
uc.connect();
List<Place> places = (parseGeocodingAddress (uc.getInputStream()));
4

0 回答 0