You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-20Lines changed: 74 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,36 +17,63 @@ The [well-known-text](https://en.wikipedia.org/wiki/Well-known_text_representati
17
17
18
18
WKTPlot is a library provides an easy-to-use API for visualizing well-known-text strings and shapely objects programatically. This library wraps around the [Bokeh](https://github.com/bokeh/bokeh) library, which is a powerful plotting library for generating interactive visualizations. Bokeh also provides a rich assortment of [stylizing options](https://docs.bokeh.org/en/latest/docs/user_guide/styling.html) which are all usable through WKTPlot's `add_shape` method.
19
19
20
+
---
21
+
22
+
### Supported datatypes
23
+
WKTPlot supports the majority of well-known-text primitives, including:
24
+
* Point
25
+
* MultiPoint
26
+
* LineString
27
+
* MultiLineString
28
+
* LinearRing
29
+
* Polygon
30
+
* MultiPolygon
31
+
* GeometryCollection
32
+
33
+
---
34
+
20
35
## Basic Usage
21
36
```python
22
-
from shapely.geometry importPolygon
37
+
from shapely.geometry importLineString
23
38
from wktplot import WKTPlot
24
39
25
40
# Create plot object
26
41
plot = WKTPlot(title="My first plot!", save_dir="/path/to/directory")
27
42
28
43
# Define shapes either through well-known-text (WKT) string, or shapely object
# Save the plot to disk [/path/to/directory/my_first_plot.html]
53
+
# Save plot to disk [/path/to/directory/my_first_plot.html]
37
54
plot.save()
38
55
```
39
56
40
-
### Supported datatypes
41
-
WKTPlot supports majority of shapely objects including:
42
-
* Point
43
-
* MultiPoint
44
-
* LineString
45
-
* MultiLineString
46
-
* LinearRing
47
-
* Polygon
48
-
* MultiPolygon
49
-
* GeometryCollection
57
+

58
+
59
+
---
60
+
## OpenStreetMaps
61
+
WKTPlot now supports the ability to integrate with OpenStreetMaps. Shape coordinates will be projected to the Mercator coordinate system, which appear to distort shape proportions compared to standard geometric projection.
62
+
```python
63
+
# Import OpenStreetMaps plotting class
64
+
from wktplot.plots.osm import OpenStreetMapsPlot
65
+
66
+
# Create plot object just like standard WKTPlot class
67
+
plot = OpenStreetMapsPlot("Open Street Map Plot", save_dir="/path/to/directory")
* Add native support for visualizing GeoDataframes and shapefiles.
75
-
* Make web view more interactive.
100
+
---
101
+
102
+
## Development
103
+
### Bugs / Feature Requests
104
+
Plese open an `Issue` in Github with any bugs found or feature requests, and follow the prompts so that developers can reproduce or implement the necessary changes.
105
+
106
+
### Local development
107
+
Development of this model is centered around the Makefile. All you need to spin up a working environment to build and test this module can be done with the Makefile.
2. Create the Python virtaul environment and install module's development / testing dependencies. This will also install WKTPlot in [develop mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html).
114
+
```sh
115
+
make develop
116
+
```
117
+
3. Activate virtual environment
118
+
```sh
119
+
source venv/bin/activate
120
+
```
121
+
4. Run linting and unittests.
122
+
```sh
123
+
make test
124
+
```
125
+
5. When you want to remove the virtual environment and clean up after development.
126
+
```sh
127
+
deactivate
128
+
make clean # This will remove all generated files, like .coverage and build/
129
+
make sparkling # This will remove all generate files and the virtual env.
0 commit comments