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

16 statements  

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

1"""CSV exporter. 

2 

3Exports vector features with the GDAL ``CSV`` 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/csv.html. 

7 

8Example:: 

9 

10 exporters+ { 

11 type "csv" 

12 title "CSV" 

13 target "download" 

14 } 

15""" 

16 

17import gws 

18import gws.base.exporter 

19import gws.lib.mime 

20 

21 

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

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

24 """Export of features to CSV.""" 

25 

26 pass 

27 

28 

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

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

31 """CSV Exporter properties.""" 

32 

33 pass 

34 

35 

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

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

38 """CSV 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('CSV', gws.lib.mime.CSV, ea, er)