WaterPath-Project / waterpath-data-service

0 stars 0 forks source link

create endpoint for isoraster #1

Open nauta008 opened 1 month ago

nauta008 commented 1 month ago

POST request

input arguments:

output:

Katsivelisp commented 3 weeks ago

@nauta008 is it possible to also get the population per area (GID) in the GeoJSON, which I'm assuming is calculated given the total population and the gridded data? This could be output directly from the endpoint, no need to create a file for that. What input argument would be required?

Katsivelisp commented 3 weeks ago

@nauta008 I was also checking https://human-settlement.emergency.copernicus.eu/download.php?ds=DUC, which has population per GID, also fractions for urban/rural. Perhaps this could be a better way to do this. What do you think?

nauta008 commented 3 weeks ago

@Katsivelisp The model needs to work with gridded population data to calculate the gridded pathogen loads. The GeoJSON data format is not designed to work with gridded spatial data.

Katsivelisp commented 3 weeks ago

@nauta008 I didn't mean that you should do anything to the GeoJSON. My request was: as your code produces the isoraster file, is it possible it also produces values for the isodata table, per GID (population per GID, urban/rural fractions), through the isoraster and total population values? Or is this something we can do with an external data source ourselves?

nauta008 commented 3 weeks ago

Sorry, I misunderstood the question. But the answer is yes. We can aggregate the gridded population data to zonal sums using the GID and corresponding geometry. I've the logic available and I'm sure there is way to output the result as a GeoJSON. Ideally, the required input should look like:

  1. gridded population density (worldpop)
  2. fraction urban/rural population per GID (UN data)
  3. geometries per GID (GADM data)

So, instead of the isoraster it would be better to directly use the gadm shapefiles. Actually, the isoraster is the gridded equivalent of the gadm shapefile. However, the isoraster would also work, but the zonal sums of a geometry would be more precise. Note that input data 2 and 3 could be combined into one spatial data format (geojson or shapefile) holding the geometry and fraction urban/rural population.