Entry records need to be findable by location, to make actually use of PostGIS. I see the scenario:
api.find_entry takes an additional parameter called location. The parameter value can be:
tuple, list of len==2 or shapely.Point, without any additional information - exact match, which might not be super helpful
a tuple of tuple, list of len==2 or shapely.Point and a radius (float) to search for Entry records in a radius around that point
if the tupleor list above is of dim==2 or a shapely.Polygon, Entry records within that geometry will be found. A radius might be given.
if a str is given, it will be interpreted as WKT and turned into a shapely.Geometry
radius could be an additional parameter, to keep locationsimpler. list and tuple should be transformed to a shapely.Geometry, to verify geometric integrity.
It could also be possible to pass an integer only, which would refer to a geometry-table in PostgreSQL, containing pre-defined search geometries (like Catchments or whatsoever).
The whole logic has to go into a new spatial submodule (maybe under util) so that a new Entry.neighbors could be introduced as well.
Entry
records need to be findable by location, to make actually use of PostGIS. I see the scenario:api.find_entry
takes an additional parameter calledlocation
. The parameter value can be:tuple
,list
oflen==2
orshapely.Point
, without any additional information - exact match, which might not be super helpfultuple
,list
oflen==2
orshapely.Point
and a radius (float
) to search forEntry
records in a radius around that pointtuple
orlist
above is ofdim==2
or ashapely.Polygon
,Entry
records within that geometry will be found. A radius might be given.str
is given, it will be interpreted as WKT and turned into ashapely.Geometry
radius
could be an additional parameter, to keeplocation
simpler.list
andtuple
should be transformed to a shapely.Geometry, to verify geometric integrity. It could also be possible to pass an integer only, which would refer to a geometry-table in PostgreSQL, containing pre-defined search geometries (like Catchments or whatsoever).The whole logic has to go into a new
spatial
submodule (maybe underutil
) so that a newEntry.neighbors
could be introduced as well.