I have a point shapefile called pointA that has a field called fieldB, and a polygon file called polygonC, and I want to calculate the sum of fieldB for all the points that are within polygonC
How to do this?
Load your shapefile(s) in as per instructions from http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/shp2pgsql.html
Then query using something like
SELECT sum(pointA.fieldB) FROM pointA, polygonC WHERE ST_Within(pointA.the_geom, polygonC.the_geom) AND polygonC.id = ?