hotosm / OpenMapKitServer

OpenMapKit Server is the lightweight server component of OpenMapKit that handles the collection and aggregation of OpenStreetMap and OpenDataKit data.
http://openmapkit.org
BSD 3-Clause "New" or "Revised" License
4 stars 9 forks source link

Download combined data as geojson #57

Closed smit1678 closed 6 years ago

smit1678 commented 6 years ago

Currently we keep ODK data separate from OSM feature data. The link between the two is an osm file, ex: "osm_building":"925bf47cc09acb0338fa21d4ae8112c729fcf8db.osm". This is helpful in separating non-OSM data from the OSM feature data. You can download each of type of data separately and then prevent any private data from being uploaded to OSM. One challenge is that sometimes you want the spatial data from the OSM file combined with the ODK data in geojson form. What is the best way to solve this?

We could post-process the data to extract the geo information from each OSM file and then combine it with the ODK data to create a new file.

Other idea is that we could do this via the server and combine the data to provide a new file for download as geojson.

Other suggestions @willemarcel?

smit1678 commented 6 years ago

This is one older implementation: https://github.com/AmericanRedCross/omk-odk-geojson

willemarcel commented 6 years ago

@smit1678 In the geojson endpoint that we created to show the submissions in the map, I'm reading the data.json file of each submission to get the submission_time and the username or deviceId. I can get all the data from that json file, skipping some keys that are not useful, and add to each feature of the geojson.

Would it solve this issue?

It would include that data in the new csv endpoint too (https://github.com/hotosm/OpenMapKitServer/issues/56), as I'm making the csv from converting the geojson.

I saw that it is common that we have some fields with hierarchy in the data.json, eg:

 "group_income": {
    "hhrevsum": 1,
    "hhrevwin": 1,
    "incfreq": 0,
    "incvar": 3
  }

In the geojson it's not a problem to have something like this, but in the csv it would generate a cell with a JSON content. Is it ok?

smit1678 commented 6 years ago

@willemarcel yeah I think this would be a fine approach for now. I think keeping a focus on geojson is good because there will be some hierarchy from the different type of forms people may create.