Skip to content

Commit

Permalink
Version 1.0rc10 (mattijn#98)
Browse files Browse the repository at this point in the history
* improve API notebook generator

* improve API docs

* improve usage docs

* add example pic toposimplifify

* catch no topology with dedup

* improve docstrings

* bump to version 1.0rc10

* reduce the length of readme
  • Loading branch information
mattijn authored Jun 15, 2020
1 parent 1b7dbef commit 85503f4
Show file tree
Hide file tree
Showing 22 changed files with 734 additions and 1,037 deletions.
344 changes: 30 additions & 314 deletions README.md

Large diffs are not rendered by default.

76 changes: 16 additions & 60 deletions docs/api/topojson.core.cut.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,76 +25,32 @@ The following sequence is adopted:
4. dedup
5. hashmap

__Arguments__

----------
- __data __: dict
object created by the method topojson.Join.

> #### Returns
dict
object updated and expanded with
- __- updated key__: linestrings
- __- new key__: bookkeeping_duplicates
- __- new key__: bookkeeping_linestrings
> + ###### dict
object updated and expanded with
> + ###### - updated key: linestrings
- new key: bookkeeping_duplicates

### cutter
### to_dict
```python
Cut.cutter(self, data)
Cut.to_dict(self)
```

Entry point for the class Cut.

The cut function is the third step in the topology computation.
The following sequence is adopted:
1. extract
2. join
3. cut
4. dedup
5. hashmap

> #### Parameters
> + ###### `data` : (dict)
object created by the method topojson.join.
Convert the Cut object to a dictionary.

> #### Returns
dict
object updated and expanded with
- updated key: linestrings
- new key: bookkeeping_duplicates
- new key: bookkeeping_linestrings

### flatten_and_index
### to_svg
```python
Cut.flatten_and_index(self, slist)
Cut.to_svg(self, separate=False, include_junctions=False)
```

Function to create a flattened list of splitted linestrings and create a
numpy array of the bookkeeping_geoms for tracking purposes.
Display the linestrings and junctions as SVG.

> #### Parameters
> + ###### `slist` : (list of LineString)
list of splitted LineStrings

> #### Returns
list
segmntlist flattens the nested LineString in slist
numpy.array
array_bk is a bookkeeping array with index values to each LineString

### find_duplicates
```python
Cut.find_duplicates(self, segments_list)
```

Function for solely detecting and recording duplicate LineStrings.
Firstly creates couple-combinations of LineStrings. A couple is defined
as two linestrings where the enveloppe overlaps. Indexes of duplicates are
appended to the list self.duplicates.

> #### Parameters
> + ###### `segments_list` : (list of LineString)
list of valid LineStrings

> + ###### `separate` : boolean
If `True`, each of the linestrings will be displayed separately.
Default is `False`
> + ###### `include_junctions` : boolean
If `True`, the detected junctions will be displayed as well.
Default is `False`


81 changes: 12 additions & 69 deletions docs/api/topojson.core.dedup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,83 +15,26 @@ Dedup(self, data, options={})

Dedup duplicates and merge contiguous arcs

### deduper
### to_dict
```python
Dedup.deduper(self, data)
Dedup.to_dict(self)
```

Deduplication of linestrings that contain duplicates
Convert the Dedup object to a dictionary.

The dedup function is the fourth step in the topology computation.
The following sequence is adopted:
1. extract
2. join
3. cut
4. dedup
5. hashmap

### find_merged_linestring
```python
Dedup.find_merged_linestring(self, data, no_ndp_arcs, ndp_arcs, ndp_arcs_bk)
```

Function to find the index of LineString in a MultiLineString object which
contains merged LineStrings.

> #### Parameters
> + ###### `data` : (dict)
object that contains the 'linestrings'
> + ###### `no_ndp_arcs` : (int)
number of non-duplicate arcs
ndp_arcs : array
array containing index values of the related arcs

> #### Returns
int
index of LineString that contains merged LineStrings

### deduplicate
### to_svg
```python
Dedup.deduplicate(self, dup_pair_list, linestring_list, array_bk)
Dedup.to_svg(self, separate=False, include_junctions=False)
```

Function to deduplicate items
Display the linestrings and junctions as SVG.

> #### Parameters
> + ###### `dup_pair_list` : (numpy.ndarray)
array containing pair of indexes that refer to duplicate linestrings.
> + ###### `linestring_list` : (list of shapely.geometry.LineStrings)
list of linestrings from which items will be removed.
> + ###### `array_bk` : (numpy.ndarray)
array used for bookkeeping of linestrings.

> #### Returns
numpy.ndarray
bookkeeping array of shared arcs
numpy.ndarray
array where each processed pair is set to -99

### merge_contigious_arcs
```python
Dedup.merge_contigious_arcs(self, data, sliced_array_bk_ndp)
```

Function that iterate over geoms that contain shared arcs and try linemerge
on remaining arcs. The merged contigious arc is placed back in the 'linestrings'
object.
The arcs that can be popped are placed within the merged_arcs_idx list

> #### Parameters
> + ###### `data` : (dict)
object that contains the 'linestrings'.
> + ###### `sliced_array_bk_ndp` : (numpy.ndarray)
bookkeeping array where shared linestrings are set to np.nan.

### _pop_merged_arcs
```python
Dedup._pop_merged_arcs(self, data, array_bk, array_bk_sarcs)
```

The collected indici that can be popped, since they have been merged
> + ###### `separate` : boolean
If `True`, each of the linestrings will be displayed separately.
Default is `False`
> + ###### `include_junctions` : boolean
If `True`, the detected junctions will be displayed as well.
Default is `False`


Loading

0 comments on commit 85503f4

Please sign in to comment.