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

fix spelling in the repo #163

Merged
merged 1 commit into from
Jun 22, 2022
Merged
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
16 changes: 8 additions & 8 deletions docs/api/topojson.core.topology.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ coordinates but foremost the computation of a topology.
> + ###### `data` : _any_ geometric type
Geometric data that should be converted into TopoJSON
> + ###### `topology` : boolean
Specifiy if the topology should be computed for deriving the TopoJSON.
Specify if the topology should be computed for deriving the TopoJSON.
Default is `True`.
> + ###### `prequantize` : boolean, int
If the prequantization parameter is specified, the input geometry is
Expand Down Expand Up @@ -62,14 +62,14 @@ coordinates but foremost the computation of a topology.
> + ###### `simplify_with` : str
Sets the package to use for simplifying (both pre- and toposimplify). Choose
between `shapely` or `simplification`. Shapely adopts solely Douglas-Peucker
and simplification both Douglas-Peucker and Visvalingam-Whyatt. The pacakge
and simplification both Douglas-Peucker and Visvalingam-Whyatt. The package
simplification is known to be quicker than shapely.
Default is `shapely`.
> + ###### `simplify_algorithm` : str
Choose between `dp` and `vw`, for Douglas-Peucker or Visvalingam-Whyatt
respectively. `vw` will only be selected if `simplify_with` is set to
`simplification`. Default is `dp`, since it still "produces the most accurate
generalization" (Chi & Cheung, 2006).
`simplification`. Default is `dp`, since it "produced the most accurate
generalization" (Shi, W. & Cheung, C., 2006).
> + ###### `winding_order` : str
Determines the winding order of the features in the output geometry. Choose
between `CW_CCW` for clockwise orientation for outer rings and counter-
Expand Down Expand Up @@ -128,7 +128,7 @@ Convert the Topology to a JSON object.
> + ###### `indent` : int
If `pretty=True`, declares the indentation of the objects.
Default is `4`.
> + ###### `maxlinelinelength` : int
> + ###### `maxlinelength` : int
If `pretty=True`, declares the maximum length of each line.
Default is `88`.

Expand All @@ -151,7 +151,7 @@ computed Topology.
> + ###### `indent` : int
If `pretty=True`, declares the indentation of the objects.
Default is `4`
> + ###### `maxlinelinelength` : int
> + ###### `maxlinelength` : int
If `pretty=True`, declares the maximum length of each line.
Default is `88`
> + ###### `validate` : boolean
Expand All @@ -175,7 +175,7 @@ computed Topology.

Note: This function use the TopoJSON driver within Fiona to parse the Topology
to a GeoDataFrame. If data is missing (eg. Fiona cannot parse nested
geometrycollections) you can trying using the `.to_geojson()` function prior
geometry collections) you can trying using the `.to_geojson()` function prior
creating the GeoDataFrame.

### to_alt
Expand Down Expand Up @@ -256,4 +256,4 @@ in the range of `0.0001` to `10`.

> #### Returns
> + ###### object or None
Topology object with simplfified linestrings if `inplace` is `False`.
Topology object with simplified linestrings if `inplace` is `False`.
21 changes: 11 additions & 10 deletions docs/api/topojson.ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ This function is a replacement for the shapely.ops.split function, but faster.
> + ###### `line` : numpy.array
numpy array with coordinates that you like to be split
> + ###### `splitter` : numpy.array
numpy array with coordiates on wich the line should be tried splitting
numpy array with coordinates on which the line should be tried splitting

> #### Returns
> + ###### list of numpy.array
Expand Down Expand Up @@ -193,7 +193,7 @@ are filtered
get_matches(geoms, tree_idx)
```

Function to return the indici of the rtree that intersects with the input geometries
Function to return the indices of the rtree that intersects with the input geometries

> #### Parameters
> + ###### `geoms` : list
Expand Down Expand Up @@ -226,10 +226,10 @@ Example: input as [[1,2], [2,1]] will return as [[1,2]]
select_unique_combs(linestrings)
```

Given a set of inpit linestrings will create unique couple combinations.
Each combination created contains a couple of two linestrings where the enveloppe
Given a set of input linestrings will create unique couple combinations.
Each combination created contains a couple of two linestrings where the envelope
overlaps each other.
Linestrings with non-overlapping enveloppes are not returned as combination.
Linestrings with non-overlapping envelopes are not returned as combination.

