Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #101

Merged
merged 5 commits into from
Dec 9, 2023
Merged

Dev #101

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,719 changes: 5,334 additions & 4,385 deletions docs/package-lock.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,59 @@
},
"dependencies": {
"@vicons/fa": "0.12.0",
"@vueuse/core": "10.5.0",
"animejs": "3.2.1",
"@vueuse/core": "10.7.0",
"animejs": "3.2.2",
"astro-remote": "^0.2.4",
"date-fns": "2.30.0",
"eslint-plugin-astro": "^0.29.1",
"eslint-plugin-astro": "^0.30.0",
"url-slug": "4.0.1",
"vue": "3.3.4"
"vue": "3.3.11"
},
"devDependencies": {
"@astrojs/markdown-component": "^1.0.5",
"@astrojs/markdown-remark": "3.3.0",
"@astrojs/markdown-remark": "4.0.0",
"@astrojs/prefetch": "0.4.1",
"@astrojs/sitemap": "3.0.1",
"@astrojs/tailwind": "5.0.2",
"@astrojs/vue": "^3.0.1",
"@fec/remark-a11y-emoji": "3.1.0",
"@astrojs/sitemap": "^3.0.3",
"@astrojs/tailwind": "5.0.3",
"@astrojs/vue": "^4.0.2",
"@fec/remark-a11y-emoji": "4.0.2",
"@prettier/plugin-pug": "3.0.0",
"@rushstack/eslint-patch": "1.5.1",
"@typescript-eslint/eslint-plugin": "6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"@rushstack/eslint-patch": "1.6.0",
"@typescript-eslint/eslint-plugin": "6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@volar/vue-language-plugin-pug": "1.0.18",
"astro": "3.3.0",
"astro": "^4.0.3",
"autoprefixer": "10.4.16",
"eslint": "^8.51.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint": "^8.55.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-simple-import-sort": "10.0.0",
"eslint-plugin-tailwindcss": "3.13.0",
"eslint-plugin-vue": "9.17.0",
"eslint-plugin-vue": "9.19.2",
"github-slugger": "2.0.0",
"hastscript": "8.0.0",
"postcss": "8.4.31",
"postcss": "8.4.32",
"postcss-html": "1.5.0",
"postcss-import": "15.1.0",
"postcss-markdown": "1.2.0",
"prettier": "3.0.3",
"prettier-plugin-astro": "0.12.0",
"prettier-plugin-tailwindcss": "0.5.6",
"prettier": "3.1.0",
"prettier-plugin-astro": "0.12.2",
"prettier-plugin-tailwindcss": "0.5.9",
"pug": "3.0.2",
"pug-plain-loader": "1.1.0",
"rehype-autolink-headings": "7.0.0",
"rehype-citation": "^1.0.3",
"rehype-autolink-headings": "7.1.0",
"rehype-citation": "^2.0.0",
"rehype-katex": "7.0.0",
"rehype-slug": "6.0.0",
"remark-directive": "3.0.0",
"remark-emoji": "4.0.0",
"remark-emoji": "4.0.1",
"remark-math": "6.0.0",
"remark-smartypants": "2.0.0",
"serialize-javascript": "6.0.1",
"shorthash": "0.0.2",
"stylelint": "15.10.3",
"stylelint-config-standard": "34.0.0",
"tailwindcss": "3.3.3",
"stylelint": "16.0.1",
"stylelint-config-standard": "35.0.0",
"tailwindcss": "3.3.6",
"unist-util-visit": "5.0.0"
}
}
2 changes: 1 addition & 1 deletion docs/src/pages/metrics/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ been applied.
<div class="param">
<span class="pn">stats_column_label</span>
<span class="pc">:</span>
<span class="pa"> str | list[str] | tuple[str]</span>
<span class="pa"> str</span>
</div>
<div class="param">
<span class="pn">nodes_gdf</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/rustalgos/rustalgos.md
Original file line number Diff line number Diff line change
Expand Up @@ -2736,12 +2736,12 @@ datapoints are not located with high spatial precision.



<span class="name">node_ys</span><span class="annotation">: list[float]</span>
<span class="name">node_lives</span><span class="annotation">: list[bool]</span>




<span class="name">node_lives</span><span class="annotation">: list[bool]</span>
<span class="name">node_ys</span><span class="annotation">: list[float]</span>



Expand Down
79 changes: 68 additions & 11 deletions docs/src/pages/tools/graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ side-effects as a function of varied node intensities when computing network cen
</div>
<div class="desc">

Removal of dangling nodes can result in &quot;filler nodes&quot; of degree two where dangling streets were removed. If cleanup_filler_nodes is `True` then these will be removed.</div>
Whether to cleanup filler nodes. True by default.</div>
</div>

### Returns
Expand Down Expand Up @@ -249,7 +249,7 @@ side-effects as a function of varied node intensities when computing network cen
</div>
<div class="desc">

The buffer distance to consider when checking if parallel edges are sufficiently similar to be merged.</div>
The buffer distance to consider when checking if parallel edges sharing the same start and end nodes are sufficiently adjacent to be merged.</div>
</div>

### Returns
Expand Down Expand Up @@ -401,10 +401,7 @@ side-effects as a function of varied node intensities when computing network cen

Consolidates nodes if they are within a buffer distance of each other. Several parameters provide more control over the conditions used for deciding whether or not to merge nodes. The algorithm proceeds in two steps:

