| 5 | | Sahana 2 has a nice hierarchical Locations system: |
| | 6 | These are the 'Admin Boundaries': L0 - L4 |
| | 7 | |
| | 8 | Adding of locations within the L0-L4 range should normally be done by the Administrator prior to going live with the deployment so that these can then be locked-down to the !MapAdmin role to prevent duplicate name entries. |
| | 9 | |
| | 10 | Default names (customisable in {{{models/000_config.py}}}): |
| | 11 | {{{ |
| | 12 | deployment_settings.gis.locations_hierarchy = { |
| | 13 | "L0":T("Country"), |
| | 14 | "L1":T("Province"), |
| | 15 | "L2":T("District"), |
| | 16 | "L3":T("Town"), |
| | 17 | "L4":T("Village") |
| | 18 | } |
| | 19 | }}} |
| | 20 | |
| | 21 | Since most deployments are restricted to just 1 or few countries, it is possible to hard-code which ones are used (in {{{models/000_config.py}}}): |
| | 22 | {{{ |
| | 23 | deployment_settings.L10n.countries = ["PK"] |
| | 24 | }}} |
| | 25 | |
| | 26 | |
| | 27 | |
| | 28 | == Selector == |
| | 29 | There are 6 ways of adding a location, listed in ideal order: |
| | 30 | 1. Bulk import has either Location Names or Lat/Lons |
| | 31 | * This could optionally use Image EXIF headers or a timesynced GPX file |
| | 32 | * NB: This refinement can be added later |
| | 33 | 2. HTML5 !GeoLocation: If the resource is one where the user is likely to be physically at the |
| | 34 | * NB: This refinement can be added later |
| | 35 | 3. Map: User clicks on a location on the map |
| | 36 | * If we have admin boundaries available then the correct hierarchy can be filled-in automatically |
| | 37 | * If not then the user can be prompted to provide these (as per 6) |
| | 38 | 4. Manual Entry of Lat/Lon (either from a GPS or looked up in an online resource like Wikipedia) |
| | 39 | * A Conversion tool is available to convert from Deg/Min/Sec to Decimal Degrees |
| | 40 | * If we have admin boundaries available then the correct hierarchy can be filled-in automatically |
| | 41 | * If not then the user can be prompted to provide these (as per 6) |
| | 42 | 5. Geocoder: Street Address is entered & this is matched to a location via a Geocoding service (Google & Yahoo have functionality ready in {{{modules/s3gis.py}}}. We need to add at least [http://geonames.org Geonames].) |
| | 43 | 6. Hierarchical Selector: |
| | 44 | * We have dropdowns for each of the different levels. |
| | 45 | * The country selector should remain hidden if there is only 1 country being used. |
| | 46 | * Initially just a single dropdown should be displayed. |
| | 47 | * When this dropdown is selected then the next dropdown is displayed, along with appropriate values |
| | 48 | * We download the values via AJAX in order to not have to download all Locations, however we could download the next set in the background whilst the user is thinking: means a bigger download to filter client-side, but maybe less time overall. Can be experimented with. |
| | 49 | * When the final dropdown is selected then the user has the option of adding a more specific Name & a Street Address |
| | 50 | * This should not be mandatory as some records need to link directly to the L0-L4 levels. |
| | 51 | |
| | 52 | If adding a new Location, then the name of the location should *not* be the general name, but rather a specific one |
| | 53 | * Where possible, we automate this by using the name of the Shelter or Hospital |
| | 54 | * Should we prevent 'Add Location' from working until that field is filled-in? |
| | 55 | * We need to make this clear in the online help. |
| | 56 | |
| | 57 | == Agasti == |
| | 58 | |
| | 59 | Sahana Phase2 has a nice hierarchical Locations system: |