Coverage for gws-app/gws/plugin/exporter/geojson/__init__.py: 100%

16 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-05 13:35 +0200

1"""GeoJSON exporter. 

2 

3Exports vector features with the GDAL ``GeoJSON`` driver. Each model is 

4written to its own file. GDAL creation options can be passed with 

5``options``, see 

6https://gdal.org/en/stable/drivers/vector/geojson.html. 

7 

8Example:: 

9 

10 exporters+ { 

11 type "geojson" 

12 title "GeoJSON" 

13 target "download" 

14 } 

15""" 

16 

17import gws 

18import gws.base.exporter 

19import gws.lib.mime 

20 

21 

22@gws.ext.config.exporter('geojson') 

23class Config(gws.base.exporter.Config): 

24 """Export of features to GeoJSON.""" 

25 

26 pass 

27 

28 

29@gws.ext.props.exporter('geojson') 

30class Props(gws.base.exporter.Props): 

31 """GeoJSON Exporter properties.""" 

32 

33 pass 

34 

35 

36@gws.ext.object.exporter('geojson') 

37class Object(gws.base.exporter.Object): 

38 """GeoJSON exporter.""" 

39 

40 supportsVector = True 

41 supportsRaster = False 

42 supportsMultiLayer = False 

43 

44 def run(self, ea, er): 

45 gws.base.exporter.util.run_gdal_vector_export('GeoJSON', gws.lib.mime.GEOJSON, ea, er)