[postgis-users] ST_intersects query that crosses date line boundaries

Trang Nguyen Trang.Nguyen at inrix.com
Thu Feb 19 13:57:02 PST 2015


Hi,

I am using Postgres 9.3 and have a table with geometry columns:
  startloc geometry(Point),
  endloc geometry(Point),

When I run a query that crosses the date line boundary, I'm getting incorrect results. Example:
SELECT * from od1.trip_v1_partitioned where startts>=TIMESTAMP '2015-02-16T20:00:00.000Z'and startts<TIMESTAMP '2015-02-17T20:00:00.000Z'and endts<TIMESTAMP '2015-02-17T20:00:00.000Z' and ST_intersects(startloc, ST_MakeValid(ST_GeomFromText('MULTIPOLYGON(((179.64844 67.73477,-155.03906 67.60118,-161.19141 61.8462,179.64844 67.73477)))')))

Would I need to change how my columns are stored (this would require a big migration), or is it possible to adjust  my query to handle this correctly?

Thanks,
Trang

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


More information about the postgis-users mailing list