<html><body><div style="color:#000; background-color:#fff; font-family:garamond, new york, times, serif;font-size:14px"><div id="yui_3_16_0_1_1425154882423_10719">Roxanne:</div><div id="yui_3_16_0_1_1425154882423_10720" dir="ltr">  Thanks for the help!  I was able to find a solution, but knowing it was the ST_Area piece giving me the problem was a great help.</div><div id="yui_3_16_0_1_1425154882423_10721" dir="ltr">I'll play around with the suggestions you offered, too.</div><div id="yui_3_16_0_1_1425154882423_10722" dir="ltr"><br></div><div id="yui_3_16_0_1_1425154882423_10723" dir="ltr">( Yes, free Beer, Tucson.   :)</div><div id="yui_3_16_0_1_1425154882423_10724" dir="ltr"><br></div><div id="yui_3_16_0_1_1425154882423_10725" dir="ltr">Cheers..</div><div id="yui_3_16_0_1_1425154882423_10726" dir="ltr">Joseph Spenner</div><div id="yui_3_16_0_1_1425154882423_10727" dir="ltr"><br></div><div id="yui_3_16_0_1_1425154882423_10728"><span></span></div><div id="yui_3_16_0_1_1425154882423_10729"> </div><div id="yui_3_16_0_1_1425154882423_10731"><div id="yui_3_16_0_1_1425154882423_10730">If life gives you lemons, keep them-- because hey.. free lemons.
</div><br><br><div id="yui_3_16_0_1_1425154882423_10732">
<br>"~heart~ Sticker"  fixer:  http://microflush.org/stuff/stickers/heartFix.html
</div><br><br><div id="yui_3_16_0_1_1425154882423_10733">
<br></div></div><br>  <div id="yui_3_16_0_1_1425154882423_10737" style="font-family: garamond, new york, times, serif; font-size: 14px;"> <div id="yui_3_16_0_1_1425154882423_10736" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1425154882423_10735" dir="ltr"> <hr id="yui_3_16_0_1_1425154882423_10783" size="1">  <font id="yui_3_16_0_1_1425154882423_10734" face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Roxanne Reid-Bennett <rox@tara-lu.com><br> <b><span style="font-weight: bold;">To:</span></b> postgis-users@lists.osgeo.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, February 26, 2015 2:51 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [postgis-users] TopologyException: geom is invalid<br> </font> </div> <div id="yui_3_16_0_1_1425154882423_10738" class="y_msg_container"><br><div id="yiv8908748546"><div id="yui_3_16_0_1_1425154882423_10740">
    <div id="yui_3_16_0_1_1425154882423_10739" class="yiv8908748546moz-cite-prefix">On 2/26/2015 4:08 PM, Joseph Spenner
      wrote:<br clear="none">
    </div>
    <blockquote id="yui_3_16_0_1_1425154882423_10742" type="cite">
      <div id="yui_3_16_0_1_1425154882423_10741" style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;">
        <div id="yiv8908748546yui_3_16_0_1_1424960459142_165150">Roxanne:</div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165149">  I think
          you're on to something here.  I just did more tests, and found
          the following:</div>
        <div id="yui_3_16_0_1_1425154882423_10776" dir="ltr"><br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_164977">This
          command fails with the error:</div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165011"><br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165019">select
          ST_Asgeojson( geom ) from dynamic.polys where
          ST_Intersects(ST_GeomFromGeoJSON('$jsonPoly'), geom)=TRUE and
          ST_Area(ST_Intersection(ST_GeomFromGeoJSON('$jsonPoly')::geography,
          geom::geography))>500</div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165062"><br clear="none">
        </div>
        <div id="yui_3_16_0_1_1425154882423_10777" dir="ltr">  == ERROR==<br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165429">DBD::Pg::st
          execute failed: ERROR:  Error performing intersection:
          TopologyException: Input geom 0 is invalid: Self-intersection
          at or near point 1543100.5176146738 389360.239110158 at
          1543100.5176146738 389360.239110158 at ./foo.pl line 50.<br class="yiv8908748546" style="" clear="none">
          DBD::Pg::st execute failed: ERROR:  Error performing
          intersection: TopologyException: Input geom 0 is invalid:
          Self-intersection at or near point 1543100.5176146738
          389360.239110158 at 1543100.5176146738 389360.239110158 at
          ./foo.pl line 50.<br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165401">  ==
          /ERROR==</div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165605"><br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165470"><br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165095">But this
          command succeeds, no error:</div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165142"><br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165108"> select
          ST_Asgeojson( geom ) from dynamic.polys where
          ST_Intersects(ST_GeomFromGeoJSON('$jsonPoly'), geom)=TRUE</div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165147"><br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165148"><br clear="none">
        </div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_164976"><span id="yiv8908748546yui_3_16_0_1_1424960459142_165188">The only thing
            different is the extra AND:  </span></div>
        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165254"><span class="yiv8908748546" id="yiv8908748546yui_3_16_0_1_1424960459142_165188" style="">   
          </span>ST_Area(ST_Intersection(ST_GeomFromGeoJSON('$jsonPoly')::geography,
          geom::geography))>500</div>
        <div id="yiv8908748546yui_3_16_0_1_1424960459142_164975">
          <div id="yiv8908748546yui_3_16_0_1_1424960459142_165323"> </div>
          <div id="yiv8908748546yui_3_16_0_1_1424960459142_165258"><br clear="none">
          </div>
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165471">The
            reason I did this was to prevent false positives for geoms
            which were simply tangent, or "touching".</div>
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165540">For
            example, if I searched for MN, and there was poly/county on
            the northern IA border, it would be returned.</div>
        </div>
      </div>
    </blockquote>
    I haven't played with geography much as a data type, ymmv<br clear="none">
    <br clear="none">
    Try casting the St_Intersection back to geometry and do an
    ST_IsValidReason (and ST_GeometryType) on
    ST_Intersection(ST_GeomFromGeoJSON('$jsonPoly')::geography,
    geom::geography)<br clear="none">
    <br clear="none">
    or change the order on the cast to (**with correct SRIDs):<br clear="none">
    ST_Intersection(ST_GeomFromGeoJSON('$jsonPoly'), geom)::geography<br clear="none">
    <br clear="none">
    and see what it says.  You may be able to test for a non-polygon
    (ST_Area of a (multi)linestring or (multi)point makes no sense)
    and/or add ST_MakeValid around it.  [not saying that is the problem
    - it just might be tho]<br clear="none">
    <br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;">
        <div id="yiv8908748546yui_3_16_0_1_1424960459142_164975">
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165638"><br clear="none">
          </div>
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165805">Looks
            like I need to find a better way to deal with the geoms that
            just touch with a single point or line in common.</div>
        </div>
      </div>
    </blockquote>
    <br clear="none">
    Not necessarily - just a more robust way of testing edge use cases.<br clear="none">
    <br clear="none">
    and/or maybe...<br clear="none">
    is not ST_Touches (for boundary only intersections) <br clear="none">
    and is { ST_Crosses (some but not all interior points in common) or
    ST_Contains(one is wholly contained in the other)  }<br clear="none">
    and then test ST_Area... essentially filtering out the edge cases
    before Area is taken.<br clear="none">
    <br clear="none">
    and again - the specific fix is dependent upon the specific cause. 
    <br clear="none">
    <br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;">
        <div id="yiv8908748546yui_3_16_0_1_1424960459142_164975">
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165736"><br clear="none">
          </div>
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165810">Any idea
            on a better way to handle this?</div>
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165806"><br clear="none">
          </div>
          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165738">Thanks
            for your help!   I owe you a beer.    :)<br clear="none">
          </div>
        </div>
      </div>
    </blockquote>
    mmm beer<br clear="none">
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;">
        <div id="yiv8908748546yui_3_16_0_1_1424960459142_164957"><br clear="none">
          <div>
            <br clear="none">
          </div>
        </div>
        <br clear="none">
        <div id="yiv8908748546yui_3_16_0_1_1424960459142_165809" style="font-family:garamond, new york, times, serif;font-size:14px;">
          <div id="yiv8908748546yui_3_16_0_1_1424960459142_165808" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
            <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_165807">
              <hr size="1"> <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Roxanne
                Reid-Bennett <a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-rfc2396E" ymailto="mailto:rox@tara-lu.com" target="_blank" href="mailto:rox@tara-lu.com"><rox@tara-lu.com></a><br clear="none">
                <b><span style="font-weight:bold;">To:</span></b>
                <a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-abbreviated" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a> <br clear="none">
                <b><span style="font-weight:bold;">Sent:</span></b>
                Thursday, February 26, 2015 1:16 PM<br clear="none">
                <b><span style="font-weight:bold;">Subject:</span></b>
                Re: [postgis-users] TopologyException: geom is invalid<br clear="none">
              </font> </div>
            <div class="yiv8908748546y_msg_container"><br clear="none">
              <div id="yiv8908748546">
                <div>
                  <div class="yiv8908748546moz-cite-prefix">On 2/26/2015
                    1:40 PM, Joseph Spenner wrote:<br clear="none">
                  </div>
                  <blockquote type="cite">
                    <div style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;">
                      <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100383">I
                        ran the following against all 4 of my GeoJSON
                        files:</div>
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100261"><br clear="none">
                      </div>
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100196">SELECT

                        ST_IsSimple(ST_GeomFromGeoJSON('@poly'))</div>
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100199">SELECT

                        ST_IsValid(ST_GeomFromGeoJSON('@poly'))</div>
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100207">SELECT

                        ST_IsValidDetail(ST_GeomFromGeoJSON('@poly'))</div>
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100215">SELECT

                        ST_IsValidReason(ST_GeomFromGeoJSON('@poly'))</div>
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100470"><br clear="none">
                      </div>
                      <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100262">where

                        @poly contained each one of the following:</div>
                      <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72093" style="">
                        <div><br class="yiv8908748546" style="" clear="none">
                        </div>
                      </div>
                      <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72042" style="">
                        <div><a rel="nofollow" shape="rect" class="yiv8908748546" id="yiv8908748546yui_3_16_0_1_1424883046678_72073" style="" target="_blank" href="http://microflush.org/stuff/json/MN.json">http://microflush.org/stuff/json/MN.json</a></div>
                      </div>
                      <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72075" style="">
                        <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72099" style="">
                          <div><a rel="nofollow" shape="rect" class="yiv8908748546" id="yiv8908748546yui_3_16_0_1_1424883046678_72112" style="" target="_blank" href="http://microflush.org/stuff/json/mnz091.json">http://microflush.org/stuff/json/mnz091.json</a></div>
                        </div>
                        <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72146" style="">
                          <div id="yiv8908748546yui_3_16_0_1_1424960459142_100536"><br clear="none">
                          </div>
                          <div id="yiv8908748546yui_3_16_0_1_1424960459142_100588"><a rel="nofollow" shape="rect" class="yiv8908748546" id="yiv8908748546yui_3_16_0_1_1424883046678_3584" style="" target="_blank" href="http://microflush.org/stuff/json/CA.json">http://microflush.org/stuff/json/CA.json</a></div>
                          <div id="yiv8908748546yui_3_16_0_1_1424960459142_100531"><a rel="nofollow" shape="rect" class="yiv8908748546" id="yiv8908748546yui_3_16_0_1_1424883046678_3337" style="" target="_blank" href="http://microflush.org/stuff/json/nwsZone.json">http://microflush.org/stuff/json/nwsZone.json</a></div>
                          <div id="yiv8908748546yui_3_16_0_1_1424960459142_100530"><br clear="none">
                          </div>
                          <div class="yiv8908748546" id="yiv8908748546yui_3_16_0_1_1424960459142_100530" style=""><br clear="none">
                          </div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100594" style="">The select returned no error.  I
                            tried to vary the input slightly to make
                            sure I was using the proper syntax, and was
                            able to get errors-- such as:</div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100772" style=""><br clear="none">
                          </div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100773" style="">DBD::Pg::st execute failed: ERROR: 
                            geometry contains non-closed rings<br class="yiv8908748546" style="" clear="none">
                          </div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100870" style=""><br clear="none">
                          </div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100869" style="">So, it would seem my geoms are ok.</div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100823" style=""><br clear="none">
                          </div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100962" style="">I've not yet tried the
                            "ST_MakeValid".   But wouldn't the above
                            indicate they're already valid?</div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                  <br clear="none">
                  Yes ST_IsValid coming back true means that the
                  geometry is "valid".  (Topology Exceptions are most
                  often thrown during operations on invalid geometries -
                  so this test is the first that should be done when one
                  occurs...  in almost all cases)<br clear="none">
                  <br clear="none">
                  In my (limited) experience - just because 2 geometries
                  are valid, doesn't mean that operations on them won't
                  generate issues. <br clear="none">
                  <br clear="none">
                  Is it the cast to Geography, ST_Intersection or the
                  ST_Area on the ST_Intersection that is throwing the
                  error?<br clear="none">
                  My guess is going to be the ST_Area on the results of
                  the ST_Intersection.<br clear="none">
                  <br clear="none">
                  So, is the result of the ST_Intersection of the two
                  geographies valid?<br clear="none">
                  <br clear="none">
                  Have you perhaps looked at all the involved geometries
                  (since you are down to 4) at the point identified by
                  the original Topo  error  in order to understand
                  exactly what in the makeup of those geometries makes
                  the error remotely possible within the operation you
                  are performing on them?  <br clear="none">
                  <br clear="none">
                  ST_MakeValid and ST_Buffer adjust the geometry in
                  (frequently insignificant) ways that help operations
                  avoid Topos.  But what adjustment is likely to avoid
                  the error when using the related valid geometries is
                  dependent upon the real cause for the error - and that
                  is specific to the geometries at the point identified
                  in the error.  Whether those manipulations can validly
                  be applied is dependent upon your business use
                  tolerance for those adjustments.  (buffering a polygon
                  by 0.00001 will skew calculated area of a polygon but
                  may not result in false positives for an Intersects).<br clear="none">
                  <br clear="none">
                  Roxanne<br clear="none">
                  <br clear="none">
                  <blockquote type="cite">
                    <div style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;">
                      <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72075" style="">
                        <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72146" style="">
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_101214" style=""><br clear="none">
                          </div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_101215" style="">Thanks!</div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_101216" style=""><br class="yiv8908748546" style="" clear="none">
                          </div>
                          <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100773" style=""><br class="yiv8908748546" style="" clear="none">
                          </div>
                        </div>
                        <div class="yiv8908748546" dir="ltr" id="yiv8908748546yui_3_16_0_1_1424883046678_72146" style=""><br class="yiv8908748546" style="" clear="none">
                        </div>
                      </div>
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100005"><br clear="none">
                        <div id="yiv8908748546yui_3_16_0_1_1424960459142_100126">
                          <br clear="none">
                        </div>
                      </div>
                      <br clear="none">
                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_100129" style="font-family:garamond, new york, times, serif;font-size:14px;">
                        <div id="yiv8908748546yui_3_16_0_1_1424960459142_100128" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
                          <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100127">
                            <hr id="yiv8908748546yui_3_16_0_1_1424960459142_101052" size="1"> <font id="yiv8908748546yui_3_16_0_1_1424960459142_100130" face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b>
                              Joseph Spenner <a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-rfc2396E" ymailto="mailto:joseph85750@yahoo.com" target="_blank" href="mailto:joseph85750@yahoo.com"><joseph85750@yahoo.com></a><br clear="none">
                              <b><span style="font-weight:bold;">To:</span></b>
                              PostGIS Users Discussion <a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-rfc2396E" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org"><postgis-users@lists.osgeo.org></a>
                              <br clear="none">
                              <b><span style="font-weight:bold;">Sent:</span></b>
                              Thursday, February 26, 2015 8:05 AM<br clear="none">
                              <b id="yiv8908748546yui_3_16_0_1_1424960459142_100132"><span id="yiv8908748546yui_3_16_0_1_1424960459142_100131" style="font-weight:bold;">Subject:</span></b>
                              Re: [postgis-users] TopologyException:
                              geom is invalid<br clear="none">
                            </font> </div>
                          <div class="yiv8908748546y_msg_container" id="yiv8908748546yui_3_16_0_1_1424960459142_100143"><br clear="none">
                            <div id="yiv8908748546">
                              <div id="yiv8908748546yui_3_16_0_1_1424960459142_100142">
                                <div id="yiv8908748546yui_3_16_0_1_1424960459142_100141" style="color:#000;background-color:#fff;font-family:garamond, new york, times, serif;font-size:14px;">
                                  <div id="yiv8908748546yui_3_16_0_1_1424960459142_30305">Hello,

                                    and thanks for the replies!</div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30743">I'll

                                    try those suggestions.</div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30742"><br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30548">Just

                                    curiuos though-- which geometry
                                    seems to be invalid?  Is it the
                                    state poly, or the smaller
                                    county/zone poly?  If there was an
                                    invalid geometry, wouldn't it always
                                    show up for that state or county? 
                                    Here's what I observed for the CA
                                    issue:</div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30549"><br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30550">1)

                                    I had 3 smaller county
                                    poly/geometries in CA.  When
                                    performing my query, instead of
                                    returning the 3 polys, I received
                                    the error which I posted in my
                                    original thread.  I identified it
                                    was 1 of those 3.  I deleted that 1
                                    offending geometry from my table. 
                                    After doing so, my query against CA
                                    turned up the remaining 2, with no
                                    errors.  So, that leads me to
                                    believe CA is ok.  Or is this not a
                                    valid assumption?   Perhaps the
                                    location where that offending
                                    intersection would have occurred in
                                    the CA poly has an issue, and it
                                    doesn't get tickled unless the
                                    smaller county zone intersects it?</div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30551"><br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30552">2)

                                    I was able to plot the offending
                                    county described above in the
                                    GeoJSONLint validation page:   <a rel="nofollow" shape="rect" id="yiv8908748546yui_3_16_0_1_1424960459142_30556" target="_blank" href="http://geojsonlint.com/">http://geojsonlint.com/</a></div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30624"> 
                                    There didn't appear to be any
                                    issues.</div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30741"><br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30732">Thanks!</div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30738"><br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30739">Regards,</div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30740">Joseph

                                    Spenner<br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30604"><br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30717"><br clear="none">
                                  </div>
                                  <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30603"><br clear="none">
                                  </div>
                                  <div id="yiv8908748546yui_3_16_0_1_1424960459142_30552">
                                     </div>
                                  <div id="yiv8908748546yui_3_16_0_1_1424960459142_30287"><br clear="none">
                                    <div id="yiv8908748546yui_3_16_0_1_1424960459142_30553">
                                      <br clear="none">
                                    </div>
                                  </div>
                                  <br clear="none">
                                  <div class="yiv8908748546qtdSeparateBR"><br clear="none">
                                    <br clear="none">
                                  </div>
                                  <div class="yiv8908748546yqt4511872611" id="yiv8908748546yqt77936">
                                    <div id="yiv8908748546yui_3_16_0_1_1424960459142_30746" style="font-family:garamond, new york, times, serif;font-size:14px;">
                                      <div id="yiv8908748546yui_3_16_0_1_1424960459142_30745" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
                                        <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_30744">
                                          <hr size="1"> <font id="yiv8908748546yui_3_16_0_1_1424960459142_30747" face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Rémi Cura <a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-rfc2396E" ymailto="mailto:remi.cura@gmail.com" target="_blank" href="mailto:remi.cura@gmail.com"><remi.cura@gmail.com></a><br clear="none">
                                            <b><span style="font-weight:bold;">To:</span></b>
                                            PostGIS Users Discussion <a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-rfc2396E" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org"><postgis-users@lists.osgeo.org></a>
                                            <br clear="none">
                                            <b><span style="font-weight:bold;">Cc:</span></b>
                                            Joseph Spenner <a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-rfc2396E" ymailto="mailto:joseph85750@yahoo.com" target="_blank" href="mailto:joseph85750@yahoo.com"><joseph85750@yahoo.com></a>
                                            <br clear="none">
                                            <b><span style="font-weight:bold;">Sent:</span></b>
                                            Thursday, February 26, 2015
                                            1:28 AM<br clear="none">
                                            <b><span style="font-weight:bold;">Subject:</span></b>
                                            Re: [postgis-users]
                                            TopologyException: geom is
                                            invalid<br clear="none">
                                          </font> </div>
                                        <div class="yiv8908748546y_msg_container" id="yiv8908748546yui_3_16_0_1_1424960459142_30853"><br clear="none">
                                          <div id="yiv8908748546">
                                            <div id="yiv8908748546yui_3_16_0_1_1424960459142_100307">
                                              <div dir="ltr">
                                                <div>
                                                  <div>And also
                                                    ST_IsSimple (that
                                                    precisely check for
                                                    self intersection).<br clear="none">
                                                  </div>
                                                  Cheers,<br clear="none">
                                                </div>
                                                Rémi-C<br clear="none">
                                              </div>
                                              <div class="yiv8908748546gmail_extra" id="yiv8908748546yui_3_16_0_1_1424960459142_100306"><br clear="none">
                                                <div class="yiv8908748546gmail_quote" id="yiv8908748546yui_3_16_0_1_1424960459142_100305">2015-02-26 8:32
                                                  GMT+01:00
                                                  BladeOfLight16 <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:bladeoflight16@gmail.com" target="_blank" href="mailto:bladeoflight16@gmail.com">bladeoflight16@gmail.com</a>></span>:<br clear="none">
                                                  <blockquote class="yiv8908748546gmail_quote" id="yiv8908748546yui_3_16_0_1_1424960459142_100304" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
                                                    <div class="yiv8908748546qtdSeparateBR"><br clear="none">
                                                      <br clear="none">
                                                    </div>
                                                    <div class="yiv8908748546yqt4173123445" id="yiv8908748546yqt47029">
                                                      <div dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100303">
                                                        <div class="yiv8908748546gmail_extra" id="yiv8908748546yui_3_16_0_1_1424960459142_100302">
                                                          <div class="yiv8908748546gmail_quote" id="yiv8908748546yui_3_16_0_1_1424960459142_100301">On Wed, Feb 25, 2015
                                                          at 12:14 PM,
                                                          Joseph Spenner
                                                          <span dir="ltr" id="yiv8908748546yui_3_16_0_1_1424960459142_100300"><<a rel="nofollow" shape="rect" id="yiv8908748546yui_3_16_0_1_1424960459142_100299" ymailto="mailto:joseph85750@yahoo.com" target="_blank" href="mailto:joseph85750@yahoo.com">joseph85750@yahoo.com</a>></span>
                                                          wrote:<br clear="none">
                                                          <blockquote class="yiv8908748546gmail_quote" id="yiv8908748546yui_3_16_0_1_1424960459142_100315" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
                                                          <div id="yiv8908748546yui_3_16_0_1_1424960459142_100314">
                                                          <div id="yiv8908748546yui_3_16_0_1_1424960459142_100313" style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:garamond, new york, times, serif;font-size:14px;">DBD::Pg::st

                                                          execute
                                                          failed:
                                                          ERROR:  Error
                                                          performing
                                                          intersection:
                                                          TopologyException:

                                                          Input geom 1
                                                          is invalid:
                                                          Self-intersection
                                                          at or near
                                                          point
                                                          -381688.06935935974
                                                          -1206669.4272876547

                                                          at
                                                          -381688.06935935974
                                                          -1206669.4272876547

                                                          at ./<a rel="nofollow" shape="rect" target="_blank" href="http://test.pl/">test.pl</a> line 151.<br clear="none">
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          <div><br clear="none">
                                                          </div>
                                                          <div>Did you
                                                          try ST_IsValid
                                                          to verify the
                                                          geometry is
                                                          valid
                                                          according to
                                                          the OGC
                                                          standard? (See
                                                          <a rel="nofollow" shape="rect" target="_blank" href="http://postgis.net/docs/using_postgis_dbmanagement.html#OGC_Validity">http://postgis.net/docs/using_postgis_dbmanagement.html#OGC_Validity</a>.
                                                          ST_IsValidDetail
                                                          and
                                                          ST_IsValidReason
                                                          are also
                                                          helpful in
                                                          this regard.)
                                                          What happens
                                                          if you run it
                                                          through
                                                          ST_MakeValid?
                                                          Be aware that
                                                          ST_MakeValid
                                                          can sometimes
                                                          result in
                                                          GeometryCollections
                                                          if the input
                                                          shape is
                                                          malformed
                                                          (usually
                                                          "rings"
                                                          without enough
                                                          points are
                                                          that have
                                                          different
                                                          start and end
                                                          points).<br clear="none">
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                    <br clear="none">
_______________________________________________<br clear="none">
                                                    postgis-users
                                                    mailing list<br clear="none">
                                                    <a rel="nofollow" shape="rect" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br clear="none">
                                                    <a rel="nofollow" shape="rect" target="_blank" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
                                                    <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd93364"><br clear="none">
                                                    </div>
                                                  </blockquote>
                                                  <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd17184"> </div>
                                                </div>
                                                <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd68174"> <br clear="none">
                                                </div>
                                              </div>
                                              <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd88026"> </div>
                                            </div>
                                            <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd35048"> </div>
                                          </div>
                                          <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd94770">
                                            <br clear="none">
                                            <br clear="none">
                                          </div>
                                        </div>
                                        <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd35691">
                                        </div>
                                      </div>
                                      <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd22823"> </div>
                                    </div>
                                    <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd65214"> </div>
                                  </div>
                                  <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd58266"> </div>
                                </div>
                                <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd29566"> </div>
                              </div>
                              <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd35233"> </div>
                            </div>
                            <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd77022"> <br clear="none">
                              <br clear="none">
                            </div>
                          </div>
                          <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd50507"> </div>
                        </div>
                        <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd05806"> </div>
                      </div>
                      <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd86970"> </div>
                    </div>
                    <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd89017"> <br clear="none">
                      <fieldset class="yiv8908748546mimeAttachmentHeader"></fieldset>
                      <br clear="none">
                      <pre>_______________________________________________