> #### Parameters
> + ###### `linestrings` : list of LineString
Expand Down Expand Up @@ -289,9 +289,10 @@ Docs
30-100 for "vw".
> + ###### `algorithm` : str, optional
Choose between `dp` for Douglas-Peucker and `vw` for Visvalingam–Whyatt.
Defaults to `dp`, as its evaluation maintains to be good (Song & Miao, 2016).
Defaults to `dp`, as its evaluation maintains to be good (Shi, W. &
Cheung, C., 2006)
> + ###### `package` : str, optional
Choose between `simplification` or `shapely`. Both pachakges contains
Choose between `simplification` or `shapely`. Both packages contains
simplification algorithms (`shapely` only `dp`, and `simplification` both `dp`
and `vw`).
> + ###### `input_as` : str, optional
Expand Down Expand Up @@ -352,7 +353,7 @@ to 3 decimals on the resulting output geometries (after the topology is computed
> + ###### `linestrings` : list of shapely.geometry.LineStrings
LineStrings of which the coordinates will be rounded
> + ###### `rounding_precision` : int
Precision value. Up till how many decimales the coordinates should be rounded.
Precision value. Up till how many decimals the coordinates should be rounded.

> #### Returns
> + ###### list of shapely.geometry.LineStrings
Expand All @@ -371,7 +372,7 @@ prettify TopoJSON Format output for readability.

> #### Returns
> + ###### topojson.Topojson
pretty printed JSON variant of the topoloy object
pretty printed JSON variant of the topology object

## properties_level
```python
Expand All @@ -380,7 +381,7 @@ properties_level(topojson_object, position='nested')

Define where the attributes of the geometry object should be placed. Choose between
`nested` or `foreign`. Default is `nested` where the attribute information is placed
within the "properties" ditctionary, part of the geometry.
within the "properties" dictionary, part of the geometry.
`foreign`, tries to place the attributes on the same level as the geometry.

> #### Parameters
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nav_order: 6
{: .no_toc}


Contributions are much welcome for the documentation and for defects. Defects means here both behaviour not conforming the specification and missing but desirable features. The following two sections describes the process that I use for code development and documentation writing.
Contributions are much welcome for the documentation and for defects. Defects means here both behavior not conforming the specification and missing but desirable features. The following two sections describes the process that I use for code development and documentation writing.

1. TOC
{:toc}
Expand All @@ -27,7 +27,7 @@ For contributions, use the following guidelines:

3. Once satisfied, push your changes as a new branch to your fork and create a Pull Request to the original repository.

4. A Pull Request triggers the Continous Integration tests on the main GitHub repository and only after passing these tests a PR can be merged into master by the maintainer.
4. A Pull Request triggers the Continuous Integration tests on the main GitHub repository and only after passing these tests a PR can be merged into master by the maintainer.

<div class="code-example mx-1 bg-example">
<div class="example-label" markdown="1">
Expand Down
4 changes: 2 additions & 2 deletions docs/example/input-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ with open("tests/files_topojson/example_data_africa.geojson", 'r') as f:
assert data['type']) == 'FeatureCollection'
topo = topojson.Topology(data)

# to visualise we use the (optional!) package Altair.
# to visualize we use the (optional!) package Altair.
topo.toposimplify(4).to_alt()
```
<div id="embed_output_mesh_altair_from_geojson"></div>
Expand All @@ -120,7 +120,7 @@ topo.toposimplify(4).to_alt()
* * *

## TopoJSON data from file
A TopoJSON file can be postprocessed using json dictionary.
A TopoJSON file can be post-processed using json dictionary.

<div class="code-example mx-1 bg-example">
<div class="example-label" markdown="1">
Expand Down
14 changes: 7 additions & 7 deletions docs/example/output-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Example 🔧

We use the data as is prepared in the [.to_json()](output-types.html#to_json) section.

Serialze and save into a JSON (GeoJSON) file
Serialize and save into a JSON (GeoJSON) file
```python
topo.to_geojson('my_file.geo.json')
```
Expand Down Expand Up @@ -263,7 +263,7 @@ print(topo.to_json(pretty=True))
</pre>
The `pretty` option depends on the setting `indent` and `maxlinelength`, these default to `4` and `88` respectively.

More options in generating the GeoJSON from the computed Topololgy are `validate` (`True` or `False`), `winding_order` and `decimals`. Where the TopoJSON standard defines a winding order of clock-wise orientation for outer polygons and counter-clockwise orientation for innner polygons is the winding order in the GeoJSON standard the opposite (`CCW_CW`). The `decimals` option defines the number of decimals for the output coordinates.
More options in generating the GeoJSON from the computed Topology are `validate` (`True` or `False`), `winding_order` and `decimals`. Where the TopoJSON standard defines a winding order of clock-wise orientation for outer polygons and counter-clockwise orientation for inner polygons is the winding order in the GeoJSON standard the opposite (`CCW_CW`). The `decimals` option defines the number of decimals for the output coordinates.
</div>
</div>

Expand All @@ -280,7 +280,7 @@ Example 🔧
</div>
<div class="example-text" markdown="1">

Here we load continental Afria as data file and apply a simplificiation on the arcs after the topology is computed using `toposimplify`.
Here we load continental Africa as data file and apply a simplification on the arcs after the topology is computed using `toposimplify`.
```python
import topojson as tp

Expand All @@ -299,7 +299,7 @@ topo.to_alt()
```
<div id="embed_output_mesh_altair"></div>

A few more convenience options are included for Altair visualizations, such as assigning a color property for indiviual features and using geopgraphic projections.
A few more convenience options are included for Altair visualizations, such as assigning a color property for individual features and using geographic projections.

Per TopoJSON specification, information of individual features are stored as an nested object within `properties`. For example here is shown the properties of the feature at index-0:

Expand All @@ -321,7 +321,7 @@ topo.to_dict()['objects']['data']['geometries'][0]
'arcs': [[-6, 0, -84, -82, -77, -3, -100, -140, -137]]}
</pre>

Next, we map the property `name` of each feature as color property using a nominal (`:N`) encoding type. The `equalEarth` is used as geopgraphic projection. By default tooltips are enabled.
Next, we map the property `name` of each feature as color property using a nominal (`:N`) encoding type. The `equalEarth` is used as geographic projection. By default tooltips are enabled.

```python
# this requires the (optional!) package Altair.
Expand Down Expand Up @@ -350,7 +350,7 @@ Example 🔧
</div>
<div class="example-text" markdown="1">

Given the included example data set of continental Afria and application of the Topology
Given the included example data set of continental Africa and application of the Topology
```python
import topojson as tp

Expand Down Expand Up @@ -387,7 +387,7 @@ Example 🔧
</div>
<div class="example-text" markdown="1">

Given the included example data set of continental Afria, one can enanble the interactive IPython Widget as follow
Given the included example data set of continental Africa, one can enable the interactive IPython Widget as follow
```python
import topojson as tp

Expand Down
12 changes: 6 additions & 6 deletions docs/example/settings-tuning.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ By adopting the TopoJSON format is possible to store geographical data as topolo

boolean
{: .text-delta}
Specifiy if the topology should be computed for deriving the TopoJSON.
Specify if the topology should be computed for deriving the TopoJSON.
Default is `True`.

<div class="code-example mx-1 bg-example">
Expand Down Expand Up @@ -123,7 +123,7 @@ data
```
<img src="../images/two_no_touching_polygon.svg">

The `prequantize` option is defined as an integer number. It can be best understand as a value that defines the size of a rectangular grid, with the bottom left coordinate at `(0,0)`. Next, the `x`-numbers and `y`-numbers of all coordinates are indepentenly scaled and shifted on this rectangular grid (normalization on range). Here it is shown for the `x`-numbers only:
The `prequantize` option is defined as an integer number. It can be best understand as a value that defines the size of a rectangular grid, with the bottom left coordinate at `(0,0)`. Next, the `x`-numbers and `y`-numbers of all coordinates are independency scaled and shifted on this rectangular grid (normalization on range). Here it is shown for the `x`-numbers only:
```python
# get the x-numbers of all coordinates
x = np.array([ls.xy[0] for ls in data])
Expand Down Expand Up @@ -283,7 +283,7 @@ topological relations. Sensible values for coordinates stored in degrees are
in the range of `0.0001` to `10`. Defaults to `False`.


**Note 1:** The units of `toposimplify` are corresoponding to the input space. The provided _sensible_ values are for degrees (eg. `epsg:4326`). When the projection of your data is in `meters` you might need to test which value should be adopted.
**Note 1:** The units of `toposimplify` are corresponding to the input space. The provided _sensible_ values are for degrees (eg. `epsg:4326`). When the projection of your data is in `meters` you might need to test which value should be adopted.

**Note 2:** This is also supported by chaining. Meaning you could first compute the Topology (which can be cost-intensive) and afterwards apply the `toposimplify` on the computed Topology.

Expand All @@ -293,7 +293,7 @@ Example 🔧
{: .label .label-blue-000 }
</div>
<div class="example-text" markdown="1">
Here we load continental Afria as data file and apply the `toposimplify` on the arcs.
Here we load continental Africa as data file and apply the `toposimplify` on the arcs.
The plot shows the borders including linestring simplification, derived _after_ the `Topology` is computed.

```python
Expand Down Expand Up @@ -453,7 +453,7 @@ str
{: .text-delta}
Sets the package to use for simplifying (both pre- and toposimplify). Choose
between `shapely` or `simplification`. Shapely adopts solely Douglas-Peucker
and simplification both Douglas-Peucker and Visvalingam-Whyatt. The pacakge
and simplification both Douglas-Peucker and Visvalingam-Whyatt. The package
simplification is known to be quicker than shapely.
Default is `shapely`.

Expand Down Expand Up @@ -582,7 +582,7 @@ Topology(
'type': 'Topology'}
)
</pre>
As you can see the `arcs` for type `Polygon` are reversed. The effect seems to be negligible, but the effect should be taken into account when using geographic projections, as it defines which part is 'inside' and 'outside' the `Polgygon`:
As you can see the `arcs` for type `Polygon` are reversed. The effect seems to be negligible, but the effect should be taken into account when using geographic projections, as it defines which part is 'inside' and 'outside' the `Polygon`:

