RSS-Feed

David Hadizadeh

E-Mail

Xing-Profil

LinkedIn

Impressum

 




Java-Beispiel zum Abfragen von Geometrien in der Nähe

08.01.2015

Aus aktuellem Anlass hier mal ein Beispiel-Code in Java zum Abfragen von Geometrien:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
URL url = new URL("http://141.45.146.152:8080/OhdmApi/geographicObject/nearObjects/highway=primary,highway=traffic_signals/1/"+URLEncoder.encode("MULTILINESTRING((13.513375234473285 52.42776656340422 0,13.513293936940071 52.42797876424454 0))", "UTF-8").replace("+", "%20"));
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Content-Type",
			"application/json; charset=utf-8");
 
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
		new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
 
while ((inputLine = in.readLine()) != null) {
	response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Kategorie: OHDM |


Impressum