<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div id="bloop_customfont" style="margin: 0px;">I have a table of land parcels in my PostGIS database, and I'm doing a basic spatial join against zoning polygons.</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">I'm having issues where a previously-correct query is now returning different results.</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">Up until now, I've been using a Geoserver WFS, and making these queries using CQL's INTERSECT operation. This operation generates a PostGIS query like so:</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">SELECT * FROM "public"."planning_zones" WHERE "geom" && ST_GeomFromWKB($1, 4326) AND ST_Intersects("geom", ST_GeomFromWKB($2, 4326)) LIMIT <a href="tel://1000000">1000000</a></div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">As my land parcel dataset is snapped to my zoning polygons, this query causes Geoserver to return a single record.</div></div><div class="bloop_container" style="font-family: 'helvetica Neue', helvetica; font-size: 14px;"><div class="bloop_frame"></div></div><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px;"><br></div><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px;">Now, I'm refactoring that query into a JSON API I'm building, and I'm recreating that PostGIS query, and making the query directly to Postgres (not Geoserver).</div><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px;"><br></div><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px;">The problem is that the query is now returning multiple zoning polygons. The difference is that I'm directly joining the zoning polys to the parcels:</div><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px;"><br></div><div style="font-family: 'helvetica Neue', helvetica; font-size: 14px;"><div>SELECT * FROM zones AS z, parcels AS p ON ST_Intersects(z.geom, p.geom) WHERE p.id = 99 AND z.geom && p.geom</div><div><br></div><div>This new query is returning multiple results, including polygons that share a boundary. This didn't happen before.</div><div><br></div><div>Can anyone shed any light on why this might be happening? My suspicions are that the tolerance of the Geoserver query differs to the raw PostGIS query, but I'm uncertain how to best affect this.</div></div></div><div class="bloop_container"><div class="bloop_frame">  </div></div><br><div class="bloop_sign" id="bloop_sign_1464097479710269952"><div><div style="font-family: Helvetica, Arial;"><font face="Georgia"><span style="line-height: normal;">▬▬▬ι═══════</span></font><span style="font-family: Georgia; line-height: normal;">═</span><span style="line-height: normal; font-family: Georgia;">═══ﺤ</span></div><div style="font-family: Helvetica, Arial;"><font face="Georgia"><span style="line-height: normal;">Timothy Asquith // Red Ronin</span><br style="line-height: normal;"><a href="mailto:tim@redronin.io" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none; line-height: normal;">tim@redronin.io</a><br style="line-height: normal;"><a href="http://www.redronin.io/" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none; line-height: normal;">www.redronin.io</a></font></div></div>
</div></body></html>