ratiopath.parsers.GeoJSONParser
Parser for GeoJSON format annotation files.
GeoJSON is a format for encoding geographic data structures using JSON. This parser supports both polygon and point geometries.
Source code in ratiopath/parsers/geojson_parser.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
gdf = gpd.read_file(file_path)
instance-attribute
__init__(file_path)
Source code in ratiopath/parsers/geojson_parser.py
18 19 20 21 22 23 |
|
get_filtered_geodataframe(separator='_', **kwargs)
Filter the GeoDataFrame based on property values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
separator
|
str
|
The string used to separate keys in the filtering. |
'_'
|
**kwargs
|
str
|
Keyword arguments for filtering. Keys are column names (e.g., 'classification.name') and values are regex patterns to match against. |
{}
|
Returns:
Type | Description |
---|---|
GeoDataFrame
|
A filtered GeoDataFrame. |
Source code in ratiopath/parsers/geojson_parser.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
get_points(**kwargs)
Get points from the GeoDataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
str
|
Keyword arguments for filtering properties. |
{}
|
Yields:
Type | Description |
---|---|
Iterable[Point]
|
Shapely Point objects. |
Source code in ratiopath/parsers/geojson_parser.py
79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
get_polygons(**kwargs)
Get polygons from the GeoDataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
str
|
Keyword arguments for filtering properties. |
{}
|
Yields:
Type | Description |
---|---|
Iterable[Polygon]
|
Shapely Polygon objects. |
Source code in ratiopath/parsers/geojson_parser.py
65 66 67 68 69 70 71 72 73 74 75 76 77 |
|