incorrect results with st_intersects

Discussion created by ufeliciano on Jan 23, 2014
Latest reply on Jan 28, 2014 by ufeliciano
Hopefully this is an easy one...

Using st_intersects I'm trying to get the records from a polygon layer which centroids intersect with another polygon layer (administrative boundaries).  So far I managed to get this with the following statement...

Select p.pid,p.oldpid,m.muni,m.region
from parcels p, munici m
where sde.st_intersects(m.shape,sde_centroid(p.shape))=1
and rownum<40;

the results are not correct.  It returned pins that intersect different administratives boundaries but listed to the same boundary.  In other words...

"";"115-092-802-15";"SAN JUAN";"AGUADILLA";"AGUADILLA"

I tried the same in my Postgis database (not using ESRI) and the results appear to be correct.  I used the following in postgis...

SELECT p.pid,p.oldpid,m.muni,m.region
FROM parcels p,munic m
WHERE st_intersects (m.geom,st_centroid(p.geom)) limit 38;


"197-070-419-10";"197-070-069-49";"AGUAS BUENAS";"CAGUAS"
"115-092-802-AV";"115-092-802-AV";"SAN JUAN";"SAN JUAN"
"";"115-092-802-15";"SAN JUAN";"SAN JUAN"

Could it be something wrong in the statement or maybe something else???  Any suggestions are appreciated...