Skip to content

Commit

Permalink
Add example geotable
Browse files Browse the repository at this point in the history
  • Loading branch information
invisibleroads committed Mar 30, 2016
1 parent 7b1fe37 commit 403c062
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.egg-info
*.pyc
*.swp
*.sw[op]
.cache
.eggs
.ipynb_checkpoints
Expand Down
13 changes: 13 additions & 0 deletions estimate_electricity_cost_by_technology_from_population.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,19 @@ def run(target_folder, g):
system_cost_table_path = join(target_folder, key + '.csv')
system_cost_table.transpose().to_csv(system_cost_table_path)
d[key + '_table_path'] = system_cost_table_path

target_path = join(target_folder, 'population.csv')
rows = []
import geopy
g = geopy.GoogleV3().geocode
for l in ls:
name = l['name']
location = g(name)
rows.append([name, location.latitude, location.longitude, l['population'], l['population']])
t = DataFrame(rows, columns=['Name', 'Latitude', 'Longitude', 'Population', 'RadiusInPixelsRange10-30'])
t.to_csv(target_path, index=False)
d['population_streets_satellite_geotable_path'] = target_path

return d


Expand Down

0 comments on commit 403c062

Please sign in to comment.