1.. _rfc-65:
2
3=======================================================================================
4RFC 65: RFC 7946 GeoJSON
5=======================================================================================
6
7Authors: Sean Gillies
8
9Contact: sean at mapbox.com
10
11Status: Adopted, implemented
12
13Implementation version: 2.2
14
15Summary
16-------
17
18GeoJSON has been standardized by the IETF: `RFC
197946 <https://tools.ietf.org/html/rfc7946>`__. Updates to the OGR
20GeoJSON driver are needed so that it may write RFC 7946 GeoJSON.
21
22Rationale
23---------
24
25The RFC 7946 standard is backwards compatible with the legacy definition
26of GeoJSON, but has a few differences (see
27`https://tools.ietf.org/html/rfc7946#appendix-B <https://tools.ietf.org/html/rfc7946#appendix-B>`__).
28For OGR, the most significant are: removal of "crs" (CRS84 only),
29counter-clockwise winding of polygons, geometry splitting at the
30antimeridian, and representation of bounding boxes at the antimeridian
31and poles. Note: RFC 7946 explicitly restricts to 2D and 3D coordinates,
32and forbid use of the M dimension for example. This was already the case
33in the existing driver for the GeoJSON 2008 output.
34
35Consensus on the gdal-dev list is that developers should be able to
36require RFC 7946 GeoJSON by configuring layer creation with an option
37and that it be an all-or-nothing switch.
38
39Changes
40-------
41
42A layer creation option will be added for the GeoJSON driver, e.g.,
43``RFC7946=TRUE``. When "on", OGR will write GeoJSON with CRS84
44coordinates (reprojecting as needed) with 7 places of precision by
45default, polygons wound properly, and geometries split at the
46antimeridian.
47
48Related to that work, the OGRGeometryFactory::transformWithOptions()
49method has been improved to better deal with reprojection of geometries
50from polar projections, and projections that span the antimeridian, to
51EPSG:4326
52
53Updated drivers
54~~~~~~~~~~~~~~~
55
56GeoJSON
57
58SWIG bindings (Python / Java / C# / Perl) changes
59-------------------------------------------------
60
61None
62
63Utilities
64---------
65
66Utilities will implement RFC 7946 by using the layer creation option.
67
68Documentation
69-------------
70
71Documentation of the new layer creation option will reference RFC 7946.
72
73Test Suite
74----------
75
76The ogr_geojson.py file tests the effect of the new option.
77
78Compatibility Issues
79--------------------
80
81As this is a opt-in parameter, no backward compatibility issue. GeoJSON
82files conformant to RFC 7646 can be read by previous GDAL/OGR versions.
83
84Related ticket
85--------------
86
87#6705
88
89Implementation
90--------------
91
92Implementation has been done by Even Rouault and sponsored by Mapbox.
93
94Voting history
95--------------
96
97+1 from JukkaR, HowardB, DanielM and EvenR
98