Skip to content

Commit

Permalink
Clipping of a line string is now working.
Browse files Browse the repository at this point in the history
Got all tests to pass. Need to create more tests, especially for edge cases.
Happy with the overall structure of the code. Code is better organized and
easier to understand what is going on.

There are two hacks one should be aware off.

1. Using a hash pointer values to check if we have already seen a point. If we
   have, we bail the walk because we are stuck in a cycle.
2. Check to see if we saw the same point value as the starting inbound point.

The other hack is, that if the number of values is less than six, we discard it
as a valid segment  - these are possible because of the hacks mentioned above.
  • Loading branch information
gdey committed Dec 30, 2016
1 parent d29dd80 commit ee404ea
Show file tree
Hide file tree
Showing 12 changed files with 651 additions and 40 deletions.
6 changes: 5 additions & 1 deletion container/list/point/list/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
"github.com/terranodo/tegola/maths"
)

type Elementer interface {
list.Elementer
}

type ElementerPointer interface {
list.Elementer
maths.Pointer
Expand Down Expand Up @@ -161,7 +165,7 @@ func (l *List) GoString() string {
strs := []string{"List{"}
for p := l.Front(); p != nil; p = p.Next() {
pt := p.(maths.Pointer)
strs = append(strs, fmt.Sprintf("%v(%p)", pt.Point(), p))
strs = append(strs, fmt.Sprintf("%v(%p:%[2]T)", pt.Point(), p))
}
strs = append(strs, "}")
return strings.Join(strs, "")
Expand Down
Loading

0 comments on commit ee404ea

Please sign in to comment.