<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This behavior appears to be deep into the MapServer code.<div><br></div><div>select.php eventually calls mapquery.c:msQueryByShape which ends up in the mapsearch.c:msIntersect* calls.<br><div><br></div><div>I suspect it has something to do with these all being edge cases rather than clear intersections.  The one bit I was able to see from the code is that setting TOLERANCE larger than 0 might help stabilize the results.  Otherwise it is patches to mapserver or switching the PHP to do the query outside of mapscript (maybe using GEOS or PostGIS directly?).</div><div><br><div><div>On Jul 31, 2013, at 11:38 AM, Bistrais, Bob wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Exactly the kind of thing I’m seeing.  Here’s a sample of my experience…<o:p></o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span><image001.png></span><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p></o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">…Notice that 1077 (upper left of selected) has not selected.<o:p></o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; "><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space"> </span>Jim Klassen [mailto:klassen.js@gmail.com]<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>Wednesday, July 31, 2013 12:35 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Bistrais, Bob<br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:eadam@co.lincoln.or.us" style="color: blue; text-decoration: underline; ">eadam@co.lincoln.or.us</a>;<span class="Apple-converted-space"> </span><a href="mailto:geomoose-users@lists.osgeo.org" style="color: blue; text-decoration: underline; ">geomoose-users@lists.osgeo.org</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [Geomoose-users] strange problem with select<o:p></o:p></span></div></div></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">Although, this one puzzles me.  Parcels, 100ft, Parcels:  I would have thought '1025 would be selected since it touches the orange line (unless the parcels dataset has some topology issues.)<o:p></o:p></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span><image002.jpg></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">On Jul 31, 2013, at 10:48 AM, Bistrais, Bob wrote:<o:p></o:p></div></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><br><br><o:p></o:p></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Hi Eli,</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">It appears to be random which adjacent polygons are selected. </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Actually, yes, I see the same issue in the demo- try the Select Features tool.  Use a buffer of 20 feet or so, using features in Parcels.  Now select a parcel and hit Go.  You’ll see that it selects some of the adjacent parcels, but not all of them (at least not in my testing).  Try it and you’ll see what I mean.</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">If you select just one polygon, then do the “Buffer these results”, I am finding it more consistent in selecting the adjacent polygons.</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span class="apple-converted-space"><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "> </span></span><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">Eli Adam [<a href="mailto:eadam@co.lincoln.or.us" style="color: blue; text-decoration: underline; ">mailto:eadam@co.lincoln.or.us</a>]<span class="apple-converted-space"> </span><br><b>Sent:</b><span class="apple-converted-space"> </span>Wednesday, July 31, 2013 11:20 AM<br><b>To:</b><span class="apple-converted-space"> </span>Bistrais, Bob<br><b>Cc:</b><span class="apple-converted-space"> </span><a href="mailto:geomoose-users@lists.osgeo.org" style="color: blue; text-decoration: underline; ">geomoose-users@lists.osgeo.org</a><br><b>Subject:</b><span class="apple-converted-space"> </span>Re: [Geomoose-users] strange problem with select</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div><div><p class="MsoNormal" style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 12pt; ">Bob,<br><br><br><o:p></o:p></p><div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">On Tue, Jul 30, 2013 at 1:29 PM, Bistrais, Bob <<a href="mailto:Bob.Bistrais@maine.gov" target="_blank" style="color: blue; text-decoration: underline; ">Bob.Bistrais@maine.gov</a>> wrote:<o:p></o:p></div></div><div><div><p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">I am working on a GM parcel application (GM 2.6.1).  I was testing the buffered select service.  With no buffering (just select by mouse), it seems to work fine.  On the buffered select I encounter a weird problem.   If you select a parcel, set a buffer distance and query layer (the parcels), click Go- it selects only a few of the surrounding parcels.  In other words, if I set a buffer distance of 50 or 100 I’d expect to get all adjacent parcels selected, but it only selects some of the expected result.<o:p></o:p></p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><br>Is it random which ones are selected?  Is it a shift one way or the other?  Area you able to see this in the demo?  Are some never selected?  Do you know if you have invalid/odd geometries or data in those areas?  If you have a PostGIS instance handy, you might want to load it up and run ST_IsValid (<a href="http://postgis.net/docs/manual-2.0/ST_IsValid.html" target="_blank" style="color: blue; text-decoration: underline; ">http://postgis.net/docs/manual-2.0/ST_IsValid.html</a>) or similar functions to see if there is any pattern of this problem with something that might be in the data. <o:p></o:p></div></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">This isn't a lot of detail to try and figure it out.  You might be able to get more info from checking the requests and responses in firebug (i.e. perhaps it is a bad request vs. bad response vs. bad handling of a correct response, etc). <o:p></o:p></div></div></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div></div><div><p class="MsoNormal" style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 12pt; ">I hope these ideas lead to something useful.<o:p></o:p></p></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">Eli<o:p></o:p></div></div></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div></div><blockquote style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 6pt; margin-left: 4.8pt; margin-top: 5pt; margin-right: 0in; margin-bottom: 5pt; border-width: initial; border-color: initial; "><div><div><p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p><p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">The data is a shapefile, if that matters.   Although I had started modifying the select.php for my project, I went back to the original when I discovered the problem, and it’s still doing it.  Any idea what’s going on?<o:p></o:p></p></div></div><p class="MsoNormal" style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 12pt; "><br>_______________________________________________<br>Geomoose-users mailing list<br><a href="mailto:Geomoose-users@lists.osgeo.org" target="_blank" style="color: blue; text-decoration: underline; ">Geomoose-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/geomoose-users" target="_blank" style="color: blue; text-decoration: underline; ">http://lists.osgeo.org/mailman/listinfo/geomoose-users</a><o:p></o:p></p></blockquote></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div></div></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">_______________________________________________<br>Geomoose-users mailing list<br><a href="mailto:Geomoose-users@lists.osgeo.org" style="color: blue; text-decoration: underline; ">Geomoose-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/geomoose-users" style="color: blue; text-decoration: underline; ">http://lists.osgeo.org/mailman/listinfo/geomoose-users</a><o:p></o:p></div></div></div><p class="MsoNormal" style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "></p></div></div></div></span></blockquote></div><br></div></div></body></html>