PHPackages                             symbioquine/farmos\_wfs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. symbioquine/farmos\_wfs

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

symbioquine/farmos\_wfs
=======================

WFS module for farmOS.

4.0.0(2mo ago)86311GPL-3.0-or-laterPHPCI failing

Since Jan 9Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/symbioquine/farmOS_wfs)[ Packagist](https://packagist.org/packages/symbioquine/farmos_wfs)[ Docs](https://github.com/symbioquine/farmOS_wfs)[ RSS](/packages/symbioquine-farmos-wfs/feed)WikiDiscussions 4.x Synced yesterday

READMEChangelog (4)Dependencies (1)Versions (16)Used By (0)

farmOS\_wfs
===========

[](#farmos_wfs)

[![Latest Stable Version](https://camo.githubusercontent.com/fc26916e746c5da092fc08ab9a67342e624f819118e644f0e3528861df00d2cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f73796d62696f7175696e652f6661726d4f535f776673)](https://www.drupal.org/project/farmos_wfs/releases) [![License](https://camo.githubusercontent.com/3a064a97802c64f474bba497c04d2af809d1f3cbdca79106dd8d051779596223/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73796d62696f7175696e652f6661726d4f535f776673)](https://github.com/symbioquine/farmOS_wfs) [![Run 4.x tests](https://github.com/symbioquine/farmOS_wfs/workflows/Run%204.x%20tests/badge.svg?branch=4.x)](https://github.com/symbioquine/farmOS_wfs/workflows/Run%204.x%20tests/badge.svg?branch=4.x)

farmOS\_wfs provides a WFS module for farmOS. This makes FarmOS areas accessible as a [Web Feature Service (WFS)](https://www.opengeospatial.org/standards/wfs)which can be used in [GIS software](https://en.wikipedia.org/wiki/Geographic_information_system) such as [Quantum GIS](https://qgis.org) (QGIS).

Limitations &amp; Compatibility
-------------------------------

[](#limitations--compatibility)

- Only supports WFS 1.1.0 / GML 3.1.1 currently
- Only supports features with single geometries of the types; point, polygon, or line string
- Only supports querying/updating/deleting by simple filters on BBOX or feature id - more complex OGC Filter operations may be supported in the future
- Only supports the [EPSG:4326](https://epsg.io/4326) spatial reference system (SRS) which farmOS uses - QGIS and similar software generally supports reprojection of data sources into other SRS'
- Only supports PHP &gt;= 7.4 - earlier versions will not work
- Only tested against the farmOS 4 - for farmOS 1.x see [farmOS\_wfs-7.x-1.x](https://github.com/symbioquine/farmOS_wfs/tree/7.x-1.x)
- Only tested with QGIS 3.34 - earlier versions may work, but no promises

Getting Started
---------------

[](#getting-started)

Use Composer and Drush to install farmOS\_wfs in farmOS 4.x;

```
composer require drupal/farmos_wfs
drush en farmos_wfs
```

*Available released versions can be viewed at [https://www.drupal.org/project/farmos\_wfs/releases](https://www.drupal.org/project/farmos_wfs/releases)*

### QGIS Configuration

[](#qgis-configuration)

#### Configure OAuth2

[](#configure-oauth2)

- Name: `farmOS0-oauth2-resource-owner` (Name as desired)
- Grant Flow: Resource Owner
- Token URL: `https://path-to-your-farmOS-server.example.com/oauth/token`
- Client ID: `farm`
- Username: `your-farmOS-username`
- Password: `your-farmOS-username`
- Scope: `farm_manager`

[![image](https://user-images.githubusercontent.com/30754460/204117300-ea90c4b8-ad88-4571-9aad-3c30881a36b7.png)](https://user-images.githubusercontent.com/30754460/204117300-ea90c4b8-ad88-4571-9aad-3c30881a36b7.png)

#### Configure WFS Server Connection

[](#configure-wfs-server-connection)

- Name: `FarmOS0` (Name as desired)
- URL: `https://path-to-your-farmOS-server.example.com/wfs`
- Authentication Config: Choose the OAuth2 configuration created above

[![image](https://user-images.githubusercontent.com/30754460/104083679-7bc0c380-51f5-11eb-8200-38c225281212.png)](https://user-images.githubusercontent.com/30754460/104083679-7bc0c380-51f5-11eb-8200-38c225281212.png)

#### Add Layers

[](#add-layers)

- Click 'Connect' and add the desired layers to your map!

[![image](https://user-images.githubusercontent.com/30754460/103485307-4c035d00-4daa-11eb-851f-075d8e918344.png)](https://user-images.githubusercontent.com/30754460/103485307-4c035d00-4daa-11eb-851f-075d8e918344.png)

FAQ
---

[](#faq)

### Why is this useful?

[](#why-is-this-useful)

The farmOS\_wfs module allows bidirectional integration between farmOS and GIS with farmOS as the "source of truth" for asset data. This means complex mapping/geospatial tasks can be accomplished using QGIS and always up-to-date data directly from farmOS. Without farmOS\_wfs, doing something similar would involve importing/exporting data between farmOS/GIS formats which would make it hard to maintain a single authoritative data model.

### Why are the different geometries surfaced as separate feature types (layers)?

[](#why-are-the-different-geometries-surfaced-as-separate-feature-types-layers)

farmOS allows any asset to have arbitrary geometry or even collections of geometries, however QGIS - and I believe most GIS tools - expect the geometry of features in a feature type to be homogeneous. The WFS specification does allow for features with geometry types like GeometryCollection or MultiGeometry, but then these wouldn't be easily viewable or editable. farmOS\_wfs therefore makes the pragmatic choice of serving different geometry types as separate layers.

### Why are some fields prefixed with two underscores (e.g. "\_\_uuid")?

[](#why-are-some-fields-prefixed-with-two-underscores-eg-__uuid)

These are fields which farmOS/Drupal reports as read-only. Attempts to set values for such fields is not permitted through farmOS\_wfs and will produce an error. Generally these fields are also populated automatically which means they may change as a result of committing changes via farmOS\_wfs, but the new value will not appear until the feature is next fetched from farmOS.

### Why can't I delete certain assets?

[](#why-cant-i-delete-certain-assets)

farmOS maintains the validity of asset references. Certain assets - especially non-fixed ones - will have movement/location logs referencing them. Those logs would need to be deleted before the asset could be deleted.

Possible Future Directions
--------------------------

[](#possible-future-directions)

- Surface the `location` field - this needs more thought since the asset reference wouldn't be easily editable and a read-only name would be of limited utility
- Use database transactions for committing changes to assets
- Support more complex OGC Filter queries
- Support additional WFS versions - most importantly WFS 2.0.0 to get full-featured pagination
- Detect when PostGIS spatial indices exist on the Geofield columns and switch to using PostGIS `ST_` queries - relevant  &amp; [https://www.drupal.org/project/geofield\_postgis](https://www.drupal.org/project/geofield_postgis)
- Consider adding support for MultiPoint, MultiLineString, and MultiPolygon feature layers
- Consider adding geometry agnostic feature layers only parameterized by the asset type
- Add tests for OpenLayers as a client

Development
-----------

[](#development)

### Environment

[](#environment)

In the `docker/` directory of this repository run;

```
cp docker-compose.pgsql.yml docker-compose.yml
docker-compose up -d
```

Once the command completes, farmOS should be running at  with the farmOS\_wfs module installed. The test site's username and password are 'root' and 'test' respectively.

### Running Tests

[](#running-tests)

In the `docker/` directory with the above development environment started;

```
docker build -t qgis_test_harness qgis_test_harness
docker run --rm -it --name qgis --network=docker_default -v $(pwd)'/qgis_tests:/tests_directory' qgis_test_harness:latest ./run_tests.sh
```

#### More Complex Test Filtering

[](#more-complex-test-filtering)

**Running a single test:**

```
docker run --rm -it --name qgis --network=docker_default -v $(pwd)'/qgis_tests:/tests_directory' qgis_test_harness:latest ./run_tests.sh test_suite/test_cases/qgis_basic_crud_test.py::QgisBasicCrudTest::test_qgis_create_line_string_water_asset
```

**Running all 'non-point' qgis tests:**

```
docker run --rm -i --name qgis --network=docker_default -v $(pwd)'/qgis_tests:/tests_directory' qgis_test_harness:latest ./run_tests.sh -k 'qgis and not point'
```

*Arguments are passed as-is to pytest. See  for more information.*

### Formatting tests

[](#formatting-tests)

```
autopep8 --in-place --recursive docker/qgis_tests/
```

### Procedure for pushing new versions

[](#procedure-for-pushing-new-versions)

From the \[development branch\]\[development branch\] of this repository:

```
# Create the commit
git commit -m "Release version 4.0.1"

# Tag the release
git tag 4.0.1

# Push the 4.x branch and new tag
git push --atomic origin HEAD:4.x 4.0.1
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance83

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~124 days

Recently: every ~184 days

Total

16

Last Release

84d ago

Major Versions

0.1.4 → 1.1.42021-06-22

0.2.1 → 1.2.12021-09-11

1.2.3 → 2.0.02024-02-11

2.x-dev → 4.0.02026-02-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30754460?v=4)[Symbioquine](/maintainers/Symbioquine)[@symbioquine](https://github.com/symbioquine)

---

Top Contributors

[![symbioquine](https://avatars.githubusercontent.com/u/30754460?v=4)](https://github.com/symbioquine "symbioquine (78 commits)")

### Embed Badge

![Health badge](/badges/symbioquine-farmos-wfs/health.svg)

```
[![Health](https://phpackages.com/badges/symbioquine-farmos-wfs/health.svg)](https://phpackages.com/packages/symbioquine-farmos-wfs)
```

###  Alternatives

[farmos/farmos

A web-based farm record keeping application.

1.2k6.7k1](/packages/farmos-farmos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
