Skip to content

flowmachine.core.mixins.geodata_mixin

Source: flowmachine/core/mixins/geodata_mixin.py

Mixin providing utility methods for geographic type queries.

Class GeoDataMixin

GeoDataMixin()
Source: flowmachine/core/mixins/geodata_mixin.py

Mixin providing utility methods specific to geographic type queries.

Methods

geojson_query

geojson_query(self, crs=None)
Source: flowmachine/core/mixins/geodata_mixin.py

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)
Source: flowmachine/core/mixins/geodata_mixin.py

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)
Source: flowmachine/core/mixins/geodata_mixin.py

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)
Source: flowmachine/core/mixins/geodata_mixin.py

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)
Source: flowmachine/core/mixins/geodata_mixin.py

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)
Source: flowmachine/core/mixins/geodata_mixin.py

Turn off caching. Overridden to also remove cached geojson.