mikegough / 3D-Landscape-Simulator

A web based ST-Sim application with 3D visualization.
0 stars 1 forks source link

Add process for showing user total acreage shown #6

Open TaylorMutch opened 8 years ago

TaylorMutch commented 8 years ago

We have had a couple people (including managers) suggest the need to display the total acreage that is being visualized. We should be able to do this by calculating the area based on the fact that we are selecting elevation data that spans a given area/acreage.

TaylorMutch commented 8 years ago

@mikegough There may be a way to do this on the fly. We can calculate the pixels that correlate to a given state class in the frontend by iterating over the stateclass texture. Since we will already know which one goes with each stateclass, we could show these values in the stacked area charts.

Alternatively, we can calculate these on the backend using numpy (probably better), and just call the values through a view the same way that we do with the non-spatial runs.

mikegough commented 8 years ago

Hey Taylor,

We can get the area of the drawn polygon from Leaflet with the line below. I'm actually doing this in the Climate console (sorry, I had forgotten). It's not working on the simulator for some reason, but once we figure out why, it will probably be easier to get the area this way.

var area = L.GeometryUtil.geodesicArea(e.layer.getLatLngs());

Mike

On Thu, Sep 1, 2016 at 10:15 PM, Taylor Mutch notifications@github.com wrote:

@mikegough https://github.com/mikegough There may be a way to do this on the fly. We can calculate the pixels that correlate to a given state class in the frontend by iterating over the stateclass texture. Since we will already know which one goes with each stateclass, we could show these values in the stacked area charts.

Alternatively, we can calculate these on the backend using numpy (probably better), and just call the values through a view the same way that we do with the non-spatial runs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mikegough/3D-Landscape-Simulator/issues/6#issuecomment-244285097, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0q2Q3QOiv3NtNf6PU5hWr_mZnAMruvks5ql7DagaJpZM4JyMqT .

Mike Gough | GIS Analyst Conservation Biology Institute http://www.consbio.org 136 SW Washington Avenue, Suite 202 | Corvallis, OR 97333 ph: (541) 368-5809 |fax: (541) 752-0518 http://www.facebook.com/Conservation.Biology.Institute https://twitter.com/ConsBio databasin.org http://www.databasin.org

TaylorMutch commented 8 years ago

@mikegough That sounds like a good solution - is the area going to be affected when we project those coordinates into Albers?

mikegough commented 8 years ago

A little. But not enough to matter. In theory the leaflet calculated area is a geodesic calculation and therefore "should" be more accurate then what we'd get from calculating the area from the projected data...although since the Albers projection we're using is an equal area projection, if we calculated area from it it would be pretty accurate. Anyway, the difference between the two methods should be negligible.

Mike

On Fri, Sep 2, 2016 at 2:12 PM, Taylor Mutch notifications@github.com wrote:

@mikegough https://github.com/mikegough That sounds like a good solution - is the area going to be affected when we project those coordinates into Albers?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mikegough/3D-Landscape-Simulator/issues/6#issuecomment-244488623, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0q2abjatPdwiRkIE99Eac9Ach2BzSPks5qmJEvgaJpZM4JyMqT .

Mike Gough | GIS Analyst Conservation Biology Institute http://www.consbio.org 136 SW Washington Avenue, Suite 202 | Corvallis, OR 97333 ph: (541) 368-5809 |fax: (541) 752-0518 http://www.facebook.com/Conservation.Biology.Institute https://twitter.com/ConsBio databasin.org http://www.databasin.org

TaylorMutch commented 8 years ago

@mikegough If we need more accuracy we can develop solution, but I think for starters we can use the Leaflet method. We can pass that value back to ST-Sim if we need it for the non-spatial runs, but I don't believe the spatial runs need that information.

The goal anyway is to be able to display to the user the info anyway, so probably best to use the Leaflet method. Awesome!

TaylorMutch commented 7 years ago

@mikegough I can pass back the total area based on the size of the area I clip out and we can display that somewhere on the UI, maybe below the location selected. Based on your comment about the Albers projection, that might be the best way to go at it. I'm going to move this to Phase 2 since this is a low hanging fruit issue we could knock out early in the next iteration.

mikegough commented 7 years ago

Hey Taylor,

Sounds good. Just to throw this out there as a another option: we could also get this directly from leaflet. In the case of a selected polygon (e.g., Counties) I could store/retrieve this from the JSON file. And in the case of the user defined box, I'm pretty sure Leaflet has a function for getting the area. Either way, I think reporting on the area is a good idea.

Mike

On Fri, Sep 30, 2016 at 8:22 AM, Taylor Mutch notifications@github.com wrote:

Reopened #6 https://github.com/mikegough/3D-Landscape-Simulator/issues/6 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mikegough/3D-Landscape-Simulator/issues/6#event-808617356, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0q2S-MtAdvFi3gcB4W9oVMQPyuyy9Aks5qvSk4gaJpZM4JyMqT .

Mike Gough | GIS Analyst Conservation Biology Institute http://www.consbio.org 136 SW Washington Avenue, Suite 202 | Corvallis, OR 97333 ph: (541) 368-5809 |fax: (541) 752-0518 http://www.facebook.com/Conservation.Biology.Institute https://twitter.com/ConsBio databasin.org http://www.databasin.org