Skip to main content

A program for splitting a large AOI into smaller tasks.

Project description

FMTM Splitter

HOT

A utility for splitting a polygon onto multiple tasks.

Build CI Build Publish Docs Publish Test Package version Downloads License


📖 Documentation: https://hotosm.github.io/fmtm-splitter/

🖥️ Source Code: https://github.com/hotosm/fmtm-splitter


This is a program to split polygons into tasks using a variety of algorithms. It is a class that can be used by other projects, but also a standalone program. It was originally developed for the FMTM project, but then converted so it can be used by multiple projects.

The class takes GeoJson Polygon as an input, and returns a GeoJson file Multipolygon of all the task boundaries.

Installation

To install fmtm-splitter, you can use pip. Here are two options:

  • Directly from the main branch: pip install git+https://github.com/hotosm/fmtm-splitter.git

  • Latest on PyPi: pip install fmtm-splitter

Using the Container Image

  • fmtm-splitter scripts can be used via the pre-built container images.
  • These images come with all dependencies bundled, so are simple to run.

Run a specific command:

docker run --rm -v $PWD:/data ghcr.io/hotosm/fmtm-splitter:latest fmtm-splitter <flags>

Run interactively (to use multiple commands):

docker run --rm -it -v $PWD:/data ghcr.io/hotosm/fmtm-splitter:latest

Note: the output directory should always be /data/... to persist data.

Split By Square

The default is to split the polygon into squares. The default dimension is 50 meters, but that is configurable. The outer square are clipped to the AOI boundary.

Split By Feature

The split by feature uses highway data extracted from OpenStreetMap, and uses it to generate non square task boundaries. It can also be adjusted to use the number of buildings in a task to adjust it's size.

Split By Feature

Custom SQL query

It is also possible to supply a custom SQL query to generate the tasks.

The fmtm-splitter program

Options:

-h, --help                       show this help message and exit
-v, --verbose                    verbose output
-o OUTFILE, --outfile OUTFILE    Output file from splitting
-m METERS, --meters METERS       Size in meters if using square splitting
-b BOUNDARY, --boundary BOUNDARY Polygon AOI
-s SOURCE, --source SOURCE       Source data, Geojson or PG:[dbname]
-c CUSTOM, --custom CUSTOM       Custom SQL query for database

This program splits a Polygon (the Area Of Interest) The data source for existing data can'be either the data extract used by the XLSForm, or a postgresql database.

Examples:

fmtm-splitter -b AOI
fmtm-splitter -v -b AOI -s data.geojson
fmtm-splitter -v -b AOI -s PG:colorado

# Where AOI is the boundary of the project as a polygon
# And OUTFILE is a MultiPolygon output file,which defaults to fmtm.geojson
# The task splitting defaults to squares, 50 meters across

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fmtm-splitter-0.2.0.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

fmtm_splitter-0.2.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file fmtm-splitter-0.2.0.tar.gz.

File metadata

  • Download URL: fmtm-splitter-0.2.0.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.9.3 CPython/3.10.12

File hashes

Hashes for fmtm-splitter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4d2354b70989f9c4979715dbde23003b34ae0f1f429430ed8780991bd8bd4895
MD5 d7f91404bc480ec88fd439ff8357c484
BLAKE2b-256 523d4cf5ce286f8217ea36d5fccaa13eb9aaca5c2e99f3bffd99bac0705bdc73

See more details on using hashes here.

File details

Details for the file fmtm_splitter-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fmtm_splitter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a85823448c4c6bc570481f52be78063ab9745df489694107eaff0f41c809180
MD5 9f2d8cb08bec5e5920ae6cd9f62d893d
BLAKE2b-256 70fe306bcfe1cf9ba61343f7535c3ab8e9bfb1a8650bb38e1e1adb1992d3d9c0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page