<div dir="ltr">Hey,<div>It's difficult to help if you don't provide an example of non-working-as-intended-query.<br><br></div><div>The 2 queries above can't run without '<span style="font-family:arial,sans-serif;font-size:12.800000190734863px">soils.vw_zones' table, so I can't reproduce your bug.<br>
<br></span></div><div>Can you try to update all your table with</div><div>UPDATE <span style="font-family:arial,sans-serif;font-size:12.800000190734863px">soils.vw_zones SET geometry = ST_SetSRID(geom, XXX);</span></div><div>
<span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Also it seems you have a column named "geometry", which is a very bad idea as it is already a type name (should be reserved).</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">And I might as well say it, but maybe you should try on a recent version of PostGIS?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Cheers,</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Rémi-C</span></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/11/21 Huub Fleuren <span dir="ltr"><<a href="mailto:huub.fleuren@geodan.nl" target="_blank">huub.fleuren@geodan.nl</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  

    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <br>
    Hello,<br>
    <br>
    <br>
    I found that there is a difference in result between using <tt>A
      && B</tt> operator or one of the geo functions like <tt>st_intersects(A,B)</tt>
    or <tt>st_overlaps(A,B)</tt><br>
    <br>
    While the st_intersects or st_overlaps functions returns query
    results without errors the operator version SOMETIMES results in
    errors over the SRID:<br>
    <tt><br>
    </tt><tt>ERROR:  Operation on two geometrys with different SRID's.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>ERROR: Operation on two geometrys with different SRIDs</tt><tt><br>
    </tt><tt>SQL state: XX000</tt><tt><br>
    </tt><br>
    All of the 3552 records are OKE, having the correct SRID, all 2D,
    all vaid.<br>
    <br>
    select st_srid(geometry) ,count(*) from soils.vw_zones  group by
    st_srid(geometry) <br>
    SELECT ST_Dimension(geometry), count(*) from soils.vw_zones  group
    by ST_Dimension(geometry)<br>
    SELECT ST_isvalid(geometry), count(*) from soils.vw_zones  group by
    ST_isvalid(geometry)<br>
    <br>
    Everything runs on ubuntu<br>
    -The SQL query is generated by MAPSERV 5.6.1 WMS server<br>
    -Postgres Version 9.0.5<br>
    -Postgis version 1.5<br>
    <br>
    <br>
    Sample query:<br>
    <br>
        Operator &&<br>
    <br>
        select
    encode(AsBinary(force_collection(force_2d("geometry")),'NDR'),'hex')
    as geom, "id" <br>
        from (select * from soils.vw_zones) as vw<br>
        where geometry &&
    GeomFromText('POLYGON((75722.1945223652  
    437331.342330005,75722.1945223652 503295.946741193,169438.897876772
    503295.946741193,169438.897876772 437331.342330005,75722.1945223652
    437331.342330005))',find_srid('','soils.vw_zones','geometry')) <br>
    <br>
        ST_INTERSECTS<br>
    <br>
        select
    encode(AsBinary(force_collection(force_2d("geometry")),'NDR'),'hex')
    as geom, "id" <br>
        from (select * from soils.vw_zones) as vw<br>
        where
    st_intersects(geometry,GeomFromText('POLYGON((75722.1945223652
    437331.342330005,75722.1945223652 503295.946741193,169438.897876772
    503295.946741193,169438.897876772 437331.342330005,75722.1945223652
    437331.342330005))',find_srid('','soils.vw_zones','geometry')))<br>
    <br>
    <br>
    <br>
    Regards, Huub<span class="HOEnZb"><font color="#888888"><br>
    <br>
    <br>
    <br>
    <div>-- <br>
      <span style="font-family:Arial Bold;font-size:12pt">
        <br>
        E <a href="mailto:huub.fleuren@geodan.nl" target="_blank">huub.fleuren@geodan.nl</a>
        <br>
        <br>
        <a href="http://www.geodan.nl/disclaimer" target="_blank"></a>
      </span>
    </div>
  </font></span></div>

<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>