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

0 statements  

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

1"""GeoJSON support. 

2 

3Layers, models and finders for features stored in a GeoJSON file. The file is 

4read when it is first needed and kept in memory. Its CRS is taken from the 

5``crs`` member (a named CRS, as in the 2008 GeoJSON specification); without 

6it, WGS84 is assumed. The uid of a feature is taken from its ``id``, ``uid``, 

7``fid`` or ``sid`` property, or else is its position in the file. 

8 

9Submodules 

10---------- 

11 

12- ``provider`` - reads the GeoJSON file and selects the records that match a 

13 search by shape or bounds, keyword and uids. 

14- ``layer`` - the ``geojson`` vector layer. The geometry type and CRS of the 

15 layer are taken from the first feature with a geometry, the extent from the 

16 bounds of all features. By default, the layer has a ``geojson`` model and a 

17 ``geojson`` finder with the same provider. 

18- ``model`` - the ``geojson`` model, which returns the features that match a 

19 search. 

20- ``finder`` - the ``geojson`` finder, which supports geometry search. 

21 

22Example:: 

23 

24 map.layers+ { 

25 type "geojson" 

26 title "Banks" 

27 provider.path "/data/banks.geojson" 

28 } 

29"""