-3

I have a latitude coordinate and longitude coordinate. I have a table with geometries.

What function must I execute to use the coordinates to get a geometry containing the point made by these coordinates?

  • Where have you looked to try and answer your question before asking it? – PolyGeo Feb 3 '18 at 0:56
3

You can use ST_INTERSECTS

SELECT * FROM myTable
WHERE ST_Intersects(
        geom,
        ST_GeomFromText('POINT(-71.064544 42.28787)',4326)
       );
  • If you change ST_GeographyFromText to ST_GeomFromText, I can accept your answer – Username Feb 3 '18 at 18:42
  • @Username yeah, that is one of those great functions that works with either geographies or geometries – JGH Feb 4 '18 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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