flowmachine.core.mixins.geodata_mixin¶
Source: flowmachine/core/mixins/geodata_mixin.py
Mixin providing utility methods for geographic type queries.
Class GeoDataMixin¶
GeoDataMixin()
Mixin providing utility methods specific to geographic type queries.
Methods¶
geojson_query¶
geojson_query(self, crs=None)
Create a query which will transform each row into a geojson feature.
Parameters¶
-
crs
:str
,int
Optionally give an integer srid, or valid proj4 string to transform output to
Returns¶
-
str
A json aggregation query string
to_geojson¶
to_geojson(self, crs=None)
Parameters¶
-
crs
:str
,int
Optionally give an integer srid, or valid proj4 string to transform output to
Returns¶
-
dict
This query as a GeoJson FeatureCollection in dict form.
to_geojson_file¶
to_geojson_file(self, filename, crs=None)
Export this query to a GeoJson FeatureCollection file.
Parameters¶
-
filename
:str
File to save resulting geojson as.
-
crs
:str
,int
Optionally give an integer srid, or valid proj4 string to transform output to
to_geojson_string¶
to_geojson_string(self, crs=None)
Parameters¶
-
crs
:str
,int
Optionally give an integer srid, or valid proj4 string to transform output to
Returns¶
-
str
A string containing the this query as a GeoJson FeatureCollection.
to_geopandas¶
to_geopandas(self, crs=None)
Parameters¶
-
crs
:str
,int
Optionally give an integer srid, or valid proj4 string to transform output to
Returns¶
-
GeoDataFrame
This query as a GeoPandas GeoDataFrame.
turn_off_caching¶
turn_off_caching(self)
Turn off caching. Overridden to also remove cached geojson.