mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Merge pull request #4129 from rldhont/server-geojson-precision
[Server] The RFC 7946 GeoJSON specification recommends limiting coordinate precision to 6
This commit is contained in:
commit
2b12a1574d
@ -40,11 +40,13 @@ class CORE_EXPORT QgsJSONExporter
|
||||
|
||||
/** Constructor for QgsJSONExporter.
|
||||
* @param vectorLayer associated vector layer (required for related attribute export)
|
||||
* @param precision maximum number of decimal places to use for geometry coordinates
|
||||
* @param precision maximum number of decimal places to use for geometry coordinates,
|
||||
* the RFC 7946 GeoJSON specification recommends limiting coordinate precision to 6
|
||||
*/
|
||||
QgsJSONExporter( const QgsVectorLayer* vectorLayer = nullptr, int precision = 17 );
|
||||
QgsJSONExporter( const QgsVectorLayer* vectorLayer = nullptr, int precision = 6 );
|
||||
|
||||
/** Sets the maximum number of decimal places to use in geometry coordinates.
|
||||
* The RFC 7946 GeoJSON specification recommends limiting coordinate precision to 6
|
||||
* @param precision number of decimal places
|
||||
* @see precision()
|
||||
*/
|
||||
|
@ -1088,7 +1088,10 @@ namespace QgsWfs
|
||||
|
||||
QgsJSONExporter exporter;
|
||||
exporter.setSourceCrs( crs );
|
||||
exporter.setPrecision( prec );
|
||||
//QgsJSONExporter force transform geometry to ESPG:4326
|
||||
//and the RFC 7946 GeoJSON specification recommends limiting coordinate precision to 6
|
||||
Q_UNUSED( prec );
|
||||
//exporter.setPrecision( prec );
|
||||
|
||||
//copy feature so we can modify its geometry as required
|
||||
QgsFeature f( *feat );
|
||||
|
Loading…
x
Reference in New Issue
Block a user