datamade / wopr-grid

Deprecated: merged in to plenario
https://github.com/datamade/plenario
MIT License
1 stars 0 forks source link

Smaller grid resolution #1

Open fgregg opened 10 years ago

fgregg commented 10 years ago

With the new square grid, it looks like the effective resolution of ~500 is larger. Can we go down another step size?

derekeder commented 10 years ago

Is there a reason one wouldn't want the maximum possible resolution possible based on the queried area? We may want to come up with a global ceiling for the resolution, but other than that I know I'd always want the most detail. Calculating this on the fly would mean one less thing for the user to select.

evz commented 10 years ago

I think I'd still like to give users the ability to select how the fine the grid aggregation is. I'm working on how we might implement it. One way I thought might work would be to only show the finer resolutions when you're zoomed in a bit closer and then use the bounding box of the map to limit the query (so not as many results are returned and you don't end up with a frozen browser).

fgregg commented 10 years ago

I want to be able to look at the finest aggregation feasible for the entire city.

On Fri, May 2, 2014 at 10:08 AM, Eric van Zanten notifications@github.comwrote:

I think I'd still like to give users the ability to select how the fine the grid aggregation is. I'm working on how we might implement it. One way I thought might work would be to only show the finer resolutions when you're zoomed in a bit closer and then use the bounding box of the map to limit the query (so not as many results are returned and you don't end up with a frozen browser).

— Reply to this email directly or view it on GitHubhttps://github.com/datamade/wopr-grid/issues/1#issuecomment-42041751 .

773.888.2718 2231 N. Monticello Ave Chicago, IL 60647

evz commented 10 years ago

@fgregg That lies somewhere in between 100m and 500m, depending on your hardware. 100m resolution froze Firefox on my laptop.

fgregg commented 10 years ago

Let's just go down one more than, to 250.

On Fri, May 2, 2014 at 10:23 AM, Eric van Zanten notifications@github.comwrote:

@fgregg https://github.com/fgregg That lies somewhere in between 100m and 500m, depending on your hardware. 100m resolution froze Firefox on my laptop.

— Reply to this email directly or view it on GitHubhttps://github.com/datamade/wopr-grid/issues/1#issuecomment-42043408 .

773.888.2718 2231 N. Monticello Ave Chicago, IL 60647

derekeder commented 10 years ago

I smell tile rendering in our future.

On Fri, May 2, 2014 at 10:26 AM, Forest Gregg notifications@github.comwrote:

Let's just go down one more than, to 250.

On Fri, May 2, 2014 at 10:23 AM, Eric van Zanten notifications@github.comwrote:

@fgregg https://github.com/fgregg That lies somewhere in between 100m and 500m, depending on your hardware. 100m resolution froze Firefox on my laptop.

— Reply to this email directly or view it on GitHub< https://github.com/datamade/wopr-grid/issues/1#issuecomment-42043408> .

773.888.2718 2231 N. Monticello Ave Chicago, IL 60647

Reply to this email directly or view it on GitHubhttps://github.com/datamade/wopr-grid/issues/1#issuecomment-42043792 .

Derek Eder @derekeder https://twitter.com/#!/derekeder derekeder.com derek.eder@gmail.com

fgregg commented 10 years ago

I also bet that there's some client side optimizations. It seems there has to be another way to draw a colored grid other than defining a polygon for each grid cell.

On Fri, May 2, 2014 at 10:31 AM, Derek Eder notifications@github.comwrote:

I smell tile rendering in our future.

On Fri, May 2, 2014 at 10:26 AM, Forest Gregg notifications@github.comwrote:

Let's just go down one more than, to 250.

On Fri, May 2, 2014 at 10:23 AM, Eric van Zanten notifications@github.comwrote:

@fgregg https://github.com/fgregg That lies somewhere in between 100m and 500m, depending on your hardware. 100m resolution froze Firefox on my laptop.

— Reply to this email directly or view it on GitHub< https://github.com/datamade/wopr-grid/issues/1#issuecomment-42043408> .

773.888.2718 2231 N. Monticello Ave Chicago, IL 60647

Reply to this email directly or view it on GitHub< https://github.com/datamade/wopr-grid/issues/1#issuecomment-42043792> .

Derek Eder @derekeder https://twitter.com/#!/derekeder derekeder.com derek.eder@gmail.com

— Reply to this email directly or view it on GitHubhttps://github.com/datamade/wopr-grid/issues/1#issuecomment-42044308 .

773.888.2718 2231 N. Monticello Ave Chicago, IL 60647

evz commented 10 years ago

@derekeder Yeah, This is a perfect application for that. There's gotta be a nice middle ground someplace.

@fgregg Just pushed up a version that allows 400m and 300m resolutions. 250m was still causing rendering issues.

I'll take a look at how we might render the grid differently. The way it's done currently is pretty flexible as the query just gives us back the center point of each aggregate. Each box is drawn by figuring out where the lower left (SW) and upper right (NE) corners should be based upon that and the size of the box in lat/lon degrees. That also gives us an easy way to hook events to each box (that's how the hover thing works). Maybe the way to fix this is to pre-calculate each box and make the grid in python and return the whole thing as one geometry. Don't know if that'll actually make the browser render it any better but it might. Mike Bostock's TopoJSON thing might be a way of making this work.

derekeder commented 10 years ago

Yah ~300m looks awesome

screen shot 2014-05-02 at 10 55 48 am

What about generating a GeoJSON layer on the fly and adding that as a new layer. Its what we do for wherewework and that site loads pretty quick with all those census tracts.

evz commented 10 years ago

I just pushed up a change to this app and the API which precalculates the grid on the API side and then expects the grid to be precalculated on the client side. Does not appear to have made much of a difference.