koopjs / koop-pgcache

PostGIS cache for Koop.
Other
4 stars 4 forks source link

Stats #15

Closed chelm closed 9 years ago

chelm commented 9 years ago

This adds a getStat method for calculating stats directly from the db. This will be used by koop BaseController when making requests for outStatistics on featureservices.

All tested too.

chelm commented 9 years ago

merging with master still... so many standardisms...

chelm commented 9 years ago

okay @dmfenton you want to take a peek here? All this does is add the getStats call, it wont be used yet.

chelm commented 9 years ago

@dmfenton ready

chelm commented 9 years ago

@dmfenton wait no its not

chelm commented 9 years ago

@dmfenton now you are ready to go for reals...

dmfenton commented 9 years ago

ok, let me pull this down and play around with it and get back at you tonight

chelm commented 9 years ago

@dmfenton I think the idea of support multiple is fine. I think if that'd be what we want here then we'd refactor this to always take an array of stats objects, build the sql we want in one method, then execute the query, and finally process and restructure the result rows for responding to the request.

In this version of the stats the Controller makes a request for one stat at a time and builds up the response to the user request as the db returns results. Which i think is fine. I am willing to bet that speed wise its not that much different.

ungoldman commented 9 years ago

woot