1

I have a longitude and latitude values and need to convert Oracle SDO function to PostGIS. My Oracle query is below:

SELECT geoid 
FROM   tract 
WHERE  SDO_Contains(
            'GEOM',SDO_GEOMETRY(
                    2001,4326,SDO_POINT_TYPE (
                            '38.841873', '-77.448135',NULL)
                    NULL,NULL)) = 'TRUE';

How can I convert it to PostGIS?

1

Your question is a bit unclear, but if you want to write the query that does exactly the same job then you can find it below:

SELECT geoid FROM  tract WHERE ST_Contains("GEOM",ST_SetSrid(ST_Point(38.841873, -77.448135), 4326));

Otherwise, please add more detailed explanation.

| improve this answer | |
  • I think that needs to be "GEOM" not 'GEOM' in PostGIS otherwise it's a string not a column – Ian Turton Jun 18 at 7:31

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.