예제 #1
0
from govuk_api.ofns.api import API as OFNS_API
from doogal_api.api import API as DOOGAL_API
from govuk_ws.ofns.population import Population
from math import sin, cos, sqrt, atan2, radians
ofns_api = OFNS_API()
doogal_api = DOOGAL_API()
population_api = Population()
import geopy.distance
import matplotlib.pyplot as plt
import numpy as np
from govuk_api.ofns.api import NoDistrictError
from govuk_api.ofns.api import MissingDistrictError
from govuk_api.ofns.api import NoWardError
from govuk_api.ofns.api import MissingWardError
from govuk_api.ofns.api import NoOFNSDataError

coordinates = []
wards = []
ward_codes = []
lat_list = []
lng_list = []
households = []
population = []

#Show the districts available
print(ofns_api.get_districts())

#Ask the user for a district
district = input("Please type an district and press enter:")

#Get the wards within a district
예제 #2
0
from govuk_api.ofns.api import API as OFNS_API
from doogal_api.api import API as DOOGAL_API
from development_district import district
from development_district import coordinates
from development_district import transport_max_lat
from development_district import transport_min_lat
from development_district import transport_max_lng
from development_district import transport_min_lng

ofns_api = OFNS_API()
doogal_api = DOOGAL_API()
import json
import simplekml
import zipfile

kml = simplekml.Kml()

point = []
icon_style = [
    'images/icon-5.png', 'images/icon-6.png', 'images/icon-7.png',
    'images/icon-8.png', 'images/icon-9.png'
]

parameters = {
    'minLat': transport_min_lat,
    'minLng': transport_min_lng,
    'maxLat': transport_max_lat,
    'maxLng': transport_max_lng,
}
result = doogal_api.request('GetPlacesNear.ashx',
                            parameters).read().decode('utf-8')
from development_district import wards
from development_district import coordinates
from development_district import centre_lat
from development_district import centre_lng
from development_district import distance
from development_district import max_lat
from development_district import min_lat
from development_district import max_lng
from development_district import min_lng
import matplotlib.pyplot as plt
import numpy as np
import json
import datetime

school_ratings = SchoolRatings()
doogal_api = DOOGAL_API()
ofns_api = OFNS_API()
google_api = GOOGLE_API(key_path="../property-fundamentals/google_api/key.txt")
#postcode_mapping = PostcodeMapping()
postcodes_api = POSTCODE_API()
import simplekml
import zipfile
kml = simplekml.Kml()

y_pos = np.arange(len(wards[0]))
point = []
school_ward = []
icon_style = [
    'images/icon-1.png', 'images/icon-2.png', 'images/icon-3.png',
    'images/icon-4.png', 'images/icon-10.png'
]