Skip to content

Commit

Permalink
Merge pull request #104 from benchmark-urbanism/dev
Browse files Browse the repository at this point in the history
Adds visibility and view sheds
  • Loading branch information
songololo authored Dec 29, 2023
2 parents 72d881f + dc81416 commit b470396
Show file tree
Hide file tree
Showing 29 changed files with 1,605 additions and 139 deletions.
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/<executable file>",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ crate-type = ["cdylib"]

[dependencies]
atomic_float = "0.1.0"
ndarray = "0.15.6"
numpy = "0.18.0"
petgraph = "0.6.3"
pyo3 = { version="0.18.3", features=["multiple-pymethods"]}
Expand Down
1 change: 1 addition & 0 deletions docs/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def custom_format_signature(sig: inspect.Signature, colon: bool = True) -> str:
("cityseer.metrics.observe", here / "src/pages/metrics/observe.md"),
("cityseer.metrics.networks", here / "src/pages/metrics/networks.md"),
("cityseer.metrics.layers", here / "src/pages/metrics/layers.md"),
("cityseer.metrics.visibility", here / "src/pages/metrics/visibility.md"),
("cityseer.tools.graphs", here / "src/pages/tools/graphs.md"),
("cityseer.tools.io", here / "src/pages/tools/io.md"),
("cityseer.tools.plot", here / "src/pages/tools/plot.md"),
Expand Down
12 changes: 4 additions & 8 deletions docs/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

import matplotlib.pyplot as plt
import numpy as np
import osmnx as ox
import utm
from matplotlib import colors
from shapely import geometry

from cityseer.metrics import layers, networks
from cityseer.tools import graphs, io, mock, plot
from cityseer.tools import graphs, io, mock, plot, util

PLOT_RC_PATH = pathlib.Path(__file__).parent / "matplotlibrc"
print(f"matplotlibrc path: {PLOT_RC_PATH}")
Expand Down Expand Up @@ -96,13 +93,12 @@
# graph cleanup examples
lng, lat = -0.13396079424572427, 51.51371088849723
buffer = 1250
poly_wgs, _poly_utm, _utm_zone_number, _utm_zone_letter = io.buffered_point_poly(lng, lat, buffer)
poly_wgs, _ = io.buffered_point_poly(lng, lat, buffer)
graph_raw = io.osm_graph_from_poly(poly_wgs, simplify=False)
graph_utm = io.osm_graph_from_poly(poly_wgs, simplify=True, iron_edges=True)
# plot buffer
easting, northing = utm.from_latlon(lat, lng)[:2]
buff = geometry.Point(easting, northing).buffer(750)
min_x, min_y, max_x, max_y = buff.bounds
buffered_point, _ = io.buffered_point_poly(lng, lat, 750, projected=True)
min_x, min_y, max_x, max_y = buffered_point.bounds


# reusable plot function
Expand Down
Binary file modified docs/public/images/graph_cleaning_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/public/images/graph_cleaning_1b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/public/images/graph_cleaning_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/public/images/graph_cleaning_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/public/images/graph_cleaning_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/public/images/graph_cleaning_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/public/images/graph_cleaning_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions docs/src/layouts/PageLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const navPaths = [
'/metrics/observe',
'/metrics/networks',
'/metrics/layers',
'/metrics/visibility',
'/rustalgos/rustalgos',
'/attribution',
]
Expand All @@ -29,21 +30,21 @@ const navPaths = [
<Fragment slot="metaContent">
<title>{currentPath}</title>
</Fragment>
<div id='cols'>
<div id='nav-col'>
<div class='flex flex-col items-end object-contain'>
<a href='/' title='home' class='hover:scale-105 transition-all object-contain'>
<img src={logoURL.src} alt='logo' class='w-full h-full max-w-xs py-10 px-4' />
<div id="cols">
<div id="nav-col">
<div class="flex flex-col items-end object-contain">
<a href="/" title="home" class="hover:scale-105 transition-all object-contain">
<img src={logoURL.src} alt="logo" class="w-full h-full max-w-xs py-10 px-4" />
</a>
<NavColumn client:visible navPaths={navPaths} currentPath={currentPath} />
<div class='flex-grow'></div>
<div class='self-start px-8 py-2'>
<div class="flex-grow"></div>
<div class="self-start px-8 py-2">
<RepoLink />
</div>
</div>
<StripeTitle />
</div>
<div id='content-col'>
<div id="content-col">
<slot />
<Footer />
</div>
Expand Down Expand Up @@ -76,4 +77,4 @@ const navPaths = [
@apply w-full p-3;
}
}
</style>
</style>
Loading

0 comments on commit b470396

Please sign in to comment.