Nodes within the buffer distance of each other are merged. A new centroid will be determined and all existing edge endpoints will be updated accordingly. The new centroid for the merged nodes can be based on:
- The centroid of the node group;
- Else, all nodes of degree greater or equal to `cent_min_degree`;
- Else, all nodes with aggregate adjacent edge lengths greater than a factor of `centroid_by_min_len_factor` of the node with the greatest aggregate length for adjacent edges.
Nodes within the buffer distance of each other are merged. If selecting `centroid_by_itx` then the new centroid will try to use intersections to determine the new centroid for the nodes. It will first attempt to find intersections with two through-routes, else will use intersections with one through-route.

The merging of nodes can create parallel edges with mutually shared nodes on either side. These edges are replaced by a single new edge, with the new geometry selected from either:
- An imaginary centreline of the combined edges if `merge_edges_by_midline` is set to `True`;
Expand Down Expand Up @@ -437,7 +434,7 @@ side-effects as a function of varied node intensities when computing network cen
</div>
<div class="desc">

Whether all nodes within the buffer distance are merged, or only &quot;direct&quot; or &quot;indirect&quot; neighbours. Defaults to None.</div>
Whether all nodes within the buffer distance are merged, or only &quot;direct&quot; or &quot;indirect&quot; neighbours. Defaults to None which will consider all nodes.</div>
</div>

<div class="param-set">
Expand Down Expand Up @@ -477,7 +474,7 @@ side-effects as a function of varied node intensities when computing network cen
</div>
<div class="desc">

The buffer distance to consider when checking if parallel edges sharing the same start and end nodes are sufficiently similar to be merged. This is run after node consolidation has completed.</div>
The buffer distance to consider when checking if parallel edges sharing the same start and end nodes are sufficiently adjacent to be merged. This is run after node consolidation has completed.</div>
</div>

### Returns
Expand Down Expand Up @@ -526,7 +523,7 @@ side-effects as a function of varied node intensities when computing network cen
<div class="param">
<span class="pn">contains_buffer_dist</span>
<span class="pc">:</span>
<span class="pa"> float = 25</span>
<span class="pa"> int = 25</span>
</div>
<span class="pt">)</span>
</div>
Expand Down Expand Up @@ -572,11 +569,11 @@ side-effects as a function of varied node intensities when computing network cen
<div class="param-set">
<div class="def">
<div class="name">contains_buffer_dist</div>
<div class="type">float</div>
<div class="type">int</div>
</div>
<div class="desc">

The buffer distance to consider when checking if parallel edges are sufficiently similar to be merged.</div>
The buffer distance to consider when checking if parallel edges sharing the same start and end nodes are sufficiently adjacent to be merged.</div>
</div>

### Returns
Expand Down Expand Up @@ -753,12 +750,19 @@ plot.plot_nx_primal_or_dual(G_simple,
<span class="pc">:</span>
<span class="pa"> int = 20</span>
</div>
<div class="param">
<span class="pn">max_ang_diff</span>
<span class="pc">:</span>
<span class="pa"> int = 45</span>
</div>
<span class="pt">)</span>
</div>
</div>


Generates graph node weightings based on the ratio of directly adjacent edges to total nearby edges. This is used to control for unintended amplification of centrality measures where redundant network representations (e.g. duplicitious segments such as adjacent street, sidewalk, cycleway, busway) tend to inflate centrality scores. This method is intended for 'messier' network representations (e.g. OSM).

> This method is only recommended for primal graph representations.
### Parameters
<div class="param-set">
<div class="def">
Expand All @@ -780,6 +784,16 @@ plot.plot_nx_primal_or_dual(G_simple,
A distance to use when buffering edges to calculate the weighting. 20m by default.</div>
</div>

<div class="param-set">
<div class="def">
<div class="name">max_ang_diff</div>
<div class="type">int</div>
</div>
<div class="desc">

Only count a nearby adjacent edge as duplicitous if the angular difference between edges is less than `max_ang_diff`. 45 degrees by default.</div>
</div>

### Returns
<div class="param-set">
<div class="def">
Expand All @@ -795,5 +809,48 @@ plot.plot_nx_primal_or_dual(G_simple,
</div>


<div class="function">

## nx_generate_vis_lines


<div class="content">
<span class="name">nx_generate_vis_lines</span><div class="signature">
<span class="pt">(</span>
<div class="param">
<span class="pn">nx_multigraph</span>
</div>
<span class="pt">)</span>
</div>
</div>


Generates a `line_geom` property for nodes consisting `MultiLineString` geoms for visualisation purposes. This method can be used if preferring to visualise the outputs as lines instead of points. The lines are assembled from the adjacent half segments.
### Parameters
<div class="param-set">
<div class="def">
<div class="name">nx_multigraph</div>
<div class="type">MultiGraph</div>
</div>
<div class="desc">

A `networkX` `MultiGraph` in a projected coordinate system, containing `x` and `y` node attributes, and `geom` edge attributes containing `LineString` geoms.</div>
</div>

### Returns
<div class="param-set">
<div class="def">
<div class="name"></div>
<div class="type">MultiGraph</div>
</div>
<div class="desc">

A `networkX` graph. The nodes will have a new `line_geom` parameter containing `shapely` `MultiLineString` geoms.</div>
</div>


</div>



</section>
Loading
Loading