I am trying to do zonal stat in PostGIS with the following command.
SELECT (ST_SummaryStats(ST_Clip(agri_final_proj.rast, district.geom, TRUE))).*, district.district_1 AS district_1, district.geom AS geom INTO regions_with_elevation FROM agri_final_proj, district;
agri_final_proj is my raster and district is my vector file.
But when running the query I am facing this issue:
"ERROR: lwgeom_intersection: GEOS Error: TopologyException: Input geom 1 is invalid: Ring Self-intersection at or near point 458031.90649999958 4166648.6541000009 at 458031.90649999958 4166648.6541000009"