fastpynuts.experimental

The submodule fastpynuts.experimental contains NUTSfinderBenchmark, a class which is intended for experimental purposes.

Module Contents

Classes

NUTSfinderBenchmark

Implements various experimental methods to find corresponding NUTS regions for benchmark purposes.

API

class fastpynuts.experimental.NUTSfinderBenchmark(geojsonfile, buffer_geoms=0, min_level=0, max_level=3)

Bases: fastpynuts.fastpynuts.NUTSfinder

Implements various experimental methods to find corresponding NUTS regions for benchmark purposes.

Following methods are available:

tree: Exploits the hierarchical structure of the NUTS regions. First checks the coordinates against the NUTS level 0 regions. Then, the children regions of level 1 are checked, etc. At each level, region candidates are determined by a fast R-tree test, followed by a point-in-polygon check of the candidates.

rtree: A single R-tree is constructed for all regions, independent of level. Region candidates are then determined by the R-tree’s intersect() method, followed by a point-in-polygon check of the candidates.

bbox: Sequentially performs a point-in-bbox test of all regions, followed by a point-in-polygon check of the candidates.

poly: Sequentially performs a point-in-polygon test of all regions.

Initialization

find(lon, lat, method='tree', valid_point=False, verbose=False, **kwargs)

Find a point’s NUTS regions by longitude and latitude. For large-scale applications, if it is known, that the point corresponds to a valid location within the NUTS regions, use valid_point = True for a speedup.

classmethod from_web(scale=1, year=2021, epsg=4326, datadir='.data', **kwargs)
find_level(lon, lat, level, valid_point=False)