postgis-users mailing list
<a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-abbreviated" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-freetext" target="_blank" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></pre>
                    </div>
                  </blockquote>
                  <br clear="none">
                  <br clear="none">
                  <pre class="yiv8908748546moz-signature">-- 
[At other schools] I think the most common fault in general is to teach students how to pass exams instead of teaching them the science.
Donald Knuth</pre>
                  <div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd77250"><div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd29790"> </div>
                </div></div><div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd13792">
              </div></div><div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd41258">
              <br clear="none">
              <div class="yiv8908748546yqt2272743163" id="yiv8908748546yqtfd27557">_______________________________________________<br clear="none">
                postgis-users mailing list<br clear="none">
                <a rel="nofollow" shape="rect" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br clear="none">
                <a rel="nofollow" shape="rect" target="_blank" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></div>
              <br clear="none">
              <br clear="none">
            </div></div><div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd79750">
          </div></div><div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd41219">
        </div></div><div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd01406">
      </div></div><div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd59019">
      <br clear="none">
      <fieldset class="yiv8908748546mimeAttachmentHeader"></fieldset>
      <br clear="none">
      <pre>_______________________________________________
postgis-users mailing list
<a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-abbreviated" ymailto="mailto:postgis-users@lists.osgeo.org" target="_blank" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a rel="nofollow" shape="rect" class="yiv8908748546moz-txt-link-freetext" target="_blank" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></pre>
    </div></blockquote><div class="yiv8908748546yqt6473043087" id="yiv8908748546yqtfd38160">
    <br clear="none">
    <br clear="none">
    <pre class="yiv8908748546moz-signature">-- 
[At other schools] I think the most common fault in general is to teach students how to pass exams instead of teaching them the science.
Donald Knuth</pre>
  </div></div></div><br><div class="yqt6473043087" id="yqtfd10936">_______________________________________________<br clear="none">postgis-users mailing list<br clear="none"><a shape="rect" ymailto="mailto:postgis-users@lists.osgeo.org" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br clear="none"><a shape="rect" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></div><br><br></div> </div> </div>  </div></body></html>