<html>
<head>
        <title></title>
        
<meta name="GENERATOR" content="MSHTML 8.00.6001.18783"></meta>
</head>

<body>
        
<div>As written in ticket #63 and #137 I have rewritten the oplygon-polygon measuring.</div>
        
<div> </div>
        
<div>Here I post a shapefile with one ugly polygon and one more normal.</div>
        
<div>I don't know how common problem it is to work with this ugly ones, but I had to do it the other day and this will help me a lot.</div>
        
<div> </div>
        
<div> </div>
        
<div>if I run :</div>
        
<div> </div>
        
<div>select st_distance(a.the_geom, b.the_geom) from example a, example b where a.objektid = 1 and b.objektid =2</div>
        
<div> </div>
        
<div>I now get a querytime on about 720 ms to compare with more than 6 seconds before.</div>
        
<div> </div>
        
<div> </div>
        
<div>I also tried to use the bounding-box as a shortcircuit to determine if the polygons shared bbox and otherwise go directly on just comparing outer-rings. But that wasn't that easy as I understood it when the headers for handling the bboxes is in the postgis folder. But I don't tkink this way of doing it seems to be that much heavier. </div>
        
<div> </div>
        
<div> </div>
        
<div> </div>
        
<div> </div>
        
<div>Something interesting to note is that I tried this polygon on an old Arcview 3.2 installation and that is fast, very, very fast. </div>
        
<div>I don't understand how they did it and I doubt that arcgis of today can compare. But I had one test where I had a different result in Arcview and I think I could prove that postgis was right and Arcview wrong, so maybe they are taking som shortcircuit to much.</div>
        
<div> </div>
        
<div>to try in arcview 3.x just run an avenue-script like:</div>
        
<div>Script.The.SetNumberFormat( "d.ddddd" )<br />
                vyn = av.finddoc("view1")<br />
                temat = vyn.findtheme("example.shp")<br />
                ftabben = temat.getftab<br />
                shpfld = ftabben.findfield("shape")</div>
        
<div>thedist = ftabben.returnvalue(shpfld,0).distance(ftabben.returnvalue(shpfld,1))<br />
                msgbox.info(thedist.asstring,"")</div>
        
<div> </div>
        
<div>Greetings</div>
        
<div>Nicklas</div>
        
<div> </div>
</body>
</html>