Asked • 03/27/19

PostGIS - st_intersects using polygons that cross antimeridan/equator?

New to using PostGIS and have two situations that I'm working with. In the one case, I have a polygon that crossed the antemeridian and was detecting whether a two separate points located within that polygon one on the west and one on the east side of the antimeridian intersects with the polygon (data types used are geometries). I found I had to use the `st_shift_longitude` on the geometries passed to the `st_intersects` function. The other situation is a polygon crossing the equator with points above and below the equator within the polygon. `st_intersects` doesn't detect both points intersect the polygon. Do the latitudes need to be shifted in this case? I didn't see a shift latitude function available. I'm using the following points and polygon at the equator: st_point(170.0,45.0) st_point(170.0,-45.0) and the polygon 'POLYGON((165 40,175 40,175 -50,165 -50,165 40))' I'd expect that the st_intersect function return true for both points, however, it's only returning true for st_point(170.0,-45.0)

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.