30 |
|
|
31 |
DeduplicateHelper<String> dedup = new DeduplicateHelper<>(); |
DeduplicateHelper<String> dedup = new DeduplicateHelper<>(); |
32 |
|
|
33 |
|
public Map<String, Integer> kommuner() throws IOException { |
34 |
|
|
35 |
|
final String url = "http://dawa.aws.dk/kommuner"; |
36 |
|
|
37 |
|
Map<String,Integer> result = new TreeMap<>(); |
38 |
|
|
39 |
|
String jsonStr = HttpUtil.getContentString(url, 5000); |
40 |
|
JSONArray root = new JSONArray( jsonStr) ; |
41 |
|
|
42 |
|
for (int i=0; i<root.length(); i++) { |
43 |
|
JSONObject current = root.getJSONObject(i); |
44 |
|
|
45 |
|
int kode = current.getInt("kode"); |
46 |
|
String navn = current.getString("navn"); |
47 |
|
|
48 |
|
result.put(navn, kode); |
49 |
|
} |
50 |
|
|
51 |
|
return result; |
52 |
|
} |
53 |
|
|
54 |
public Map<String, Integer> kommunerIRegion(int regionskode) throws IOException { |
public Map<String, Integer> kommunerIRegion(int regionskode) throws IOException { |
55 |
|
|
56 |
final String url = "http://dawa.aws.dk/kommuner"; |
final String url = "http://dawa.aws.dk/kommuner"; |