```python
alt_top = CW_CCW.to_alt(projection='equalEarth', color='type:N').properties(title='CW_CCW')
Expand Down
10 changes: 5 additions & 5 deletions docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ As explained before we can do so through:
While the 2nd and 3rd bullets from above list have a significant impact on the filesize reduction, we will describe here the 1st bullet _-the computation of the Topology-_ since it is basically the core of this library.


The computation of the Topology involves secure bookkeeping on multiple levels in order to succesfully pass all steps. The following levels in derivation can be distinguished, which are explained below:
The computation of the Topology involves secure bookkeeping on multiple levels in order to successfully pass all steps. The following levels in derivation can be distinguished, which are explained below:

1. TOC
{:toc}
Expand Down Expand Up @@ -100,7 +100,7 @@ Extract(
'type': 'Topology'}
)
</pre>
The Extract class creates an object with a fews different keys. From top to bottom are these
The Extract class creates an object with a few different keys. From top to bottom are these
- `bookkeeping_coords` which stores the references to all point-coordinates. In this input are no existing point-coordinates.
- `bookkeeping_geoms` which stores the references to all geometries, such as LineStrings and Polygons.
- `coordinates` the actual point-coordinates
Expand Down Expand Up @@ -238,7 +238,7 @@ The Cut class creates an object based on the Join object. From top to bottom are
- `bookkeeping_coords` see Extract. Not changed.
- `bookkeeping_duplicates` nested arrays where each array are the referenced linestrings that are duplicates (albeit reversed) from each other.
- `bookkeeping_geoms` see Extract. Not changed.
- `bookkeeping_linestrings` since the linestrings are splitted using the junction-points, this key maintain the bookkeeping which LineStrings appeared in which geometry.
- `bookkeeping_linestrings` since the linestrings are split using the junction-points, this key maintain the bookkeeping which LineStrings appeared in which geometry.
- `coordinates` see Extract. Not changed.
- `junctions` see Extract. Not changed.
- `linestrings` in the process of splitting LineStrings on detected junctions, the object type is changed from shapely LineString to NumPy arrays in order to make use of matrix-wise splitting.
Expand Down Expand Up @@ -399,7 +399,7 @@ The `bookkeeping_*` keys are removed and the `arcs` for each geometry within `ob

