Cadasta/cadasta-sdk

Partner Specific Needs

Closed this issue · 8 comments

  • Load questionnaire
  • Field map: district, township (English), village (Karen), party_name (Karen)
  • loop through folders: district/township/village tract/village/individual
  • Converting filenames to match up with choice in questionnaire (convert to lowercase, replace ' ' with '_', remove from '-' in individual name folder, remove "village track")
  • Grab .doc files in text/txt older and convert to .txt; rename individual name; convert font to Unicode and put in folder (SOME SECTIONS ARE IN BURMESE)
  • convert .gpb to .gpx so that can be uploaded... can we upload .gpb files?

This is a list of TODOs for a partner-specific use-case. Some of these can be addressed by SDK improvements, but others are not directly relevant to the SDK itself.

Load questionnaire

This should entail adding the questionnaire endpoint to the endpoints module and perhaps making a helper method to do this.

In the interim, this should be acheivable with updating the script to include something like:

url = cnxn.upload_file(PATH_TO_QUESTIONNAIRE_XLS, upload_to='xls-forms')
cnxn.put(endpoints.questionnaire(org_slug, proj_slug), json={'xls_form': url})

Field map district, township, village (Karen), party_name (any others?)

Not sure that I fully understand what this entails. Going to need a hand with understanding this.

loop through district/township/village tract/village/individual

Could update example script to follow new data organization, however this isn't something that directly relates to the SDK.

Converting filenames to match up with choice in questionnaire (convert to lowercase, replace ' ' with '_', remove from '-' in individual name folder, remove "village track")

Why is this important? This relates to scripting using the SDK, nowt the SDK itself.

Grab .doc files in text/txt older and convert to .txt; rename individual name; convert font to Unicode and put in folder (SOME SECTIONS ARE IN BURMESE)

Dumping data from a .doc file could probably be justified as being useful for the SDK, however converting to Unicode won't be relevant in the SDK (as each language will require it's own technique, I believe). However, it seems like this should be covered via the third-party sgkconvertknu.py script.

convert .gpb to .gpx

Will look into utilities to do this.

Regarding the .gpb files, do you mean .GDB files? I believe that those are ESRI GeoDatabase files. I was unable to open them with QGIS, do you have access to a copy of ArcGIS? Do you know anything more about these files?

Good link. I'm going to again assume that you meant to write .GDB files, as I haven't been able to find any .gpb files in the example data. Nonetheless, GPSBabel was indeed able to parse the .GDB file as a Garmin MapSource file. You'll need to install gpsbabel, ensure that it's available from the command line (verify with gpsbabel -V), and then set the script up to run something like the following:

import subprocess
subprocess.check_call("gpsbabel -w -r -t -i gdb -f '/path/to/input/file.gdb' -o gpx -F /path/to/output/file.gpx".split(' '))

Let me know if that doesn't make sense to you.

Sorry, you're right. My dyslexia kicked in. Sweet. I already have gps babel installed so that cli call looks perfect. Thanks!

FYI: I wasnt sure where to put this list up as I know it does not directly relate to the sdk (its a little extra), so I understand the confusion with the files looping, etc.

For the gdb files, I think we just need to convert them so that we can upload the gpx files. They dont need to be used per say. But I think that they way that Cadasta currently works uploading those files will show map layers and we dont want that... gr.

I think that we may have to hold off on that part, aka converting gdb to gpx and then uploading the gpx. The best solution would be to upload .gdb files so that they have access to them.

@SteadyCadence I'm going to go ahead and close this. Go ahead and re-open it if you feel that it's best to keep around.