File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,11 +40,13 @@ class CORE_EXPORT QgsJSONExporter
4040
4141 /* * Constructor for QgsJSONExporter.
4242 * @param vectorLayer associated vector layer (required for related attribute export)
43- * @param precision maximum number of decimal places to use for geometry coordinates
43+ * @param precision maximum number of decimal places to use for geometry coordinates,
44+ * the RFC 7946 GeoJSON specification recommends limiting coordinate precision to 6
4445 */
45- QgsJSONExporter ( const QgsVectorLayer* vectorLayer = nullptr , int precision = 17 );
46+ QgsJSONExporter ( const QgsVectorLayer* vectorLayer = nullptr , int precision = 6 );
4647
4748 /* * Sets the maximum number of decimal places to use in geometry coordinates.
49+ * The RFC 7946 GeoJSON specification recommends limiting coordinate precision to 6
4850 * @param precision number of decimal places
4951 * @see precision()
5052 */
Original file line number Diff line number Diff line change @@ -1088,7 +1088,10 @@ namespace QgsWfs
10881088
10891089 QgsJSONExporter exporter;
10901090 exporter.setSourceCrs ( crs );
1091- exporter.setPrecision ( prec );
1091+ // QgsJSONExporter force transform geometry to ESPG:4326
1092+ // and the RFC 7946 GeoJSON specification recommends limiting coordinate precision to 6
1093+ Q_UNUSED ( prec );
1094+ // exporter.setPrecision( prec );
10921095
10931096 // copy feature so we can modify its geometry as required
10941097 QgsFeature f ( *feat );
You can’t perform that action at this time.
0 commit comments