Manu1400 / ParkingAPI

Disponibilité des places de parking
7 stars 0 forks source link

Add Seoul #148

Open Manu1400 opened 6 years ago

Manu1400 commented 6 years ago

big API: http://openapi.seoul.go.kr:8088/6a52695a4f74616536394758717877/json/SearchParkingInfoRealtime/1/500/

URL : http://openapi.seoul.go.kr:8088//json//1/

Extract : {"PARKING_CODE":"1510340","PARKING_NAME":"DDP북측 마장로 버스전용주차장(시)","ADDR":"중구 신당동 222-3 0","PARKING_TYPE_NM":"노상 주차장","OPERATION_RULE_NM":"버스전용 주차장","TEL":"02)2290-6449","CAPACITY":4.0,"CUR_PARKING":3.0,"CUR_PARKING_TIME":"2018-10-10 06:56:24"

Manu1400 commented 6 years ago

used by https://github.com/Taeksu89/Basic-getJson_publicApi/blob/71ef04c73468833d287ce08aa1a30ac101bbb5c9/app/src/main/java/com/taeksukim/android/parking/MapsActivity.java

            for (int i = 0; i < arrayLength; i++) {
                JSONObject park = rows.getJSONObject(i);
                String code = park.getString("PARKING_CODE");
                if(parkCodes.contains(code)){
                    continue; // 여기서 아래 로직을 실행하지 않고 for문 상단으로 이동
                }

                parkCodes.add(code);

                double lat = getDouble(park,"LAT");
                double lng = getDouble(park,"LNG");
                LatLng parking = new LatLng(lat, lng);

                int capacity = getInt(park, "CAPACITY");
                int current = getInt(park, "CUR_PARKING");
                int space = capacity - current;

                mMap.addMarker(new MarkerOptions().position(parking).title(space + "/" + capacity));
Manu1400 commented 6 years ago

http://data.seoul.go.kr -> many datasets