Home

Awesome

Occtax-mobile

GeoNature Android mobile application for Occtax GeoNature module.

Based on datasync module to synchronize data and maps module to show maps data.

Documentation

Launcher icons

NameFlavorLauncher icon
DefaultgenericPNX PNX_debug

Settings

The app settings file is automatically updated locally when the application is started, as soon as the GeoNature URL is defined, with the one on GeoNature server. This settings file settings_occtax.json can be found locally in the Android/data/fr.geonature.occtax2/ directory of the terminal's main storage. Example:

{
  "area_observation_duration": 365,
  "sync": {
    "geonature_url": "https://demo.geonature/geonature",
    "taxhub_url": "https://demo.geonature/taxhub",
    "gn_application_id": 3,
    "observers_list_id": 1,
    "taxa_list_id": 100,
    "code_area_type": "M1",
    "page_size": 10000
  },
  "map": {
    "show_scale": true,
    "show_compass": true,
    "max_bounds": [
      [52.0, -6.0],
      [41.0, 9.0]
    ],
    "center": [46.0, 3.0],
    "start_zoom": 10.0,
    "min_zoom": 8.0,
    "max_zoom": 19.0,
    "min_zoom_editing": 12.0,
    "base_path": "Offline_maps",
    "layers": [
      {
        "label": "IGN: plan v2",
        "source": "https://wxs.ign.fr/essentiels/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE=normal&TILEMATRIXSET=PM&FORMAT=image/png&LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2"
      },
      {
        "label": "IGN: ortho",
        "source": "https://wxs.ign.fr/ortho/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE=normal&TILEMATRIXSET=PM&FORMAT=image/jpeg&LAYER=ORTHOIMAGERY.ORTHOPHOTOS"
      },
      {
        "label": "OpenStreetMap",
        "source": [
          "https://a.tile.openstreetmap.org",
          "https://b.tile.openstreetmap.org",
          "https://c.tile.openstreetmap.org"
        ]
      },
      {
        "label": "OpenTopoMap",
        "source": [
          "https://a.tile.opentopomap.org",
          "https://b.tile.opentopomap.org",
          "https://c.tile.opentopomap.org"
        ]
      },
      {
        "label": "IGN plan",
        "source": "plan.mbtiles"
      },
      {
        "label": "IGN ortho",
        "source": "ortho.mbtiles"
      },
      {
        "label": "Mailles 5x5",
        "source": "mailles.geojson"
      }
    ]
  },
  "input": {
    "date": {
      "enable_end_date": true,
      "enable_hours": true
    }
  }
}

Parameters description

ParameterUIDescriptionDefault value
area_observation_durationArea observation duration period (in days)365
syncData synchronization settings (cf. https://github.com/PnX-SI/gn_mobile_core/tree/develop/datasync)
mapMaps settings (cf. https://github.com/PnX-SI/gn_mobile_maps/tree/develop/maps)
inputInput form settings
input/dateDate settings
nomenclatureNomenclature settings
nomenclature/save_default_valuesSave default nomenclature valuesfalse
nomenclature/additional_fieldsShow additional fieldsfalse
nomenclature/informationInformation settings (as array)
nomenclature/countingCounting settings (as array)

Input settings

Allows to configure settings related to user input.

Date settings

How the user can set the start and end date of the input:

ParameterDescriptionDefault value
enable_end_dateWhether to edit as well the end date of the inputfalse
enable_hoursWhether to edit as well the hour part of the start and end date (if enabled)false

The combination of these parameters gives the following configuration:

If nothing is configured, only the start date without the hour part is editable.

Nomenclature settings

save_default_values: Allows to save locally and only during a session of use selected nomenclature values as default values (default: false).

Allows to define if fields are displayed by default and if they are editable (visible). If a field is not editable (visible), it will use the default value set in Occtax database.

All these settings may not be defined and the default values will then be used instead:

Information settings

NomenclatureLabelDisplayed by defaultEditable (visible)
METH_OBSObservation methodstruetrue
ETA_BIOBiological statetruetrue
METH_DETERMINDetermination methodfalsetrue
determinerDeterminerfalsetrue
STATUT_BIOBiological statusfalsetrue
OCC_COMPORTEMENTBehaviourfalsetrue
NATURALITELevel of naturalnessfalsetrue
PREUVE_EXISTProof of existencefalsetrue
commentCommentfalsetrue

Counting settings

NomenclatureLabelDisplayed by defaultEditable (visible)
STADE_VIELife stagetruetrue
SEXESextruetrue
OBJ_DENBRPurpose of the enumerationtruetrue
TYP_DENBRType of enumerationtruetrue
count_minMintruetrue
count_maxMaxtruetrue
mediasMediastruetrue

Note: Any unknown nomenclature attribute added will be simply ignored at startup.

You can override these default settings by adding a property for each nomenclature settings, e.g:

{
  "nomenclature": {
    "save_default_values": false,
    "information": [
      "METH_OBS",
      {
        "key": "ETA_BIO"
      },
      {
        "key": "METH_DETERMIN",
        "visible": true,
        "default": true
      },
      {
        "key": "STATUT_BIO",
        "visible": true,
        "default": false
      },
      {
        "key": "OCC_COMPORTEMENT",
        "visible": true,
        "default": false
      },
      {
        "key": "NATURALITE",
        "visible": true,
        "default": false
      },
      {
        "key": "PREUVE_EXIST",
        "visible": true,
        "default": false
      }
    ],
    "counting": ["STADE_VIE", "SEXE", "OBJ_DENBR", "TYP_DENBR"]
  }
}

Each property may be a simple string representing the nomenclature attribute to show or an object with the following properties:

PropertyDescriptionMandatory
keyThe nomenclature attribute
visibleIf this attribute is visible (thus editable) or not (default: true)
defaultIf this attribute is shown by default (default: true)

Example:

Override parameters from app settings

As this local settings file is updated automatically with the one on GeoNature server, we advise you not to update it directly by hand. To do this, you can locally overwrite the values from the GeoNature server by creating a settings_occtax.local.json file in the same location as the app settings file in the terminal's main storage. Then simply copy the parameters to be overwritten, respecting the JSON structure of the app settings file. Example, to override map layers configuration:

{
  "map": {
    "layers": [
      {
        "label": "OpenStreetMap",
        "source": [
          "https://a.tile.openstreetmap.org",
          "https://b.tile.openstreetmap.org",
          "https://c.tile.openstreetmap.org"
        ]
      },
      {
        "label": "My awesome layer",
        "source": "custom.mbtiles"
      }
    ]
  }
}

⚠ Note: When using such a configuration, which can potentially replace all the application's parameters, it's your responsibility to ensure that the final configuration is always valid and keeps pace with any changes made to GeoNature.

In case of errors, if the final configuration is incorrect, the application will automatically ignore the local settings file that allows you to replace the parameters and load the default configuration from GeoNature. Any errors reported can be found in the application logs.

Upgrade git sub modules

Do NOT modify directly any git sub modules (e.g. commons, compat, mountpoint, viewpager and maps). Any changes should be made from each underlying git repository:

./upgrade_submodules.sh

Troubleshooting

Full Build

A full build can be executed with the following command:

./gradlew clean assembleDebug

Financial support

This application have been developed with the financial support of the Office Français de la Biodiversité.