Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] When exporting data to GeoJSON or Excel - align output format to indicator type (integer, float, category) #139

Open
2 tasks
janbur opened this issue Nov 20, 2023 · 0 comments
Labels
🕓 3 - 4 hours It will take me between 2 hours to half a day.

Comments

@janbur
Copy link
Collaborator

janbur commented Nov 20, 2023

Overview

In GeoSight, indicators can be of 3 types: 1) Integer, 2) Float, 3) Category. Type 1 and 2 are numbers, type 3 is string. From the dashboard view, users can download the data in Excel or GeoJSON formats:
image

Problem

When exporting to GeoJSON, all value in the Value column are represented as strings not numbers, thus cannot be directly used for visualization e.g. as a choropleth map in other GIS systems, e.g. in QGIS:
image

{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[44.23612530500003, 10.472074538000072], ...[44.23612530500003, 10.472074538000072]]]] }, "properties": { "ucode": "SOM_0001_0001_V1", ... "adm1_ucode": "SOM_0001_V1", "adm1_type": "Admin Level 1", "adm0_ucode": "SOM_V1", "adm0_type": "State", "IndicatorCode": "SAMPLE_IND_A", "IndicatorName": "Sample Indicator A", "Value": "69", "Date": "" } },

Note:
"Value": "69"

Similarly, when exporting to Excel, all values are formated as strings and need to be converted to number before they can be analyzed (e.g. summed).
These require from users a few additional steps, especially in GeoJSON they need to create new columns and calculate new values based on strings. This is often time consuming and may require additional skills from end users. As a result, many users cannot work effectively with data downloaded from GeoSight.

Proposed solution

  • When exporting to GeoJSON, if all indicators are number-based (integer or float) - export values in GeoJSON as numbers, not strings (i.e. without double quotes.
  • When exporting to Excel, export all number-based values as numbers, so that Excel will rezognize them as numbers

See sample files exported from https://geosight.unicef.org/project/demo-geosight-project:
Demo GeoSight Project.xls
Demo GeoSight Project.json

Expected, fixed GeoJSON:
Demo GeoSight Project - numbers.json

Values are represented as numbers, and the file can be directly used in GIS tools, e.g. QGIS, for mapping:
image

@janbur janbur added the 🕓 3 - 4 hours It will take me between 2 hours to half a day. label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕓 3 - 4 hours It will take me between 2 hours to half a day.
Projects
None yet
Development

No branches or pull requests

1 participant