[postgis-users] Possible for ST_Intersects to not include the perimeter?

Joseph Spenner joseph85750 at yahoo.com
Thu Jan 22 08:07:47 PST 2015


Thanks for all the replies!  Actually, I must have done something wrong yesterday because my query I came up with works:
select ST_Asgeojson( geom ) from polys where ST_Intersects(ST_GeomFromGeoJSON('$jsonPoly'), geom)=TRUE and ST_Touches(ST_GeomFromGeoJSON('$jsonPoly'), geom)=FALSE
I must have had a TRUE/FALSE  and/or  AND/OR wrong.
I went through several tests, and all scenarios where the polys lie in various places with respect to each other, and every test past.
Toni:  The ST_Relate looks interesting, too.  I'll have to check that out.
Thanks again for the quick replies!
 If life gives you lemons, keep them-- because hey.. free lemons.


"~heart~ Sticker"  fixer:  http://microflush.org/stuff/stickers/heartFix.html



      From: toni hernández <toni at sigte.udg.edu>
 To: Joseph Spenner <joseph85750 at yahoo.com>; PostGIS Users Discussion <postgis-users at lists.osgeo.org> 
 Sent: Thursday, January 22, 2015 1:50 AM
 Subject: Re: [postgis-users] Possible for ST_Intersects to not include the perimeter?
   
 Joseph,
 
 With St_Relate (http://postgis.net/docs/ST_Relate.html) we can get all kind of relations between geometries. 
 You can get boundary intersections, interior intersections, interior intersections without boundary intersections.... all possibilities are supported.
 
 St_Relate uses the DE-91M model to define this relations between geometries.
 To know more about DE-91M: http://en.wikipedia.org/wiki/DE-9IM
 
 
 
 http://postgis.net/docs/using_postgis_dbmanagement.html#DE-9IM
 
 

On 21/01/2015 22:22, Joseph Spenner wrote:
  
 I have a polygon as an input, and I'm trying to find all polygons which share points, but not the perimiter points themselves.  Is this possible? 
  Real application:   I have NWS polygons describing Thunderstorm Warnings, which are made up of counties within the state.  Some of those counties might be on the edge of the state.  I want to query my database to show me all Warnings which are in a supplied state.  However, if I query the adjacent state which borders the counties from the first state, I get those Warnings because they share the same parimeter points. 
  Is there a way to construct a query which will not return anything if the only points in common are the perimeter values themselves? 
  I tried a few variations on ST_Intersects/ST_Covers/ST_Contains/ST_Overlaps, supplying various AND/OR and TRUE/FALSE combinatins, but I can't seem to get the right combo to accomplish my task. 
  Any help would be great. 
  Thanks! 
  Regards, Joseph Spenner
  
  
    
  
 _______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users 
 
 

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150122/f83b2e1d/attachment.html>


More information about the postgis-users mailing list