Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalrussell committed Sep 8, 2023
1 parent dafe0bd commit 584b3bd
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/ˈsnɪkɪt/ – sounds like [snicket](https://en.oxforddictionaries.com/definition/snicket) (noun,
Northern English) A narrow passage between houses; an alleyway.


## Why use snkit?

`snkit` helps tidy spatial network data.
Expand All @@ -25,36 +24,33 @@ For example:
![Unconnected network](docs/source/_static/unconnected-network.png)

`snkit` has methods to:

- add endpoints to each edge
- connect nodes to nearest edges
- split edges at connecting points
- create node and edge ids, and add from_id and to_id to each edge


### Spatial network

The output of a snkit data cleaning process might look something like this:

![Connected network](docs/source/_static/connected-network.png)


#### Nodes

geometry | id | other attributes...
---------|----|--
`POINT (0.03 0.04)` | node_0 | ...
`POINT (0.03 0.03)` | node_1 | ...
`POINT (0.02 0.03)` | node_2 | ...

| geometry | id | other attributes... |
| ------------------- | ------ | ------------------- |
| `POINT (0.03 0.04)` | node_0 | ... |
| `POINT (0.03 0.03)` | node_1 | ... |
| `POINT (0.02 0.03)` | node_2 | ... |

#### Edges

geometry | id | from_id | to_id | other attributes...
---------|----|---------|-------| --
`LINESTRING (0.04 -0.04...` | edge_0 | node_10 | node_22 | ...
`LINESTRING (0.01 -0.03...` | edge_1 | node_22 | node_21 | ...
`LINESTRING (0.02 -0.02...` | edge_2 | node_21 | node_25 | ...

| geometry | id | from_id | to_id | other attributes... |
| --------------------------- | ------ | ------- | ------- | ------------------- |
| `LINESTRING (0.04 -0.04...` | edge_0 | node_10 | node_22 | ... |
| `LINESTRING (0.01 -0.03...` | edge_1 | node_22 | node_21 | ... |
| `LINESTRING (0.02 -0.02...` | edge_2 | node_21 | node_25 | ... |

## Getting started

Expand Down Expand Up @@ -89,14 +85,12 @@ Run the tests:

python -m pytest tests/


## Testimonials 💯 👍 😊

> With five lines of snkit I replaced four or five hundred lines of custom code!
A. Contented Customer (@czor847)


## Related projects

- [`pysal/spaghetti`](https://pysal-spaghetti.readthedocs.io/en/latest/index.html) has methods
Expand All @@ -105,7 +99,6 @@ A. Contented Customer (@czor847)
visualize street networks from OpenStreetMap, including methods to correct and simplify
network topology.


## Acknowledgements

```
Expand Down

0 comments on commit 584b3bd

Please sign in to comment.