## Topology

The sixt and last step is Topology. The Topology class passes the data first _down_ towards the Extract and subsequently Join, Cut, Dedup and Hashmap class, before starting the Topology phase.
The sixth and last step is Topology. The Topology class passes the data first _down_ towards the Extract and subsequently Join, Cut, Dedup and Hashmap class, before starting the Topology phase.

<img src="images/topology.png" width="450px"/>

Expand Down Expand Up @@ -439,7 +439,7 @@ The Topology class creates an object based on the Hashmap object. From top to bo
- `bbox`: see Join. Not changed.
- `coordinates` see Extract. Not changed.
- `objects` see Hashmap. Not changed.
- `transform` stroes the `scale` and `translate` keys, which can be used for dequantization of the quantized arcs.
- `transform` stores the `scale` and `translate` keys, which can be used for dequantization of the quantized arcs.

The `arcs` key is created storing the quantized linestrings, where shared arcs are referred from within each geometry.

Expand Down
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ And through conda using the following command:
conda install topojson -c conda-forge
```

The library is installed succesfully if the following code.
The library is installed successfully if the following code.

```python
import topojson as tp
Expand Down Expand Up @@ -67,12 +67,12 @@ To improve the speed of the `presimplify`/`toposimplify` parameter settings or i

- `simplification`

To visualise the output as a mesh and/or return the output as geodataframe you will need (_optional_):
To visualize the output as a mesh and/or return the output as geodataframe you will need (_optional_):

- `altair`
- `geopandas`

To interactively analyse the effects of `toposimplify` and `topoquantize` as a widget, you also need (_optional_):
To interactively analyze the effects of `toposimplify` and `topoquantize` as a widget, you also need (_optional_):

- `ipywidgets`
- `ipywidgets` JupyterLab extension
Expand Down
Loading