developmentseed / worldpop

Get the population of regions that you draw!
http://developmentseed.github.io/worldpop
BSD 2-Clause "Simplified" License
12 stars 7 forks source link

download geojson result #6

Closed anandthakker closed 9 years ago

anandthakker commented 9 years ago

once polygon area is calculated, provide link to download geojson of the result:

{
  type: "FeatureCollection",
  properties: { totalPopulation: xxx, totalArea: yyy, polygonArea: vvv, source: [/* url(s) for relevant worldpop data download pages */ ] },
  features: [ /* features are polygons of constant pop. density, each with population and area as properties*/ ]
}
anandthakker commented 9 years ago

Just started working on this and realized that the memory implications might be prohibitive. The problem is that after we "rehydrate" the vector tile data into GeoJSON, all those tiny features we're adding up to get the total population start to add up pretty quick.

Now, because of the way the vector tiles work, we could actually stream this straight to the download, so that we'd only ever have 1 tiny polygon in memory at a time. (That's already how we're processing the data to get the total.) But doing this for the download might be slightly complicated, so I'm wondering: is a valuable enough feature to be worth some extra time, or should we punt on it?

/cc @smit1678 @jflasher

smit1678 commented 9 years ago

I think that's fine to punt on this until we have more data to export with your shape.

anandthakker commented 9 years ago

Cool. Could also just do a simpler version that just downloads the drawn polygon with population count (i.e., excluding the smaller internal polygons)