Skip to content

Commit

Permalink
Merge pull request #2814 from rouault/fix_2813
Browse files Browse the repository at this point in the history
BoundCRS: accept importing/exporting in WKT2 and PROJJSON the scope/area/extent/id attributes (fixes #2813)
  • Loading branch information
rouault authored Aug 19, 2021
2 parents 92d8cc6 + 31692d0 commit 4766b7c
Show file tree
Hide file tree
Showing 13 changed files with 1,316 additions and 36 deletions.
14 changes: 11 additions & 3 deletions data/projjson.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$id": "https://proj.org/schemas/v0.2/projjson.schema.json",
"$id": "https://proj.org/schemas/v0.3/projjson.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Schema for PROJJSON (v0.2.1)",
"description": "Schema for PROJJSON (v0.3)",
"$comment": "This file exists both in data/ and in schemas/vXXX/. Keep both in sync. And if changing the value of $id, change PROJJSON_CURRENT_VERSION accordingly in io.cpp",

"oneOf": [
Expand Down Expand Up @@ -111,12 +111,20 @@

"bound_crs": {
"type": "object",
"allOf": [{ "$ref": "#/definitions/object_usage" }],
"properties": {
"$schema" : { "type": "string" },
"type": { "type": "string", "enum": ["BoundCRS"] },
"name": { "type": "string" },
"source_crs": { "$ref": "#/definitions/crs" },
"target_crs": { "$ref": "#/definitions/crs" },
"transformation": { "$ref": "#/definitions/abridged_transformation" }
"transformation": { "$ref": "#/definitions/abridged_transformation" },
"scope": {},
"area": {},
"bbox": {},
"usages": {},
"remarks": {},
"id": {}, "ids": {}
},
"required" : [ "source_crs", "target_crs", "transformation" ],
"additionalProperties": false
Expand Down
2 changes: 1 addition & 1 deletion docs/source/apps/cct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ by :c:func:`proj_create`, provided it expresses a coordinate operation
uniqueness is not guaranteed, heuristics are applied to determine the appropriate best match.
- a OGC URN combining references for concatenated operations
(e.g. "urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618")
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.2/projjson.schema.json
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.3/projjson.schema.json

.. versionadded:: 8.0.0

Expand Down
2 changes: 1 addition & 1 deletion docs/source/apps/cs2cs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Synopsis
(*added in 6.2*)
- a OGC URN combining references for concatenated operations
(e.g. "urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618")
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.2/projjson.schema.json (*added in 6.2*)
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.3/projjson.schema.json (*added in 6.2*)
- a compound CRS made from two object names separated with " + ". e.g. "WGS 84 + EGM96 height" (*added in 7.1*)

.. versionadded:: 6.0.0
Expand Down
2 changes: 1 addition & 1 deletion docs/source/apps/projinfo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Synopsis
(*added in 6.2*)
- a OGC URN combining references for concatenated operations
(e.g. "urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618")
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.2/projjson.schema.json (*added in 6.2*)
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.3/projjson.schema.json (*added in 6.2*)
- a compound CRS made from two object names separated with " + ". e.g. "WGS 84 + EGM96 height" (*added in 7.1*)

{object_reference} is a filename preceded by the '@' character. The
Expand Down
2 changes: 1 addition & 1 deletion docs/source/development/reference/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ paragraph for more details.
syntax "EPSG:2393+5717"),
- a OGC URN combining references for concatenated operations
(e.g. "urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618")
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.2/projjson.schema.json (*added in 6.2*)
- a PROJJSON string. The jsonschema is at https://proj.org/schemas/v0.3/projjson.schema.json (*added in 6.2*)
- a compound CRS made from two object names separated with " + ". e.g. "WGS 84 + EGM96 height" (*added in 7.1*)
Example call:
Expand Down
5 changes: 5 additions & 0 deletions include/proj/crs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,11 @@ class PROJ_GCC_DLL BoundCRS final : public CRS,
const override; // throw(io::FormattingException)
//! @endcond

PROJ_DLL static BoundCRSNNPtr
create(const util::PropertyMap &properties, const CRSNNPtr &baseCRSIn,
const CRSNNPtr &hubCRSIn,
const operation::TransformationNNPtr &transformationIn);

PROJ_DLL static BoundCRSNNPtr
create(const CRSNNPtr &baseCRSIn, const CRSNNPtr &hubCRSIn,
const operation::TransformationNNPtr &transformationIn);
Expand Down
6 changes: 5 additions & 1 deletion include/proj/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,11 @@ class PROJ_GCC_DLL JSONFormatter {
// cppcheck-suppress functionStatic
PROJ_INTERNAL bool outputId() const;

PROJ_INTERNAL bool outputUsage() const;
PROJ_INTERNAL bool
outputUsage(bool calledBeforeObjectContext = false) const;

PROJ_INTERNAL static const char *PROJJSON_v0_2;
PROJ_INTERNAL static const char *PROJJSON_v0_3;

//! @endcond

Expand Down
Loading

0 comments on commit 4766b7c

Please sign in to comment.