0

I have a table that contains a column polygon shape. I need a query that I Want to pass a point(coordinates) if point contains in a polygon_shape of an instance the match will be returns .

select * from "DistrictAreas" where ST_Contains(polygon_shape, ST_GeomFromText('POINT(51.3525284 35.6960617)', 4326));

this is a error comes from postgresql

Reason: SQL Error [XX000]: ERROR: Operation on mixed SRID geometries

I find that this is the problem : org.jkiss.dbeaver.model.exec.DBCException: SQL Error: Error parsing SQL data:java.lang.IllegalArgumentException: Points of LinearRing do not form a closed linestring

  • 2
    it appears your geometry column is referenced in a different CRS than the passed point (EPSG:4326 / WGS84). – geozelot Aug 9 '19 at 19:52
  • 1
    Please Edit the question to specify what SRID you used to load the polygon data. – Vince Aug 9 '19 at 20:48
  • @Vince tnx for your reply . I found this in my polygon_shape column : – babak abadkheir Aug 10 '19 at 5:25
  • No, invalid topology is a second error, above and beyond non-matching SRID. – Vince Aug 10 '19 at 11:39

Your Answer

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

Browse other questions tagged or ask your own question.