OpenLayers OpenLayers

Ticket #1072: intersects.patch

File intersects.patch, 161.7 kB (added by tschaub, 1 year ago)

add geometry.intersects method

  • examples/intersects.html

    old new  
     1<html xmlns="http://www.w3.org/1999/xhtml"> 
     2  <head> 
     3    <title>Geometry Intersections</title> 
     4    <style type="text/css"> 
     5        html, body { 
     6            margin: 0; 
     7            padding: 1em; 
     8            font: 0.9em Verdana, Arial, sans serif; 
     9        } 
     10        input, select, textarea { 
     11            font: 0.9em Verdana, Arial, sans-serif; 
     12        } 
     13        h2 { 
     14            margin-top: 0.75em; 
     15            font-size: 1.6em; 
     16        } 
     17        #leftcol { 
     18            position: absolute; 
     19            top: 0; 
     20            left: 1em; 
     21            padding: 0; 
     22            width: 455px; 
     23        } 
     24        #map { 
     25            width: 450px; 
     26            height: 225px; 
     27            border: 1px solid #ccc; 
     28        } 
     29        #input { 
     30            width: 450px; 
     31        } 
     32        #text { 
     33            font-size: 0.85em; 
     34            margin: 1em 0 1em 0; 
     35            width: 100%; 
     36            height: 10em; 
     37        } 
     38        #info { 
     39            position: relative; 
     40            padding: 2em 0; 
     41            margin-left: 470px; 
     42        } 
     43        #features { 
     44            font-size: 0.8em; 
     45            width: 100%; 
     46            height: 200px; 
     47        } 
     48        #intersections { 
     49            font-size: 0.8em; 
     50            width: 100%; 
     51            height: 200px; 
     52        } 
     53        p { 
     54            margin: 0; 
     55            padding: 0.75em 0 0.75em 0; 
     56        } 
     57    </style> 
     58    <script src="../lib/Firebug/firebug.js"></script> 
     59    <script src="../lib/OpenLayers.js"></script> 
     60    <script type="text/javascript"> 
     61        var map, vectors, geojson; 
     62        function init(){ 
     63            map = new OpenLayers.Map('map'); 
     64            vectors = new OpenLayers.Layer.Vector( 
     65                "Vector Layer", 
     66                {isBaseLayer: true} 
     67            ); 
     68 
     69            map.addLayers([vectors]); 
     70            map.addControl(new OpenLayers.Control.MousePosition()); 
     71             
     72            var panel = new OpenLayers.Control.EditingToolbar(vectors); 
     73            map.addControl(panel); 
     74 
     75            geojson = new OpenLayers.Format.GeoJSON(); 
     76             
     77            map.setCenter(new OpenLayers.LonLat(0, 0), 1); 
     78        } 
     79         
     80        function serialize() { 
     81            var str = geojson.write(vectors.features, true); 
     82            document.getElementById('features').value = str; 
     83        } 
     84 
     85        function deserialize() { 
     86            var element = document.getElementById('text'); 
     87            var features = geojson.read(element.value); 
     88            var bounds; 
     89            if(features) { 
     90                if(features.constructor != Array) { 
     91                    features = [features]; 
     92                } 
     93                for(var i=0; i<features.length; ++i) { 
     94                    if (!bounds) { 
     95                        bounds = features[i].geometry.getBounds(); 
     96                    } else { 
     97                        bounds.extend(features[i].geometry.getBounds()); 
     98                    } 
     99                     
     100                } 
     101                vectors.addFeatures(features); 
     102                map.zoomToExtent(bounds); 
     103                var plural = (features.length > 1) ? 's' : ''; 
     104                element.value = features.length + ' feature' + plural + ' added' 
     105            } else { 
     106                element.value = 'Bad input'; 
     107            } 
     108        } 
     109         
     110        function intersect() { 
     111            var features = vectors.features; 
     112            var feat1, feat2, intersects12, intersects21; 
     113            var parts = []; 
     114            // reset attributes 
     115            for(var i=0; i<features.length; ++i) { 
     116                features[i].attributes.intersectsWith = []; 
     117            } 
     118            for(var i=0; i<features.length-1; ++i) { 
     119                feat1 = features[i]; 
     120                for(var j=i+1; j<features.length; ++j) { 
     121                    feat2 = features[j]; 
     122                    intersects12 = feat1.geometry.intersects(feat2.geometry); 
     123                    if(intersects12) { 
     124                        feat1.attributes.intersectsWith.push("f" + j); 
     125                        parts.push("f" + i + " intersects f" + j + "\n"); 
     126                    } 
     127                    intersects21 = feat2.geometry.intersects(feat1.geometry); 
     128                    if(intersects21) { 
     129                        feat2.attributes.intersectsWith.push("f" + i); 
     130                        parts.push("f" + j + " intersects f" +  i + "\n"); 
     131                    } 
     132                    if(intersects12 != intersects21) { 
     133                        parts.push("trouble with " + i + " and " + j + "\n"); 
     134                    } 
     135                } 
     136            } 
     137            if(parts.length > 0) { 
     138                document.getElementById("intersections").value = parts.join(""); 
     139            } else { 
     140                document.getElementById("intersections").value = "no intersections"; 
     141            } 
     142        } 
     143 
     144        // preload images 
     145        (function() { 
     146            var roots = ["draw_point", "draw_line", "draw_polygon", "pan"]; 
     147            var onImages = []; 
     148            var offImages = []; 
     149            for(var i=0; i<roots.length; ++i) { 
     150                onImages[i] = new Image(); 
     151                onImages[i].src = "../theme/default/img/" + roots[i] + "_on.png"; 
     152                offImages[i] = new Image(); 
     153                offImages[i].src = "../theme/default/img/" + roots[i] + "_on.png"; 
     154            } 
     155        })(); 
     156 
     157    </script> 
     158  </head> 
     159  <body onload="init()"> 
     160    <div id="leftcol"> 
     161        <h2>OpenLayers Geometry Intersection Example</h2> 
     162        <div id="map"></div> 
     163        <div id="input"> 
     164            <textarea id="text"></textarea>  
     165            <input type="button" value="add feature" onclick="deserialize();" /> 
     166            <span id="selected"></span> 
     167        </div> 
     168    </div> 
     169    <div id="info"> 
     170        Features 
     171        <input type="button" value="refresh" onclick="serialize();" /><br /> 
     172        <textarea id="features"></textarea> 
     173        Intersections 
     174        <input type="button" value="intersect all" onclick="intersect();" /><br /> 
     175        <textarea id="intersections"></textarea> 
     176    </div> 
     177  </body> 
     178</html> 
  • lib/OpenLayers/Geometry.js

    old new  
    200200 
    201201    CLASS_NAME: "OpenLayers.Geometry" 
    202202}); 
     203 
     204     
     205/** 
     206 * Method: OpenLayers.Geometry.segmentsIntersect 
     207 * Determine whether two line segments intersect.  Optionally calculates 
     208 *     and returns the intersection point.  This function is optimized for 
     209 *     cases where seg1.x2 >= seg2.x1 || seg2.x2 >= seg1.x1.  In those 
     210 *     obvious cases where there is no intersection, the function should 
     211 *     not be called. 
     212 * 
     213 * Parameters: 
     214 * seg1 - {Object} Object representing a segment with properties x1, y1, x2, 
     215 *     and y2.  The start point is represented by x1 and y1.  The end point 
     216 *     is represented by x2 and y2.  Start and end are ordered so that x1 < x2. 
     217 * seg2 - {Object} Object representing a segment with properties x1, y1, x2, 
     218 *     and y2.  The start point is represented by x1 and y1.  The end point 
     219 *     is represented by x2 and y2.  Start and end are ordered so that x1 < x2. 
     220 * point - {Boolean} Return the intersection point.  If false, the actual 
     221 *     intersection point will not be calculated.  If true and the segments 
     222 *     intersect, the intersection point will be returned.  If true and 
     223 *     the segments do not intersect, false will be returned.  If true and 
     224 *     the segments are coincident, true will be returned. 
     225 * 
     226 * Returns: 
     227 * {Boolean | <OpenLayers.Geometry.Point>}  The two segments intersect. 
     228 *     If the point argument is true, the return will be the intersection 
     229 *     point or false if none exists.  If point is true and the segments 
     230 *     are coincident, return will be true (and the instersection is equal 
     231 *     to the shorter segment). 
     232 */ 
     233OpenLayers.Geometry.segmentsIntersect = function(seg1, seg2, point) { 
     234    var intersection = false; 
     235    var x11_21 = seg1.x1 - seg2.x1; 
     236    var y11_21 = seg1.y1 - seg2.y1; 
     237    var x12_11 = seg1.x2 - seg1.x1; 
     238    var y12_11 = seg1.y2 - seg1.y1; 
     239    var y22_21 = seg2.y2 - seg2.y1; 
     240    var x22_21 = seg2.x2 - seg2.x1; 
     241    var d = (y22_21 * x12_11) - (x22_21 * y12_11); 
     242    var n1 = (x22_21 * y11_21) - (y22_21 * x11_21); 
     243    var n2 = (x12_11 * y11_21) - (y12_11 * x11_21); 
     244    if(d == 0) { 
     245        // parallel 
     246        if(n1 == 0 && n2 == 0) { 
     247            // coincident 
     248            intersection = true; 
     249        } 
     250    } else { 
     251        var along1 = n1 / d; 
     252        var along2 = n2 / d; 
     253        if(along1 >= 0 && along1 <= 1 && along2 >=0 && along2 <= 1) { 
     254            // intersect 
     255            if(!point) { 
     256                intersection = true; 
     257            } else { 
     258                // calculate the intersection point 
     259                var x = seg1.x1 + (along1 * x12_11); 
     260                var y = seg1.y1 + (along1 * y12_11); 
     261                intersection = new OpenLayers.Geometry.Point(x, y); 
     262            } 
     263        } 
     264    } 
     265    return intersection; 
     266}; 
  • lib/OpenLayers/Geometry/Collection.js

    old new  
    306306        return equivalent; 
    307307    }, 
    308308 
     309    /** 
     310     * APIMethod: intersects 
     311     * Determine if the input geometry intersects this one. 
     312     * 
     313     * Parameters: 
     314     * geometry - {<OpenLayers.Geometry>} Any type of geometry. 
     315     * 
     316     * Returns: 
     317     * {Boolean} The input geometry intersects this one. 
     318     */ 
     319    intersects: function(geometry) { 
     320        var intersect = false; 
     321        for(var i=0; i<this.components.length; ++ i) { 
     322            intersect = geometry.intersects(this.components[i]); 
     323            if(intersect) { 
     324                break; 
     325            } 
     326        } 
     327        return intersect; 
     328    }, 
     329 
     330    /** @final @type String */ 
    309331    CLASS_NAME: "OpenLayers.Geometry.Collection" 
    310332}); 
  • lib/OpenLayers/Geometry/LinearRing.js

    old new  
    174174        } 
    175175        return area; 
    176176    }, 
     177     
     178    /** 
     179     * Method: containsPoint 
     180     * Test if a point is inside a linear ring.  For the case where a point 
     181     *     is coincident with a linear ring edge, returns 1.  Otherwise, 
     182     *     returns boolean. 
     183     * 
     184     * Parameters: 
     185     * point - {<OpenLayers.Geometry.Point>} 
     186     * 
     187     * Returns: 
     188     * {Boolean | Number} The point is inside the linear ring.  Returns 1 if 
     189     *     the point is coincident with an edge.  Returns boolean otherwise. 
     190     */ 
     191    containsPoint: function(point) { 
     192        var px = point.x; 
     193        var py = point.y; 
     194        function getX(y, x1, y1, x2, y2) { 
     195            return (((x1 - x2) * y) + ((x2 * y1) - (x1 * y2))) / (y1 - y2); 
     196        } 
     197        var numSeg = this.components.length - 1; 
     198        var start, end, x1, y1, x2, y2, cx, cy; 
     199        var crosses = 0; 
     200        for(var i=0; i<numSeg; ++i) { 
     201            start = this.components[i]; 
     202            x1 = start.x; 
     203            y1 = start.y; 
     204            end = this.components[i + 1]; 
     205            x2 = end.x; 
     206            y2 = end.y; 
     207             
     208            /** 
     209             * The following conditions enforce five edge-crossing rules: 
     210             *    1. points coincident with edges are considered contained; 
     211             *    2. an upward edge includes its starting endpoint, and 
     212             *    excludes its final endpoint; 
     213             *    3. a downward edge excludes its starting endpoint, and 
     214             *    includes its final endpoint; 
     215             *    4. horizontal edges are excluded; and 
     216             *    5. the edge-ray intersection point must be strictly right 
     217             *    of the point P. 
     218             */ 
     219            if(y1 == y2) { 
     220                // horizontal edge 
     221                if(py == y1) { 
     222                    // point on horizontal line 
     223                    if(x1 <= x2 && (px >= x1 && px <= x2) || // right or vert 
     224                       x1 >= x2 && (px <= x1 && px >= x2)) { // left or vert 
     225                        // point on edge 
     226                        crosses = -1; 
     227                        break; 
     228                    } 
     229                } 
     230                // ignore other horizontal edges 
     231                continue; 
     232            } 
     233            cx = getX(py, x1, y1, x2, y2); 
     234            if(cx == px) { 
     235                // point on line 
     236                if(y1 < y2 && (py >= y1 && py <= y2) || // upward 
     237                   y1 > y2 && (py <= y1 && py >= y2)) { // downward 
     238                    // point on edge 
     239                    crosses = -1; 
     240                    break; 
     241                } 
     242            } 
     243            if(cx <= px) { 
     244                // no crossing to the right 
     245                continue; 
     246            } 
     247            if(cx < Math.min(x1, x2) || cx > Math.max(x1, x2)) { 
     248                // no crossing 
     249                continue; 
     250            } 
     251            if(y1 < y2 && (py >= y1 && py < y2) || // upward 
     252               y1 > y2 && (py < y1 && py >= y2)) { // downward 
     253                ++crosses; 
     254            } 
     255        } 
     256        var contained = (crosses == -1) ? 
     257            // on edge 
     258            1 : 
     259            // even (out) or odd (in) 
     260            !!(crosses & 1); 
    177261 
     262        return contained; 
     263    }, 
     264 
     265    /** 
     266     * APIMethod: intersects 
     267     * Determine if the input geometry intersects this one. 
     268     * 
     269     * Parameters: 
     270     * geometry - {<OpenLayers.Geometry>} Any type of geometry. 
     271     * 
     272     * Returns: 
     273     * {Boolean} The input geometry intersects this one. 
     274     */ 
     275    intersects: function(geometry) { 
     276        var intersect = false; 
     277        if(geometry.CLASS_NAME == "OpenLayers.Geometry.Point") { 
     278            intersect = this.containsPoint(geometry); 
     279        } else if(geometry.CLASS_NAME == "OpenLayers.Geometry.LineString") { 
     280            intersect = geometry.intersects(this); 
     281        } else if(geometry.CLASS_NAME == "OpenLayers.Geometry.LinearRing") { 
     282            intersect = OpenLayers.Geometry.LineString.prototype.intersects.apply( 
     283                this, [geometry] 
     284            ); 
     285        } else { 
     286            // check for component intersections 
     287            for(var i=0; i<geometry.components.length; ++ i) { 
     288                intersect = geometry.components[i].intersects(this); 
     289                if(intersect) { 
     290                    break; 
     291                } 
     292            } 
     293        } 
     294        return intersect; 
     295    }, 
     296 
    178297    CLASS_NAME: "OpenLayers.Geometry.LinearRing" 
    179298}); 
  • lib/OpenLayers/Geometry/LineString.js

    old new  
    4141                                                                  arguments); 
    4242        } 
    4343    }, 
     44     
     45    /** 
     46     * APIMethod: intersects 
     47     * Test for instersection between two geometries.  This is a cheapo 
     48     *     implementation of the Bently-Ottmann algorigithm.  It doesn't 
     49     *     really keep track of a sweep line data structure.  It is closer 
     50     *     to the brute force method, except that segments are sorted and 
     51     *     potential intersections are only calculated when bounding boxes 
     52     *     intersect. 
     53     * 
     54     * Parameters: 
     55     * geometry - {<OpenLayers.Geometry>} 
     56     * 
     57     * Returns: 
     58     * {Boolean} The input geometry intersects this geometry. 
     59     */ 
     60    intersects: function(geometry) { 
     61        var intersect = false; 
     62        var type = geometry.CLASS_NAME; 
     63        if(type == "OpenLayers.Geometry.LineString" || 
     64           type == "OpenLayers.Geometry.LinearRing" || 
     65           type == "OpenLayers.Geometry.Point") { 
     66            var segs1 = this.getSortedSegments(); 
     67            var segs2; 
     68            if(type == "OpenLayers.Geometry.Point") { 
     69                segs2 = [{ 
     70                    x1: geometry.x, y1: geometry.y, 
     71                    x2: geometry.x, y2: geometry.y 
     72                }]; 
     73            } else { 
     74                segs2 = geometry.getSortedSegments(); 
     75            } 
     76            var seg1, seg1x1, seg1x2, seg1y1, seg1y2, 
     77                seg2, seg2y1, seg2y2; 
     78            // sweep right 
     79            outer: for(var i=0; i<segs1.length; ++i) { 
     80                seg1 = segs1[i]; 
     81                seg1x1 = seg1.x1; 
     82                seg1x2 = seg1.x2; 
     83                seg1y1 = seg1.y1; 
     84                seg1y2 = seg1.y2; 
     85                inner: for(var j=0; j<segs2.length; ++j) { 
     86                    seg2 = segs2[j]; 
     87                    if(seg2.x1 > seg1x2) { 
     88                        // seg1 still left of seg2 
     89                        break; 
     90                    } 
     91                    if(seg2.x2 < seg1x1) { 
     92                        // seg2 still left of seg1 
     93                        continue; 
     94                    } 
     95                    seg2y1 = seg2.y1; 
     96                    seg2y2 = seg2.y2; 
     97                    if(Math.min(seg2y1, seg2y2) > Math.max(seg1y1, seg1y2)) { 
     98                        // seg2 above seg1 
     99                        continue; 
     100                    } 
     101                    if(Math.max(seg2y1, seg2y2) < Math.min(seg1y1, seg1y2)) { 
     102                        // seg2 below seg1 
     103                        continue; 
     104                    } 
     105                    if(OpenLayers.Geometry.segmentsIntersect(seg1, seg2)) { 
     106                        intersect = true; 
     107                        break outer; 
     108                    } 
     109                } 
     110            } 
     111        } else { 
     112            intersect = geometry.intersects(this); 
     113        } 
     114        return intersect; 
     115    }, 
     116     
     117    /** 
     118     * Method: getSortedSegments 
     119     * 
     120     * Returns: 
     121     * {Array} An array of segment objects.  Segment objects have properties 
     122     *     x1, y1, x2, and y2.  The start point is represented by x1 and y1. 
     123     *     The end point is represented by x2 and y2.  Start and end are 
     124     *     ordered so that x1 < x2. 
     125     */ 
     126    getSortedSegments: function() { 
     127        var numSeg = this.components.length - 1; 
     128        var segments = new Array(numSeg); 
     129        for(var i=0; i<numSeg; ++i) { 
     130            point1 = this.components[i]; 
     131            point2 = this.components[i + 1]; 
     132            if(point1.x < point2.x) { 
     133                segments[i] = { 
     134                    x1: point1.x, 
     135                    y1: point1.y, 
     136                    x2: point2.x, 
     137                    y2: point2.y 
     138                } 
     139            } else { 
     140                segments[i] = { 
     141                    x1: point2.x, 
     142                    y1: point2.y, 
     143                    x2: point1.x, 
     144                    y2: point1.y 
     145                } 
     146            } 
     147        } 
     148        // more efficient to define this somewhere static 
     149        function byX1(seg1, seg2) { 
     150            return seg1.x1 - seg2.x1; 
     151        } 
     152        return segments.sort(byX1); 
     153    }, 
    44154 
    45155    CLASS_NAME: "OpenLayers.Geometry.LineString" 
    46156}); 
  • lib/OpenLayers/Geometry/Point.js

    old new  
    168168        this.y = origin.y + (scale * (this.y - origin.y)); 
    169169        this.clearBounds(); 
    170170    }, 
     171     
     172    /** 
     173     * APIMethod: intersects 
     174     * Determine if the input geometry intersects this one. 
     175     * 
     176     * Parameters: 
     177     * geometry - {<OpenLayers.Geometry>} Any type of geometry. 
     178     * 
     179     * Returns: 
     180     * {Boolean} The input geometry intersects this one. 
     181     */ 
     182    intersects: function(geometry) { 
     183        var intersect = false; 
     184        if(geometry.CLASS_NAME == "OpenLayers.Geometry.Point") { 
     185            intersect = this.equals(geometry); 
     186        } else { 
     187            intersect = geometry.intersects(this); 
     188        } 
     189        return intersect; 
     190    }, 
    171191 
    172192    CLASS_NAME: "OpenLayers.Geometry.Point" 
    173193}); 
  • lib/OpenLayers/Geometry/Polygon.js

    old new  
    5757        return area; 
    5858    }, 
    5959 
     60    /** 
     61     * Method: containsPoint 
     62     * Test if a point is inside a polygon.  Points on a polygon edge are 
     63     *     considered inside. 
     64     * 
     65     * Parameters: 
     66     * point - {<OpenLayers.Geometry.Point>} 
     67     * 
     68     * Returns: 
     69     * {Boolean | Number} The point is inside the polygon.  Returns 1 if the 
     70     *     point is on an edge.  Returns boolean otherwise. 
     71     */ 
     72    containsPoint: function(point) { 
     73        var numRings = this.components.length; 
     74        var contained = false; 
     75        if(numRings > 0) { 
     76            // check exterior ring - 1 means on edge, boolean otherwise 
     77            contained = this.components[0].containsPoint(point); 
     78            if(contained !== 1) { 
     79                if(contained && numRings > 1) { 
     80                    // check interior rings 
     81                    var hole; 
     82                    for(var i=1; i<numRings; ++i) { 
     83                        hole = this.components[i].containsPoint(point); 
     84                        if(hole) { 
     85                            if(hole === 1) { 
     86                                // on edge 
     87                                contained = 1; 
     88                            } else { 
     89                                // in hole 
     90                                contained = false; 
     91                            }                             
     92                            break; 
     93                        } 
     94                    } 
     95                } 
     96            } 
     97        } 
     98        return contained; 
     99    }, 
     100 
     101    /** 
     102     * APIMethod: intersects 
     103     * Determine if the input geometry intersects this one. 
     104     * 
     105     * Parameters: 
     106     * geometry - {<OpenLayers.Geometry>} Any type of geometry. 
     107     * 
     108     * Returns: 
     109     * {Boolean} The input geometry intersects this one. 
     110     */ 
     111    intersects: function(geometry) { 
     112        var intersect = false; 
     113        var i; 
     114        if(geometry.CLASS_NAME == "OpenLayers.Geometry.Point") { 
     115            intersect = this.containsPoint(geometry); 
     116        } else if(geometry.CLASS_NAME == "OpenLayers.Geometry.LineString" || 
     117                  geometry.CLASS_NAME == "OpenLayers.Geometry.LinearRing") { 
     118            // check if rings/linestrings intersect 
     119            for(i=0; i<this.components.length; ++i) { 
     120                intersect = geometry.intersects(this.components[i]); 
     121                if(intersect) { 
     122                    break; 
     123                } 
     124            } 
     125            if(!intersect) { 
     126                // check if this poly contains points of the ring/linestring 
     127                for(i=0; i<geometry.components.length; ++i) { 
     128                    intersect = this.containsPoint(geometry.components[i]); 
     129                    if(intersect) { 
     130                        break; 
     131                    } 
     132                } 
     133            } 
     134        } else { 
     135            for(i=0; i<geometry.components.length; ++ i) { 
     136                intersect = this.intersects(geometry.components[i]); 
     137                if(intersect) { 
     138                    break; 
     139                } 
     140            } 
     141        } 
     142        // check case where this poly is wholly contained by another 
     143        if(!intersect && geometry.CLASS_NAME == "OpenLayers.Geometry.Polygon") { 
     144            // exterior ring points will be contained in the other geometry 
     145            var ring = this.components[0]; 
     146            for(i=0; i<ring.components.length; ++i) { 
     147                intersect = geometry.containsPoint(ring.components[i]); 
     148                if(intersect) { 
     149                    break; 
     150                } 
     151            } 
     152        } 
     153        return intersect; 
     154    }, 
     155 
    60156    CLASS_NAME: "OpenLayers.Geometry.Polygon" 
    61157}); 
    62158 
  • tests/data/geos_wkt_intersects.js

    old new  
     1var geos_test_data = [ 
     2{'wkt1':'POLYGON ((100 100,100 200,200 200,200 100,100 100))', 'wkt2':'POLYGON ((100 100,1000000000000000.0 110.0,1000000000000000.0 100.0,100 100))', result:true}, 
     3{'wkt1':'POLYGON ((120 100,120 200,200 200,200 100,120 100))', 'wkt2':'POLYGON ((100 100,1000000000000000.0 110.0,1000000000000000.0 100.0,100 100))', result:true}, 
     4{'wkt1':'POLYGON ((20 20,20 100,120 100,140 20,20 20))', 'wkt2':'POLYGON ((20 20,20 100,120 100,140 20,20 20))', result:true}, 
     5{'wkt1':'POLYGON ((20 20,20 100,120 100,140 20,20 20))', 'wkt2':'POLYGON ((20 20,140 20,120 100,20 100,20 20))', result:true}, 
     6{'wkt1':'POLYGON ((20 20,20 100,120 100,140 20,20 20))', 'wkt2':'POLYGON ((120 100,140 20,20 20,20 100,120 100))', result:true}, 
     7{'wkt1':'POLYGON ((20 20,20 100,120 100,140 20,20 20))', 'wkt2':'POLYGON ((20 100,60 100,120 100,140 20,80 20,20 20,20 100))', result:true}, 
     8{'wkt1':'POLYGON ((0 0,80 0,80 80,0 80,0 0))', 'wkt2':'POLYGON ((100 200,100 140,180 140,180 200,100 200))', result:false}, 
     9{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((140 120,140 200,240 200,240 120,140 120))', result:true}, 
     10{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((80 180,140 260,260 200,200 60,80 180))', result:true}, 
     11{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((240 80,140 120,180 240,280 200,240 80))', result:true}, 
     12{'wkt1':'POLYGON ((140 160,20 20,270 20,150 160,230 40,60 40,140 160))', 'wkt2':'POLYGON ((140 40,180 80,120 100,140 40))', result:true}, 
     13{'wkt1':'POLYGON ((140 160,20 20,270 20,150 160,230 40,60 40,140 160))', 'wkt2':'POLYGON ((120 100,180 80,130 40,120 100))', result:true}, 
     14{'wkt1':'POLYGON ((20 20,180 20,140 140,20 140,20 20))', 'wkt2':'POLYGON ((180 100,80 200,180 280,260 200,180 100))', result:true}, 
     15{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((140 140,20 120,0 220,120 240,140 140))', result:true}, 
     16{'wkt1':'POLYGON ((160 200,210 70,120 70,160 200))', 'wkt2':'POLYGON ((160 200,260 40,70 40,160 200,20 20,310 20,160 200))', result:true}, 
     17{'wkt1':'POLYGON ((110 140,200 70,200 160,110 140))', 'wkt2':'POLYGON ((110 140,110 50,60 50,60 90,160 190,20 110,20 20,200 20,110 140))', result:true}, 
     18{'wkt1':'POLYGON ((20 120,20 20,260 20,260 120,200 40,140 120,80 40,20 120))', 'wkt2':'POLYGON ((20 120,20 240,260 240,260 120,200 200,140 120,80 200,20 120))', result:true}, 
     19{'wkt1':'POLYGON ((20 120,20 20,260 20,260 120,180 40,140 120,100 40,20 120))', 'wkt2':'POLYGON ((20 120,300 120,140 240,20 120))', result:true}, 
     20{'wkt1':'POLYGON ((20 20,20 300,280 300,280 260,220 260,60 100,60 60,280 60,280 20,20 20))', 'wkt2':'POLYGON ((100 140,160 80,280 180,200 240,220 160,160 200,180 120,100 140))', result:true}, 
     21{'wkt1':'POLYGON ((20 20,20 300,280 300,280 260,220 260,60 100,60 60,280 60,280 20,20 20))', 'wkt2':'POLYGON ((260 200,180 80,120 160,200 160,180 220,260 200))', result:true}, 
     22{'wkt1':'POLYGON ((20 20,280 20,280 140,220 60,140 140,80 60,20 140,20 20))', 'wkt2':'POLYGON ((0 140,300 140,140 240,0 140))', result:true}, 
     23{'wkt1':'POLYGON ((20 20,280 20,280 140,220 60,140 140,80 60,20 140,20 20))', 'wkt2':'POLYGON ((20 240,20 140,320 140,180 240,20 240))', result:true}, 
     24{'wkt1':'POLYGON ((20 20,280 20,280 140,220 60,140 140,80 60,20 140,20 20))', 'wkt2':'POLYGON ((20 240,20 140,80 180,140 140,220 180,280 140,280 240,20 240))', result:true}, 
     25{'wkt1':'POLYGON ((120 120,180 60,20 20,20 120,120 120))', 'wkt2':'POLYGON ((120 120,220 20,280 20,240 160,120 120))', result:true}, 
     26{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((140 120,160 20,260 120,220 200,140 120))', result:true}, 
     27{'wkt1':'POLYGON ((20 140,120 40,20 40,20 140))', 'wkt2':'POLYGON ((190 140,190 20,140 20,20 140,190 140))', result:true}, 
     28{'wkt1':'POLYGON ((120 120,180 60,20 20,20 120,120 120))', 'wkt2':'POLYGON ((300 20,220 20,120 120,260 160,300 20))', result:true}, 
     29{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((140 120,240 160,280 60,160 20,140 120))', result:true}, 
     30{'wkt1':'POLYGON ((120 120,180 60,20 20,20 120,120 120))', 'wkt2':'POLYGON ((280 60,180 60,120 120,260 180,280 60))', result:true}, 
     31{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((120 200,120 120,40 120,40 200,120 200))', result:true}, 
     32{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((160 220,140 120,60 120,40 220,160 220))', result:true}, 
     33{'wkt1':'POLYGON ((140 120,160 20,20 20,20 120,140 120))', 'wkt2':'POLYGON ((140 120,20 120,20 220,140 220,140 120))', result:true}, 
     34{'wkt1':'POLYGON ((120 120,180 60,20 20,20 120,120 120))', 'wkt2':'POLYGON ((320 20,220 20,80 160,240 140,320 20))', result:true}, 
     35{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((60 40,60 140,180 140,180 40,60 40))', result:true}, 
     36{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,80 140,160 60,20 20))', result:true}, 
     37{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((160 60,20 20,100 140,160 60))', result:true}, 
     38{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 100,140 160,160 40,20 100))', result:true}, 
     39{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((160 40,20 100,160 160,160 40))', result:true}, 
     40{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 180,180 120,80 40,20 180))', result:true}, 
     41{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((180 120,100 40,20 180,180 120))', result:true}, 
     42{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,140 40,140 120,20 160,80 80,20 20))', result:true}, 
     43{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,140 40,140 140,20 180,80 100,20 20))', result:true}, 
     44{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((40 180,60 100,180 100,200 180,120 120,40 180))', result:true}, 
     45{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 180,60 80,180 80,220 180,120 120,20 180))', result:true}, 
     46{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((40 60,20 180,100 100,140 180,160 120,220 100,140 40,40 60))', result:true}, 
     47{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((60 100,180 100,220 180,120 140,20 180,60 100))', result:true}, 
     48{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,20 140,120 120,120 40,20 20))', result:true}, 
     49{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,20 180,140 140,140 60,20 20))', result:true}, 
     50{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,120 40,120 120,20 140,20 20))', result:true}, 
     51{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((120 40,20 20,20 140,120 120,120 40))', result:true}, 
     52{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,140 60,140 140,20 180,20 20))', result:true}, 
     53{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((140 60,20 20,20 180,140 140,140 60))', result:true}, 
     54{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,60 120,140 120,180 20,20 20))', result:true}, 
     55{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 40,120 40,120 120,20 140,20 40))', result:true}, 
     56{'wkt1':'POLYGON ((20 20,20 180,220 180,220 20,20 20))', 'wkt2':'POLYGON ((20 20,20 180,60 120,100 180,140 120,220 180,200 120,140 60,20 20))', result:true}, 
     57{'wkt1':'POLYGON ((150 150,330 150,250 70,70 70,150 150))', 'wkt2':'POLYGON ((150 150,270 150,140 20,20 20,150 150))', result:true}, 
     58{'wkt1':'POLYGON ((150 150,270 150,330 150,250 70,190 70,70 70,150 150))', 'wkt2':'POLYGON ((150 150,270 150,190 70,140 20,20 20,70 70,150 150))', result:true}, 
     59{'wkt1':'POLYGON ((20 20,60 50,20 40,60 70,20 60,60 90,20 90,70 110,20 130,80 130,20 150,80 160,20 170,80 180,20 200,80 200,30 240,80 220,50 260,100 220,100 260,120 220,130 260,140 220,150 280,150 190,160 280,170 190,180 280,190 190,200 280,210 190,220 280,230 190,240 260,250 230,260 260,260 220,290 270,290 220,330 260,300 210,340 240,290 180,340 210,290 170,350 170,240 150,350 150,240 140,350 130,240 120,350 120,240 110,350 110,240 100,350 100,240 90,350 90,240 80,350 80,300 70,340 60,290 60,340 40,300 50,340 20,270 60,310 20,250 60,270 20,230 60,240 20,210 60,210 20,190 70,190 20,180 90,170 20,160 90,150 20,140 90,130 20,120 90,110 20,100 90,100 20,90 60,80 20,70 40,20 20))', 'wkt2':'POLYGON ((190 140,140 130,200 160,130 150,210 170,130 170,210 180,120 190,220 200,120 200,250 210,120 210,250 220,120 220,250 230,120 240,230 240,120 250,240 260,120 260,240 270,120 270,270 290,120 290,230 300,150 310,250 310,180 320,250 320,200 360,260 330,240 360,280 320,290 370,290 320,320 360,310 320,360 360,310 310,380 340,310 290,390 330,310 280,410 310,310 270,420 280,310 260,430 250,300 250,440 240,300 240,450 230,280 220,440 220,280 210,440 210,300 200,430 190,300 190,440 180,330 180,430 150,320 180,420 130,300 180,410 120,280 180,400 110,280 170,390 90,280 160,400 70,270 160,450 30,260 160,420 30,250 160,390 30,240 160,370 30,230 160,360 30,230 150,330 50,240 130,330 30,230 130,310 30,220 130,280 30,230 100,270 40,220 110,250 30,210 130,240 30,210 100,220 40,200 90,200 20,190 100,180 30,20 20,180 40,20 30,180 50,20 50,180 60,30 60,180 70,20 70,170 80,80 80,170 90,20 80,180 100,40 100,200 110,60 110,200 120,120 120,190 140))', result:true}, 
     60{'wkt1':'POLYGON ((70 150,20 160,110 160,20 180,100 200,20 200,190 210,20 210,160 220,20 220,150 230,60 240,180 250,20 260,170 260,60 270,160 270,100 310,170 280,200 260,180 230,210 260,130 330,230 250,210 290,240 250,230 210,260 300,250 230,270 300,270 240,300 340,280 250,320 330,290 250,340 350,290 240,350 360,270 190,350 340,290 200,350 330,300 190,360 320,310 190,360 300,320 200,360 280,330 200,360 260,340 200,370 260,340 180,390 290,340 170,400 260,350 170,400 250,350 160,410 240,350 150,400 170,350 140,310 170,340 140,270 180,330 140,260 170,310 140,240 170,290 140,200 190,270 140,180 190,260 140,170 190,260 130,170 180,250 130,170 170,240 120,170 160,210 120,170 150,210 110,340 130,230 110,420 140,220 100,410 130,220 90,400 120,220 80,390 110,220 70,420 110,240 70,420 100,260 70,420 90,280 70,430 80,230 60,430 60,270 50,450 40,210 50,370 40,260 40,460 30,160 40,210 60,200 110,190 60,190 120,170 50,180 130,150 30,170 130,140 20,160 120,130 20,160 150,120 20,160 170,110 20,160 190,100 20,150 190,90 20,140 180,80 20,120 140,70 20,120 150,60 20,110 150,50 20,100 140,50 30,90 130,40 30,80 120,30 30,80 130,30 40,80 140,20 40,70 140,40 90,60 130,20 90,60 140,20 130,70 150))', 'wkt2':'POLYGON ((190 140,140 130,200 160,130 150,210 170,130 170,210 180,120 190,220 200,120 200,250 210,120 210,250 220,120 220,250 230,120 240,230 240,120 250,240 260,120 260,240 270,120 270,270 290,120 290,230 300,150 310,250 310,180 320,250 320,200 360,260 330,240 360,280 320,290 370,290 320,320 360,310 320,360 360,310 310,380 340,310 290,390 330,310 280,410 310,310 270,420 280,310 260,430 250,300 250,440 240,300 240,450 230,280 220,440 220,280 210,440 210,300 200,430 190,300 190,440 180,330 180,430 150,320 180,420 130,300 180,410 120,280 180,400 110,280 170,390 90,280 160,400 70,270 160,450 30,260 160,420 30,250 160,390 30,240 160,370 30,230 160,360 30,230 150,330 50,240 130,330 30,230 130,310 30,220 130,280 30,230 100,270 40,220 110,250 30,210 130,240 30,210 100,220 40,200 90,200 20,190 100,180 30,20 20,180 40,20 30,180 50,20 50,180 60,30 60,180 70,20 70,170 80,80 80,170 90,20 80,180 100,40 100,200 110,60 110,200 120,120 120,190 140))', result:true}, 
     61{'wkt1':'POLYGON ((60 160,220 160,220 20,60 20,60 160))', 'wkt2':'POLYGON ((60 160,20 200,260 200,220 160,140 80,60 160))', result:true}, 
     62{'wkt1':'POLYGON ((60 160,220 160,220 20,60 20,60 160))', 'wkt2':'POLYGON ((60 160,20 200,260 200,140 80,60 160))', result:true}, 
     63{'wkt1':'POLYGON ((60 160,220 160,220 20,60 20,60 160))', 'wkt2':'POLYGON ((20 200,140 80,260 200,20 200))', result:true}, 
     64{'wkt1':'POLYGON ((60 160,220 160,220 20,60 20,60 160))', 'wkt2':'POLYGON ((20 200,60 160,140 80,220 160,260 200,20 200))', result:true}, 
     65{'wkt1':'POLYGON ((60 160,220 160,220 20,60 20,60 160))', 'wkt2':'POLYGON ((20 200,60 160,140 80,260 200,20 200))', result:true}, 
     66{'wkt1':'POLYGON ((0 0,0 200,200 200,200 0,0 0))', 'wkt2':'POLYGON ((100 100,1000000 110,10000000 100,100 100))', result:true}, 
     67{'wkt1':'POLYGON ((100 0,100 200,200 200,200 0,100 0))', 'wkt2':'POLYGON ((100 100,1000000 110,10000000 100,100 100))', result:true}, 
     68{'wkt1':'POLYGON ((120 0,120 200,200 200,200 0,120 0))', 'wkt2':'POLYGON ((100 100,1000000 110,10000000 100,100 100))', result:true}, 
     69{'wkt1':'POLYGON ((0 0,0 200,110 200,110 0,0 0))', 'wkt2':'POLYGON ((100 100,1000000 110,10000000 100,100 100))', result:true}, 
     70{'wkt1':'POLYGON ((100 100,100 200,200 200,200 100,100 100))', 'wkt2':'POLYGON ((100 100,2100 110,2100 100,100 100))', result:true}, 
     71{'wkt1':'POLYGON ((100 100,100 200,200 200,200 100,100 100))', 'wkt2':'POLYGON ((100 100,2101 110,2101 100,100 100))', result:true}, 
     72{'wkt1':'POLYGON ((100 100,200 200,200 100,100 100))', 'wkt2':'POLYGON ((100 100,2101 110,2101 100,100 100))', result:true}, 
     73{'wkt1':'POLYGON ((100 100,100 200,200 200,200 100,100 100))', 'wkt2':'POLYGON ((100 100,1000000 110,1000000 100,100 100))', result:true}, 
     74{'wkt1':'POLYGON ((120 100,120 200,200 200,200 100,120 100))', 'wkt2':'POLYGON ((100 100,500 110,500 100,100 100))', result:true}, 
     75{'wkt1':'POLYGON ((120 100,120 200,200 200,200 100,120 100))', 'wkt2':'POLYGON ((100 100,501 110,501 100,100 100))', result:true}, 
     76{'wkt1':'POLYGON ((120 100,130 200,200 200,200 100,120 100))', 'wkt2':'POLYGON ((100 100,501 110,501 100,100 100))', result:true}, 
     77{'wkt1':'POLYGON ((120 100,17 200,200 200,200 100,120 100))', 'wkt2':'POLYGON ((100 100,501 110,501 100,100 100))', result:true}, 
     78{'wkt1':'POLYGON ((120 100,120 200,200 200,200 100,120 100))', 'wkt2':'POLYGON ((100 100,1000000 110,1000000 100,100 100))', result:true}, 
     79{'wkt1':'POLYGON ((101 99,101 1000000,102 1000000,101 99))', 'wkt2':'POLYGON ((100 100,1000000 110,1000000 100,100 100))', result:true}, 
     80{'wkt1':'POLYGON ((100 100,200 101,200 100,100 100))', 'wkt2':'POLYGON ((100 100,2101 110,2101 100,100 100))', result:true}, 
     81{'wkt1':'POLYGON ((16 319,150 39,25 302,160 20,265 20,127 317,16 319))', 'wkt2':'POLYGON ((10 307,22 307,153 34,22 34,10 307))', result:true}, 
     82{'wkt1':'POLYGON ((160 200,210 70,120 70,160 200))', 'wkt2':'POLYGON ((160 200,310 20,20 20,160 200),(160 200,260 40,70 40,160 200))', result:true}, 
     83{'wkt1':'POLYGON ((170 120,240 100,260 50,190 70,170 120))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     84{'wkt1':'POLYGON ((270 90,200 50,150 80,210 120,270 90))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     85{'wkt1':'POLYGON ((170 120,260 100,240 60,150 80,170 120))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     86{'wkt1':'POLYGON ((220 120,270 80,200 60,160 100,220 120))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     87{'wkt1':'POLYGON ((260 50,180 70,180 110,260 90,260 50))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     88{'wkt1':'POLYGON ((230 110,290 80,190 60,140 90,230 110))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     89{'wkt1':'POLYGON ((170 120,330 120,260 50,100 50,170 120))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     90{'wkt1':'POLYGON ((170 120,330 120,280 70,120 70,170 120))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     91{'wkt1':'POLYGON ((170 120,300 120,250 70,120 70,170 120))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     92{'wkt1':'POLYGON ((190 100,310 100,260 50,140 50,190 100))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     93{'wkt1':'POLYGON ((280 130,360 130,270 40,190 40,280 130))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,250 120,180 50,100 50,170 120))', result:true}, 
     94{'wkt1':'POLYGON ((220 80,180 40,80 40,170 130,270 130,230 90,300 90,250 30,280 30,390 140,150 140,40 30,230 30,280 80,220 80))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,250 120,180 50,100 50,170 120))', result:true}, 
     95{'wkt1':'POLYGON ((260 130,360 130,280 40,170 40,260 130))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,250 120,180 50,100 50,170 120))', result:true}, 
     96{'wkt1':'POLYGON ((240 110,340 110,290 60,190 60,240 110))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,250 120,180 50,100 50,170 120))', result:true}, 
     97{'wkt1':'POLYGON ((250 120,350 120,280 50,180 50,250 120))', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,250 120,180 50,100 50,170 120))', result:true}, 
     98{'wkt1':'POLYGON ((230 210,230 20,20 20,20 210,230 210),(120 180,50 50,200 50,120 180))', 'wkt2':'POLYGON ((230 210,230 20,20 20,20 210,230 210),(120 180,50 50,200 50,120 180))', result:true}, 
     99{'wkt1':'POLYGON ((230 210,230 20,20 20,20 210,230 210),(140 40,40 40,40 170,140 40),(110 190,210 190,210 50,110 190))', 'wkt2':'POLYGON ((230 210,230 20,20 20,20 210,230 210),(140 40,40 40,40 170,140 40),(110 190,210 190,210 50,110 190))', result:true}, 
     100{'wkt1':'POLYGON ((280 190,330 150,200 110,150 150,280 190))', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     101{'wkt1':'POLYGON ((80 190,220 190,140 110,0 110,80 190))', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     102{'wkt1':'POLYGON ((330 150,200 110,150 150,280 190,330 150))', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     103{'wkt1':'POLYGON ((290 190,340 150,220 120,170 170,290 190))', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     104{'wkt1':'POLYGON ((220 190,340 190,260 110,140 110,220 190))', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     105{'wkt1':'POLYGON ((140 190,220 190,100 70,20 70,140 190))', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     106{'wkt1':'POLYGON ((140 220,60 140,140 60,220 140,140 220))', 'wkt2':'MULTIPOLYGON (((100 20,180 20,180 100,100 100,100 20)),((20 100,100 100,100 180,20 180,20 100)),((100 180,180 180,180 260,100 260,100 180)),((180 100,260 100,260 180,180 180,180 100)))', result:true}, 
     107{'wkt1':'MULTIPOLYGON (((110 110,70 200,150 200,110 110)),((110 110,150 20,70 20,110 110)))', 'wkt2':'MULTIPOLYGON (((110 110,160 160,210 110,160 60,110 110)),((110 110,60 60,10 110,60 160,110 110)))', result:true}, 
     108{'wkt1':'MULTIPOLYGON (((110 110,70 200,150 200,110 110),(110 110,100 180,120 180,110 110)),((110 110,150 20,70 20,110 110),(110 110,120 40,100 40,110 110)))', 'wkt2':'MULTIPOLYGON (((110 110,160 160,210 110,160 60,110 110),(110 110,160 130,160 90,110 110)),((110 110,60 60,10 110,60 160,110 110),(110 110,60 90,60 130,110 110)))', result:true}, 
     109{'wkt1':'MULTIPOLYGON (((110 110,70 200,200 200,110 110),(110 110,100 180,120 180,110 110)),((110 110,200 20,70 20,110 110),(110 110,120 40,100 40,110 110)))', 'wkt2':'MULTIPOLYGON (((110 110,160 160,210 110,160 60,110 110),(110 110,160 130,160 90,110 110)),((110 110,60 60,10 110,60 160,110 110),(110 110,60 90,60 130,110 110)))', result:true}, 
     110{'wkt1':'MULTIPOLYGON (((110 110,20 200,200 200,110 110),(110 110,100 180,120 180,110 110)),((110 110,200 20,20 20,110 110),(110 110,120 40,100 40,110 110)))', 'wkt2':'MULTIPOLYGON (((110 110,160 160,210 110,160 60,110 110),(110 110,160 130,160 90,110 110)),((110 110,60 60,10 110,60 160,110 110),(110 110,60 90,60 130,110 110)))', result:true}, 
     111{'wkt1':'MULTIPOLYGON (((110 110,70 200,200 200,110 110),(110 110,100 180,120 180,110 110)),((110 110,200 20,70 20,110 110),(110 110,120 40,100 40,110 110)))', 'wkt2':'MULTIPOLYGON (((110 110,160 160,210 110,160 60,110 110),(110 110,160 130,160 90,110 110)),((110 110,60 60,10 110,60 160,110 110),(110 110,60 90,60 130,110 110)))', result:true}, 
     112{'wkt1':'MULTIPOLYGON (((110 110,70 200,200 200,110 110),(110 110,100 180,120 180,110 110)),((110 110,200 20,70 20,110 110),(110 110,120 40,100 40,110 110)))', 'wkt2':'MULTIPOLYGON (((110 110,70 200,210 110,70 20,110 110),(110 110,110 140,150 110,110 80,110 110)),((110 110,60 60,10 110,60 160,110 110),(110 110,60 90,60 130,110 110)))', result:true}, 
     113{'wkt1':'POLYGON ((100 60,140 100,100 140,60 100,100 60))', 'wkt2':'MULTIPOLYGON (((80 40,120 40,120 80,80 80,80 40)),((120 80,160 80,160 120,120 120,120 80)),((80 120,120 120,120 160,80 160,80 120)),((40 80,80 80,80 120,40 120,40 80)))', result:true}, 
     114{'wkt1':'LINESTRING (150 150,40 230)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     115{'wkt1':'LINESTRING (40 40,50 130,130 130)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     116{'wkt1':'LINESTRING (40 230,150 150)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     117{'wkt1':'LINESTRING (210 150,330 150)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     118{'wkt1':'LINESTRING (200 150,310 150,360 220)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     119{'wkt1':'LINESTRING (180 150,250 150,230 250,370 250,410 150)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     120{'wkt1':'LINESTRING (210 210,220 150,320 150,370 210)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     121{'wkt1':'LINESTRING (20 60,150 60)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     122{'wkt1':'LINESTRING (60 90,310 180)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     123{'wkt1':'LINESTRING (90 210,210 90)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     124{'wkt1':'LINESTRING (290 10,130 170)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     125{'wkt1':'LINESTRING (30 100,100 100,180 100)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     126{'wkt1':'LINESTRING (20 100,100 100,360 100,410 100)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     127{'wkt1':'LINESTRING (90 210,150 150,210 90)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     128{'wkt1':'LINESTRING (180 90,280 120)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     129{'wkt1':'LINESTRING (70 70,80 20)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     130{'wkt1':'LINESTRING (130 20,150 60)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     131{'wkt1':'LINESTRING (70 70,80 20,140 20,150 60)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     132{'wkt1':'LINESTRING (170 50,170 20,240 20,260 60)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150))', result:true}, 
     133{'wkt1':'LINESTRING (50 100,140 190,280 190)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:false}, 
     134{'wkt1':'LINESTRING (140 60,180 100,290 100)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:false}, 
     135{'wkt1':'LINESTRING (170 120,210 80,270 80)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     136{'wkt1':'LINESTRING (170 120,260 50)', 'wkt2':'POLYGON ((150 150,410 150,280 20,20 20,150 150),(170 120,330 120,260 50,100 50,170 120))', result:true}, 
     137{'wkt1':'LINESTRING (190 90,190 270)', 'wkt2':'POLYGON ((190 190,360 20,20 20,190 190),(190 190,280 50,100 50,190 190))', result:true}, 
     138{'wkt1':'LINESTRING (60 160,150 70)', 'wkt2':'POLYGON ((190 190,360 20,20 20,190 190),(110 110,250 100,140 30,110 110))', result:true}, 
     139{'wkt1':'LINESTRING (60 160,150 70)', 'wkt2':'POLYGON ((190 190,20 20,360 20,190 190),(250 100,110 110,140 30,250 100))', result:true}, 
     140{'wkt1':'LINESTRING (60 160,150 70)', 'wkt2':'POLYGON ((190 190,20 20,360 20,190 190),(250 100,110 110,140 30,250 100))', result:true}, 
     141{'wkt1':'LINESTRING (190 90,190 190,190 270)', 'wkt2':'POLYGON ((190 190,360 20,20 20,190 190),(190 190,280 50,100 50,190 190))', result:true}, 
     142{'wkt1':'LINESTRING (60 160,110 110,150 70)', 'wkt2':'POLYGON ((190 190,360 20,20 20,190 190),(110 110,250 100,140 30,110 110))', result:true}, 
     143{'wkt1':'LINESTRING (60 160,110 110,150 70)', 'wkt2':'POLYGON ((190 190,20 20,360 20,190 190),(250 100,110 110,140 30,250 100))', result:true}, 
     144{'wkt1':'LINESTRING (60 160,110 110,150 70)', 'wkt2':'POLYGON ((190 190,110 110,20 20,360 20,190 190),(250 100,110 110,140 30,250 100))', result:true}, 
     145{'wkt1':'LINESTRING (130 110,180 110,190 60)', 'wkt2':'POLYGON ((20 200,240 200,240 20,20 20,20 200),(130 110,60 180,60 40,130 110),(130 110,200 40,200 180,130 110))', result:true}, 
     146{'wkt1':'LINESTRING (80 110,180 110)', 'wkt2':'POLYGON ((20 200,240 200,240 20,20 20,20 200),(130 110,60 180,60 40,130 110),(130 110,200 40,200 180,130 110))', result:true}, 
     147{'wkt1':'LINESTRING (80 110,180 110)', 'wkt2':'POLYGON ((20 200,20 20,240 20,240 200,20 200),(60 180,130 110,60 40,60 180),(130 110,200 40,200 180,130 110))', result:true}, 
     148{'wkt1':'LINESTRING (80 110,170 110)', 'wkt2':'POLYGON ((20 200,20 20,240 20,240 200,20 200),(130 110,60 40,60 180,130 110),(130 180,130 40,200 110,130 180))', result:true}, 
     149{'wkt1':'LINESTRING (80 110,130 110,170 110)', 'wkt2':'POLYGON ((20 200,20 20,240 20,240 200,20 200),(130 110,60 40,60 180,130 110),(130 180,130 40,200 110,130 180))', result:true}, 
     150{'wkt1':'LINESTRING (80 110,130 110,180 110)', 'wkt2':'POLYGON ((20 200,240 200,240 20,20 20,20 200),(130 110,60 180,60 40,130 110),(130 110,200 40,200 180,130 110))', result:true}, 
     151{'wkt1':'LINESTRING (80 110,130 110,180 110)', 'wkt2':'POLYGON ((20 200,20 20,240 20,240 200,20 200),(60 180,130 110,60 40,60 180),(130 110,200 40,200 180,130 110))', result:true}, 
     152{'wkt1':'LINESTRING (80 110,130 110,170 110)', 'wkt2':'POLYGON ((20 200,20 20,240 20,240 200,20 200),(130 110,60 40,60 180,130 110),(130 180,130 40,200 110,130 180))', result:true}, 
     153{'wkt1':'LINESTRING (160 70,320 230)', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     154{'wkt1':'LINESTRING (160 70,200 110,280 190,320 230)', 'wkt2':'MULTIPOLYGON (((140 110,260 110,170 20,50 20,140 110)),((300 270,420 270,340 190,220 190,300 270)))', result:true}, 
     155{'wkt1':'LINESTRING (70 50,70 150)', '