用于处理 placekeys 的 SQL 函数。
将此插件安装在与 Datasette 相同的环境中。
$ datasette install datasette-placekey
以下 SQL 函数可用 - 文档在此。
select
geo_to_placekey(33.0896104,129.7900839),
placekey_to_geo('@6nh-nhh-kvf'),
placekey_to_geo_latitude('@6nh-nhh-kvf'),
placekey_to_geo_longitude('@6nh-nhh-kvf'),
placekey_to_h3('@6nh-nhh-kvf'),
h3_to_placekey('8a30d94e4c87fff'),
placekey_to_geojson('@6nh-nhh-kvf'),
placekey_to_wkt('@6nh-nhh-kvf'),
placekey_format_is_valid('@6nh-nhh-kvf');
要在本地设置此插件,首先检出代码。然后创建一个新的虚拟环境
cd datasette-placekey
python3 -mvenv venv
source venv/bin/activate
或者如果您正在使用 pipenv
pipenv shell
现在安装依赖项和测试
pip install -e '.[test]'
运行测试
pytest