convert_geojson_request

geodetic_engine.geojson.convert_geojson_request(body)[source]

Answer a convertGeoJson request as the OSDU service would.

The request and response are those of POST /v4/convertGeoJson, so results can be compared with the service’s, or used in their place. The output follows the service’s rule: plain GeoJSON when toCRS is WGS 84 longitude and latitude, with heights in metres, AnyCrs otherwise. A position that cannot be transformed is NaN, as there, and counted out of successCount.

Unlike the service, the package’s rules hold: a datum change needs an operation, named by transformation or bound in an early-bound CRS; a missing grid is an error; heights keep persistableReferenceUnitZ.

Parameters:

body (Mapping[str, Any]) – The request: featureCollection, toCRS, and optionally toUnitZ and transformation.

Return type:

dict[str, Any]

Returns:

The response – featureCollection, successCount, totalCount and operationsApplied.

Raises: