Skip to content

Commit

Permalink
Merge pull request #194 from hotosm/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
robsavoye authored Oct 8, 2023
2 parents d839d11 + ca6fb9e commit 0fab92b
Show file tree
Hide file tree
Showing 85 changed files with 8,081 additions and 8,958 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
repos:
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.6.0
rev: 3.10.0
hooks:
- id: commitizen
stages: [commit-msg]

# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black

# Lint / autoformat: Python code
- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.0.285"
rev: "v0.0.291"
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]

# Autoformat: YAML, JSON, Markdown, etc.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
rev: v3.0.3
hooks:
- id: prettier
args: [--ignore-unknown, --no-error-on-unmatched-pattern, "!chart/**"]

# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
rev: v0.37.0
hooks:
- id: markdownlint
args: [--fix, --ignore, CHANGELOG.md]
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ notice like this when it starts in an interactive mode:
This program comes with ABSOLUTELY NO WARRANTY; for details
type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
under certain conditions; type`show c' for details.
</pre>

The hypothetical commands `show w` and `show c` should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box".
Expand Down
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ talk from SOTM-US 2022 titled [OSM For
Firefighting](https://www.youtube.com/watch?v=qgk9al1rluE). Much of
the tech and usage is explained in these [tech
briefs](https://www.senecass.com/projects/Mapping/tech/). Currently
these are now part of the backend for the [Field Mapping Tasking Manager](
https://github.com/hotosm/fmtm/wiki) project at
these are now part of the backend for the [Field Mapping Tasking Manager](https://github.com/hotosm/fmtm/wiki) project at
[HOT](https://www.hotosm.org).

## Installation
Expand All @@ -45,25 +44,30 @@ The config file is uswd to store the credentials to access an ODK
Central server. You must have an account on the Central server of
course for this to work. That file looks like this:

url=https://foo.org
[email protected]
passwd=arfood
url=https://foo.org
[email protected]
passwd=arfood

#### Environment Variables

**LOG_LEVEL**

> If present, will change the log level. Defaults to DEBUG.
**ODK_CENTRAL_URL**

> The URL for an ODKCentral server to connect to.
**ODK_CENTRAL_USER**

> The user for ODKCentral.
**ODK_CENTRAL_PASSWD**

> The password for ODKCentral.
**ODK_CENTRAL_SECURE**

> If set to False, will allow insecure connections to the ODKCentral API. Else defaults to True.
## Using the Container Image
Expand Down Expand Up @@ -101,7 +105,7 @@ one is suitable for OSM,and is in OSM XML format. The other
No converted data should ever be uploaded to OSM without validating
the conversion in JOSM. To do efficient conversion from ODK to OSM,
it's best to use the XLSForm library as templates, as everything is
designed to work together.
designed to work together.

## basemapper.py

Expand All @@ -124,7 +128,7 @@ This program makes data extracts from
[OpenStreetMap](https://www.openstreetmap.org) data. Multiple input
sources are supported, a local postgresql database, the HOT maintained
[Underpass](https://galaxy.hotosm.org/) database, or
[Overpass](https://overpass-turbo.eu).
[Overpass](https://overpass-turbo.eu).

## odk2csv.py

Expand Down Expand Up @@ -156,16 +160,16 @@ Collect.
# Best Practices

To ensure the quality of your converted data, here are some best
practices to follow:
practices to follow:

- Always validate your conversion in JOSM before uploading to OpenStreetMap.

- Use the XLSForm library as templates to ensure that your ODK Collect
data is compatible with the conversion process.
data is compatible with the conversion process.

- If you're having trouble with the conversion process, try using the
utility programs included with Osm-Fieldwork to troubleshoot common
issues.
utility programs included with Osm-Fieldwork to troubleshoot common
issues.

By following these best practices and using the utility programs
included with Osm-Fieldwork, you can effectively process data collection
Expand Down Expand Up @@ -195,25 +199,26 @@ user interface. With XLSForms, you can easily design and test forms on
your computer, then deploy them to mobile devices for data collection
using ODK Collect or other data collection tools. XLSForms use a
simple and structured format, making it easy for you to share and
collaborate on form designs with your team or other organizations.
collaborate on form designs with your team or other organizations.

### Using the XLSForm Library with Osm-Fieldwork

The XLSForms in the XForms directory of the XLSForm Library have been
designed to support the HOT data models and have an efficient mapper
data flow. These forms also allow for editing of existing OSM data and
support the data models, specifying the preferred tag values for each
data item with the goal of both tag completeness and tag correctness.

### Here are some examples of how to use the XLSForm Library with Osm-Fieldwork:
### Here are some examples of how to use the XLSForm Library with Osm-Fieldwork

- Download an XLSForm from the XForms directory:

wget https://github.com/hotosm/xlsform/raw/master/XForms/buildings.xls
wget <https://github.com/hotosm/xlsform/raw/master/XForms/buildings.xls>

- Convert the XForm to OSM XML using CSVDump:

- Use the resulting OSM XML file with JOSM or other OSM editors to
validate and edit the data before uploading it to OpenStreetMap.
validate and edit the data before uploading it to OpenStreetMap.

### Conclusion

Expand All @@ -222,7 +227,7 @@ in humanitarian data collection, as it provides a collection of
pre-designed forms that are optimized for efficient mapper data flow
and tag completeness/correctness. By using the XLSForm Library with
Osm-Fieldwork, you can streamline your data collection process and ensure
the quality of your data.
the quality of your data.

Osm-Fieldwork is a powerful tool for processing data collection from
OpenDataKit into OpenStreetMap format. By following the best practices
Expand Down
14 changes: 11 additions & 3 deletions docs/about/About.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<!-- ![](images/hot_logo.png) -->

## OSM-Fieldwork Project

Osm_Fieldwork is a project that aims to simplify the process of processing data collected using OpenDataKit into OpenStreetMap format. It consists of several utility programs that automate different parts of the data flow. These include creating satellite imagery basemaps and data extracts from OpenStreetMap so they can be used with ODK Collect. It is maintained by the [Humanitarian OpenStreetMap Team (HOT)](https://www.hotosm.org/) and designed to work with [ODK Collect](https://docs.getodk.org/collect-intro/), an Android app for data collection, and [ODK Central](https://docs.getodk.org/central-intro/), a web-based platform for managing and visualizing data.

## osm_fieldwork

This program converts the data collected from ODK Collect into the proper OpenStreetMap tagging schema. The conversion is controlled by a YAML file, which makes it easy to modify for other projects. The output is an OSM XML formatted file for JOSM. However, it is important to note that no converted data should ever be uploaded to OSM without first validating the conversion in JOSM. To do high-quality conversion from ODK to OSM, it's best to use the XLSForm library as template, as everything is designed to work together.

Osm_Fieldwork includes the following utilities:
Expand All @@ -17,18 +20,21 @@ Osm_Fieldwork includes the following utilities:
Osm_Fieldwork also includes support modules, such as convert.py for processing YAML config files and osmfile.py for writing OSM XML output files.

## Installation

To install osm-fieldwork, you can use pip. Here are two options:

1. Directly from the main branch:
`pip install git+https://github.com/hotosm/osm-fieldwork.git`
`pip install git+https://github.com/hotosm/osm-fieldwork.git`

-OR-

2. Latest on PyPi:
`pip install Osm-Fieldwork`
`pip install Osm-Fieldwork`

> Note: installation requires GDAL >3.4 installed on your system.
## Usage

Each utility has its own command-line interface, with various options and arguments. You can find detailed instructions on how to use each utility by running it with the -h or --help option.
For example, to extract OSM data within a boundary polygon from Overpass Turbo, run:

Expand All @@ -43,7 +49,9 @@ To convert a CSV file from ODK Central to OSM XML format, run:
This will generate two output files - one OSM XML of public data, and the other a GeoJson file with all the data.

## Contributing

Osm_Fieldwork is an open-source project, and contributions are always welcome! If you want to contribute, please read the [Contribution Guidelines](https://github.com/hotosm/osm-fieldwork/wiki/Contribution) and [Code of Conduct](https://github.com/hotosm/osm-fieldwork/wiki/Code-of-Conduct) first.

## License

Osm_Fieldwork is released under the [AGPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html).
9 changes: 4 additions & 5 deletions docs/about/CSVDump.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ODK Central data into a compatible format.
-v, --verbose - verbose output
-i CSVFILE, --infile CSVFILE - Specifies the path and filename of the input CSV file downloaded from ODK Central. This option is required for the program to run.

### Examples:
### Examples

To convert a CSV file named "survey_data.csv" located in the current
working directory, the following command can be used:
Expand All @@ -22,15 +22,15 @@ command can be used:

[path]/CSVDump.py -i survey_data.csv -v

### Input Format:
### Input Format

CSVDump.py expects an input file in CSV format downloaded from ODK
Central. The CSV file should have a header row with column names that
correspond to the survey questions. Each row in the CSV file should
contain a response to the survey questions, with each column
representing a different question.

### Output Format:
### Output Format

The output of CSVDump.py is an OSM XML file that can be used with
OpenStreetMap data tools and services. The converted OSM XML file will
Expand All @@ -39,11 +39,10 @@ metadata associated with the survey. The format of the OSM XML file
generated by CSVDump.py is compatible with other OpenStreetMap data
tools and services.

### Limitations:
### Limitations

- CSVDump.py only supports CSV files downloaded from ODK
Central. Other CSV files may not be compatible with the tool.
- The tool only supports simple data types such as strings, numbers,
and dates. Complex data types such as arrays and nested structures
are not supported.

4 changes: 2 additions & 2 deletions docs/about/Contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ The [issue queue](https://github.com/hotosm/osm_fieldwork/issues) is the best wa

Create pull requests (PRs) for changes that you think are needed. We would really appreciate your help!

## Useful Resources for Contribution
## Useful Resources for Contribution

- [Troubleshooting](https://github.com/hotosm/osm-fieldwork/wiki/troubleshooting)
- [FAQs](https://github.com/hotosm/osm-fieldwork/wiki/FAQ)


## :handshake: Thank you

Thank you very much in advance for your contributions!! Please ensure you refer to our [Code of Conduct](https://github.com/hotosm/osm-fieldwork/wiki/Code-of-Conduct).
Expand Down
Loading

0 comments on commit 0fab92b

Please sign in to comment.