Skip to content

Commit

Permalink
temp: revert to get tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
thestelz committed Oct 27, 2022
1 parent 9ed3f12 commit 60deae0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
26 changes: 13 additions & 13 deletions doc/Factory-Compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `LineString#disjoint?(MultiPolygon)` ||||||||
| `LineString#intersects?(Point)` ||||||||
| `LineString#intersects?(LineString)` ||||||||
| `LineString#intersects?(LinearRing)` ||||||| |
| `LineString#intersects?(LinearRing)` ||||||| |
| `LineString#intersects?(Polygon)` ||||||||
| `LineString#intersects?(Collection)` ||||||||
| `LineString#intersects?(MultiPoint)` ||||||||
Expand All @@ -175,8 +175,8 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `LineString#touches?(MultiLineString)` ||||||||
| `LineString#touches?(MultiPolygon)` ||||||||
| `LineString#crosses?(Point)` ||||||||
| `LineString#crosses?(LineString)` ||||||| |
| `LineString#crosses?(LinearRing)` ||||||| |
| `LineString#crosses?(LineString)` ||||||| |
| `LineString#crosses?(LinearRing)` ||||||| |
| `LineString#crosses?(Polygon)` ||||||||
| `LineString#crosses?(Collection)` ||||||||
| `LineString#crosses?(MultiPoint)` ||||||||
Expand Down Expand Up @@ -222,7 +222,7 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `LinearRing#as_text` ||||||||
| `LinearRing#as_binary` ||||||||
| `LinearRing#empty?` ||||||||
| `LinearRing#simple?` ||||||| |
| `LinearRing#simple?` ||||||| |
| `LinearRing#boundary` ||||||||
| `LinearRing#convex_hull` ||||||||
| `LinearRing#buffer` ||||||||
Expand Down Expand Up @@ -251,8 +251,8 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `LinearRing#disjoint?(MultiLineString)` ||||||||
| `LinearRing#disjoint?(MultiPolygon)` ||||||||
| `LinearRing#intersects?(Point)` ||||||||
| `LinearRing#intersects?(LineString)` ||||||| |
| `LinearRing#intersects?(LinearRing)` ||||||| |
| `LinearRing#intersects?(LineString)` ||||||| |
| `LinearRing#intersects?(LinearRing)` ||||||| |
| `LinearRing#intersects?(Polygon)` ||||||||
| `LinearRing#intersects?(Collection)` ||||||||
| `LinearRing#intersects?(MultiPoint)` ||||||||
Expand All @@ -267,8 +267,8 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `LinearRing#touches?(MultiLineString)` ||||||||
| `LinearRing#touches?(MultiPolygon)` ||||||||
| `LinearRing#crosses?(Point)` ||||||||
| `LinearRing#crosses?(LineString)` ||||||| |
| `LinearRing#crosses?(LinearRing)` ||||||| |
| `LinearRing#crosses?(LineString)` ||||||| |
| `LinearRing#crosses?(LinearRing)` ||||||| |
| `LinearRing#crosses?(Polygon)` ||||||||
| `LinearRing#crosses?(Collection)` ||||||||
| `LinearRing#crosses?(MultiPoint)` ||||||||
Expand All @@ -282,7 +282,7 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `LinearRing#within?(MultiPoint)` ||||||||
| `LinearRing#within?(MultiLineString)` ||||||||
| `LinearRing#within?(MultiPolygon)` ||||||||
| `LinearRing#contains?(Point)` ||||||| |
| `LinearRing#contains?(Point)` ||||||| |
| `LinearRing#contains?(LineString)` ||||||||
| `LinearRing#contains?(LinearRing)` ||||||||
| `LinearRing#contains?(Polygon)` ||||||||
Expand Down Expand Up @@ -315,7 +315,7 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `Polygon#as_binary` ||||||||
| `Polygon#empty?` ||||||||
| `Polygon#simple?` ||||||||
| `Polygon#boundary` ||||||| |
| `Polygon#boundary` ||||||| |
| `Polygon#convex_hull` ||||||||
| `Polygon#buffer` ||||||||
| `Polygon#area` ||||||||
Expand Down Expand Up @@ -375,7 +375,7 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `Polygon#within?(MultiPoint)` ||||||||
| `Polygon#within?(MultiLineString)` ||||||||
| `Polygon#within?(MultiPolygon)` ||||||||
| `Polygon#contains?(Point)` ||||||| |
| `Polygon#contains?(Point)` ||||||| |
| `Polygon#contains?(LineString)` ||||||||
| `Polygon#contains?(LinearRing)` ||||||||
| `Polygon#contains?(Polygon)` ||||||||
Expand Down Expand Up @@ -684,7 +684,7 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `MultiPolygon#as_binary` ||||||||
| `MultiPolygon#empty?` ||||||||
| `MultiPolygon#simple?` ||||||||
| `MultiPolygon#boundary` ||||||| |
| `MultiPolygon#boundary` ||||||| |
| `MultiPolygon#convex_hull` ||||||||
| `MultiPolygon#buffer` ||||||||
| `MultiPolygon#area` ||||||||
Expand Down Expand Up @@ -744,7 +744,7 @@ _Note: This list is not exhaustive of all the methods defined by each factory. T
| `MultiPolygon#within?(MultiPoint)` ||||||||
| `MultiPolygon#within?(MultiLineString)` ||||||||
| `MultiPolygon#within?(MultiPolygon)` ||||||||
| `MultiPolygon#contains?(Point)` ||||||| |
| `MultiPolygon#contains?(Point)` ||||||| |
| `MultiPolygon#contains?(LineString)` ||||||||
| `MultiPolygon#contains?(LinearRing)` ||||||||
| `MultiPolygon#contains?(Polygon)` ||||||||
Expand Down
21 changes: 17 additions & 4 deletions lib/rgeo/cartesian/planar_graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,19 @@ def intersection_map
# list of intersections for that edge.
s1_intersects = int.point != int.s1.s && int.point != int.s1.e
if s1_intersects
intersection_map[int.s1] ||= []
# intersection_map[int.s1] ||= []
unless intersection_map[int.s1]
intersection_map[int.s1] = []
end
intersection_map[int.s1] << int.point
end

s2_intersects = int.point != int.s2.s && int.point != int.s2.e
next unless s2_intersects
intersection_map[int.s2] ||= []
# intersection_map[int.s2] ||= []
unless intersection_map[int.s2]
intersection_map[int.s2] = []
end
intersection_map[int.s2] << int.point
end
intersection_map
Expand All @@ -191,7 +197,11 @@ def create_half_edge(edge)
end

def insert_half_edge(half_edge)
@incident_edges[half_edge.origin.coordinates] ||= []
# @incident_edges[half_edge.origin.coordinates] ||= []
# @incident_edges[half_edge.origin.coordinates] << half_edge
unless incident_edges[half_edge.origin.coordinates]
@incident_edges[half_edge.origin.coordinates] = []
end
@incident_edges[half_edge.origin.coordinates] << half_edge
end

Expand Down Expand Up @@ -293,7 +303,10 @@ def add_geometry(geom)
def add_line_string(geom)
add_edges(geom.segments)

hedge = !geom.empty? && @incident_edges[geom.start_point.coordinates].first
# hedge = !geom.empty? && @incident_edges[geom.start_point.coordinates].first
hedge = unless geom.empty?
@incident_edges[geom.start_point.coordinates].first
end

@geom_edges << GeomEdge.new(hedge, nil)
end
Expand Down

0 comments on commit 60deae0

Please sign in to comment.