DHIS2 Data Element Value Type Coordinate

Dear Experts,
I hope this email finds you well, Please let us know how will coordinate be entered in data element value.

With Best Regards
Mohammad Ayub Yousafzai
Kabul, Afghanistan

Dear @mohammadayub864

you can find the coordinate type format in the following link of DHIS2 document

Hope it works
Haliz

1 Like

Dear @Haliz.t ,

Thank you, I first studied the document but not accepting the value. I create two data elements with aggregate and select value type coordinate type the below values give error not accepting.

Regards
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Dear Mohammad,
The different value types is not always easy to understand.
Generally coordinates are entered under Organisational Units and not under Data Elements. I am not sure if I know a use case where coordinates are captured against a data element type, as that does not make sense to me. I am not sure if it can be used as support to mapping if captured against a data element. Can you explain why you need to show it as a data element?
Norah

Dear @Norah_Stoops,
Thank you, I have a form which has lat and long. when created column chart easily convert to map and view it as map to pick lat and long from form.
I saw the dhis2 document related to coordinate value type. it is supporting data element with dataset but the lat and long values are accepted.

With best Regards
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Hi @mohammadayub864 ,

Sorry for this. Coordinates can be saved to the database in the form [longitude, latitude] (for example: [108.40338,12.17403]) (note the brackets). Unfortunately, the check is incorrect in the data entry app, so if you do enter the coordinates with the brackets, the app will flag this as invalid and will not allow you to post the value. We have opened a ticket to fix this. Thank you for letting us know about the issues here.

As a workaround, if you feel comfortable entering data via the api, you could use the api/dataValues endpoint to post the data (with brackets) without using the data entry app.

2 Likes

Dear @tzemp,

I hope this message finds you well and the coordinates issue shall solve soon.

Regards
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Hi @mohammadayub864 : thanks. Hope you’re doing well too.

We have fixed the issue in our development branch, so for example in play/dev, you can now enter the coordinates with brackets:

Since we’re in the middle of preparing for our 2.40 release, I will need to ask my colleagues when we’ll be able to merge that fix into versions 2.37 to 2.40. We will give an update here when the change is released.

1 Like

Dear @tzemp,

Thank you Thomas Zemp , Please consider that when it is changed from chart to map it automatically detects the lng and lat.

With Best Regards
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Dear @tzemp,

I hope this email finds you well, I have a form it has longitude and latitude and other data as well I want to create a chart and a chart changes to map and taken lat and long from a form it displays on map.

but created one column kabul and add long and lat it gives error in data visualizer.

With Best Regards
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Dear @tzemp,

Please allow it data visualizer to accept the value and in dashboard it automatically changes to map.

Thank you
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Dear @tzemp,

I have a comment. it will be good if you add in maps a dataset option.

Regards
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Hi @mohammadayub864. I don’t work on the data visualizer and maps apps, so I’d have to let my colleagues weigh in on this.

In general, though, the idea in DHIS2 is that you enter data against a specific organisation unit and then the organisation unit contains coordinate information; this lets you then generate maps as the data is associated with a coordinate (see @Norah_Stoops response above).

We do have the data element with a value type of coordinate (which as you noted was not validating properly in our data entry app), but in general this is not a standard use case.

Could you provide more detail about what you want to do (what kind of data you want to enter, what kind of maps you want to produce)? Then we can maybe suggest how you can accomplish that.

Dear @tzemp,

Thank you for your information but it was suggestion if value type is supported for coordinate then it must support. i want to design this and show in both map and charts

what is your solution ?

Regards
Mohammad Ayub Yousafzai
Kabul , Afghanistan

Dear Community,

I hope this message finds you well, there is an issue with coordinate value type which is not accepting in data entry form. please fix it in next patch update 2.39 or 2.40 if it is soon solved. it will be great.

Thank you

Mohammad Ayub Yousafzai
Kabul , Afghanistan


Moderator message: (moving @austin tag from top of the post, please address community in topics)

Hi @mohammadayub864 : We’ve merged the fix for the data entry app for 2.37 to 2.40, so that validation will be fixed in the next releases. I don’t, however, think you can create a map from data elements with a coordinate value type.

It might be possible for you to accomplish what you want using tracked entity instances and relationships, but I’m not sure. It might be helpful to open that as a new question to the community (sharing an example of both the chart and map you want to create). If it’s not possible currently, you could then create a request to add that feature.

1 Like

Hi @mohammadayub864,
To define a data element as a coordinate type, you can see and use the following attached screenshot

This will define the data element as a dictionary with two separate fields for x and y coordinates. You can then use this data element in your form as needed.

Make sure to replace the x and y values with your own coordinate values.

attached will help you

Enjoy :slight_smile:

1 Like