onaio / Reveal-Thailand

Repository to raise & track issues, share code and documentation, and manage the Reveal Thailand Handover and Support Project (2022-2023)
0 stars 0 forks source link

GPS location data export #26

Closed pongthepm closed 1 year ago

pongthepm commented 1 year ago

I have a requirement from a site staff.

He wants data of GPS locations in his responsible areas including 5 provinces which are (53) Uttaradit, (63) Tak, (64) Sukhothai, (65) Phitsanulok, and (67) Phetchabun. He wants import the data into his GIS tool for presentation.

Could you please retrieve the GPS locations data with metadata such as house id, village, sub-district, district, province, and area type such as A1, A2 for him?

The 2 digits in the parentheses is the province id that you can extract from first 2 digits of the field bfid in the database.

Thank you, Pongthep

AngelaKabari commented 1 year ago

@pongthepm in the spirit of building Biophics' capacity, can your team use the instructions above to help the DVBD team with their request?

Of course, Ona will be here to support if you experience any issues, so please reach out here in case you need further guidance.

pongthepm commented 1 year ago

Hi, my developer has retrieved the data using your provided URL. We got the data in the area we wanted. However, it is just polygon data(please see the attached image). How can I get the location of the patients' house (Lat/Long)?

Could you please advise? Thank you, Pongthep

polygon SKR2
hilpitome commented 1 year ago

@pongthepm could you ensure that you have sent the request with params is_jurisdiction set to false and return_geometry set to true i.e is_jurisdiction=false&return_geometry=true. So the full url should look something like https://servermhealth.ddc.moph.go.th/opensrp/rest/location/findByProperties?is_jurisdiction=false&return_geometry=true&properties_filter=externalId:{bfid}

pongthepm commented 1 year ago

Thank you @hilpitome. I will ask my developer tomorrow if he did as you recommended.

pongthepm commented 1 year ago

@hilpitome Please see the attached images. I set is_jurisdiction=false&return_geometry=true, but it returned nothing. polygon-return no-data-return

hilpitome commented 1 year ago

@pongthepm tell the dev to try /opensrp/rest/location/findByProperties?is_jurisdiction=false&return_geometry=true&properties_filter=parentId:{operational area id} cc @Rkareko

hilpitome commented 1 year ago

@pongthepm do we have any update after trying out the above?

@pongthepm tell the dev to try /opensrp/rest/location/findByProperties?is_jurisdiction=false&return_geometry=true&properties_filter=parentId:{operational area id} cc @Rkareko

pongthepm commented 1 year ago

Hi @hilpitome I tried it using your latest script. Yes, I got the Lat/Long data of points (Please see the attached image), but how to get some more data of each point such as house owner's name and house address, and so on. Could you please link the point data to its detail? script-output

hilpitome commented 1 year ago

@pongthepm following my conversation with @Rkareko , you can get the client details using the structure id ( This is the id field in the above screenshot/response). You will get a list of clients associated with that structure by passing it as an attribute to the following url. https://servermhealth.ddc.moph.go.th/opensrp/rest/client/search?attribute=residence:{structure-id} You will get an array of all the clients in that house/structure. One of the objects will represent the whole family and it will have a field clientType with the value Family

pongthepm commented 1 year ago

I have tried it already, just 1 ID. It looks OK now. I am waiting for my dev if he can retrieve all IDs in the area.

Thank you for your support, Pongthep

hilpitome commented 1 year ago

@pongthepm was your dev able to find a way of getting all the data from the information above?

pongthepm commented 1 year ago

Hi @hilpitome Yes, he can retrieve the data by using your script. Thank you for your support, Pongthep

hilpitome commented 1 year ago

That is great @pongthepm . I think we can now close this issue cc @AngelaKabari @ekigamba

AngelaKabari commented 1 year ago

Thanks Hilary. @pongthepm I'm closing this out. Please feel free to re-open it should you need any further support.