1
select ST_GeomFromGeoJSON('{"type":"Polygon","coordinates":[[[37.75074414,-57.54978713],[37.748904483,-57.558230569],[37.744033941,-57.566318698],[37.736317969,-57.573740353],[37.726051981,-57.580209837],[37.71363017,-57.585477965],[37.699530409,-57.589341734],[37.68429581,-57.591652205],[37.668513658,-57.592320296],[37.652792564,-57.591320254],[37.637738755,-57.58869065],[37.623932455,-57.584532883],[37.611905332,-57.579007225],[37.602119892,-57.572326588],[37.594951666,-57.564748258],[37.590674851,-57.556563919],[37.589451974,-57.54808838],[37.591327923,-57.539647429],[37.596228546,-57.531565304],[37.603963807,-57.524152253],[37.614235355,-57.517692666],[37.626648151,-57.51243422],[37.640725695,-57.508578444],[37.655928257,-57.506273061],[37.671673429,-57.505606376],[37.687358229,-57.506603931],[37.702381958,-57.509227531],[37.716168969,-57.513376693],[37.728190532,-57.518892455],[37.737984986,-57.525563409],[37.74517543,-57.533133747],[37.749484283,-57.541312998],[37.75074414,-57.54978713]]]}')::geography
&&
(select ST_GeomFromGeoJSON('{"type":"Point","coordinates":[37.75870282438855,-122.44584844354561]}}')::geography)

By looking at the their position on the map not sure why && returns true? ST_Intersects returns false. Any explanation on this would solidify my understanding. I am still new to PostGIS.

Here's how the look on the map:

enter image description here

2
  • 4
    There’s something funny going on with your latitudes — where is -122° supposed to be? Commented Jun 18, 2023 at 12:56
  • 1
    ah thanks for pointing that out.
    – Techbrake
    Commented Jun 19, 2023 at 4:04

1 Answer 1

2

When using latitudes greater than +-90, PostGIS will either error out, truncate, go back from the pole or go across the pole. Beside throwing an error, I have yet to see a usefulness for these behaviors.

==> sanitize your data.

select st_asText(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[37.75870282438855,-122.44584844354561]}}')::geography);
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
                  st_astext
----------------------------------------------
 POINT(37.75870282438855 -57.554151556454386)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.