Skip to content

Conversation

@francbartoli
Copy link
Contributor

@francbartoli francbartoli commented Oct 21, 2025

Overview

This PR adds support to the most recent JSON-FG specification 0.3. It returns JSON-FG formatted payload with the following conformance classes:

  • http://www.opengis.net/spec/json-fg-1/0.3/conf/core
  • http://www.opengis.net/spec/json-fg-1/0.3/conf/types-schemas

A new formatter has been added to the core for that scope and must rely on GDAL>=3.12 which supports 0.3 (not yet released as of today). As a consequence, this is a breaking change for our dependencies chain and cannot be merged until rasterio will support that version as well.
This potentially might be relaxed after the merge of this branch https://github.com/geopython/pygeoapi/tree/formatters to have the formatter configurable at resource level and so the GDAL requirement needed only if it is configured.

Related Issue / discussion

Additional information

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

@francbartoli francbartoli self-assigned this Oct 22, 2025
@francbartoli francbartoli force-pushed the feature/support-jsonfg branch from e88d476 to 2359c2e Compare October 22, 2025 14:36
@webb-ben
Copy link
Member

webb-ben commented Oct 25, 2025

How does this provider differ from a (generic) GDAL based formatter capable of formatting to any OGR data type?

@francbartoli
Copy link
Contributor Author

It is very close potentially, what are you imaging?

with gdal.OpenEx(json.dumps(data)) as srcDS:
tmpfile = f"/vsimem/{uuid.uuid1()}.json"
LOGGER.debug("Translate GeoJSON into a JSONFG memory file")
gdal.VectorTranslate(tmpfile, srcDS, format="JSONFG")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well once you read it into GDAL, any vector driver transform can occur. Wondering if would be possible to make any output format in the same spirit of the OGR provider - formatter config only barrier to add Shapefile, KML, etc. as an output format for pygeoapi GeoJSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants