
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
. :construction:
The best way to explore the data (i.e. the coverage, the zones metadata, the hierarchy...) is our https://github.com/osm-without-borders/cosmogony_explorer
:construction: In the future, we may create other tools to use the data. Please share your ideas and needs in the issues. :construction:
You can build cosmogony to extract the regions on your own.
Build
Here are the necessary manual steps to build cosmogony:
bashcurl https://sh.rustup.rs -sSf | sh # intall rust apt-get install libgeos-dev # install GEOS git clone https://github.com/osm-without-borders/cosmogony.git # Clone this repo cd cosmogony; # enter the directory git submodule update --init # update the git submodules cargo build --release # finally build cosmogony
Run
You can now grab some OSM pbf and extract your geographic zones:
cargo run --release -- generate -i /path/to/your/file.osm.pbf
Check out cosmogony help for more options:
cargo run --release -- -h
Other subcomands
Note: the default subcommand is the generate subcommand, so cosmogony -i <osm-file> -o output file if the same as cosmogony generate -i <osm-file> -o output file
Merging cosmogonies
To generate a world cosmogony on a server withtout a lot of RAM, you can generate cosmogonies on split non overlapping osm files, without a shared parent (eg. split by continent or country) and merge the generated cosmogony.
To merge several cosmogonies into one you can use the custom subcommand merge:
cargo run --release -- merge *.jsonl -o merged_cosmo.jsonl
Note: to reduce the memory footprint, it can only merge json lines cosmogonies (so .jsonl or .jsonl.gz).
The initial purpose of Cosmogony is to enhance https://github.com/CanalTP/mimirsbrunn, our geocoder (See https://github.com/CanalTP/mimirsbrunn/issues/178 for a bit of context). Another common use case is to create geospatially aware statistics, such as choropleth maps. Anyway, we'd love to know what you've built from this, so feel free to add your use cases in Awesome Cosmogony.
OpenStreetMap (OSM) seems the best datasource for our use case. However the OSM administrative regions (admins) have several drawbacks:
admin_level tag, with values ranging from 1 to ~10 to allow consistent rendering of the borders among countries. This is fine for making maps, but if you want a world list of cities or regions, you still need local and specific knowledge to find which admin_level to use in each country.nodes, ways and relation without any structure.To mitigate this, the general idea is to take an OSM pbf file and to:
OSM administrative regions may not be mapped with the same precision all over the earth but the data is easy to update and the update will benefit the community.
Beyond OSM, we will possibly *** in the future using other data sources (with compliant license).
However we don't want cosmogony to be too complex (as the great WhosOnFirst is (see below)
The libpostal types seem nice (and made by brighter people than us):
Cosmogony reads OSM tags to determine names and labels for all zones, in all available languages.
In addition to name:* tags from boundary objects themselves, other names from related objects are used
as they may provide more languages :
label (if present)admin_center (if relevant: for cities, or on matching wikidata ID)Note that these additional
name:*values are included in zonetagsin the output to help reusing, even if they are not part of the OSM object tags.
Below is a brief example of the information contained in the cosmogony output.
javascript{ "zones":[ {"id":0, "osm_id":"relation:110114", "admin_level":8, "zone_type":"city", "name":"Sand Rock", "zip_codes":[], "center":{"coordinates":[-85.77153961457083,34.2303942501858],"type":"Point"}, "bbox": [-85.803571, 34.203915, -85.745058, 34.26666], "geometry":{ "coordinates":"..." }, "tags":{ "admin_level":"8", "border_type":"city", "boundary":"administrative", "is_in":"USA" }, "parent":"null", "wikidata":"Q79669"} ], "meta":{ "osm_filename":"alabama.osm.pbf", "stats":{"level_counts":{"6":64,"8":272}, "zone_type_counts":{"City":272,"StateDistrict":64}, "wikidata_counts":{"6":58,"8":202}, "zone_with_unkwown_country_rules":{}, "unhandled_admin_level":{}, "zone_without_country":0} } }
You can check the cosmogony file built with our https://github.com/osm-without-borders/cosmogony-data-dashboard.
:construction: Ideas and other contributions welcomed in https://github.com/osm-without-borders/cosmogony/issues/4 :construction:
Cosmogony, just like OpenStreetMap, emphasizes local knowledge: even if you can't code, you can help us to make Cosmogony go worldwide :rocket:
If the cosmogony of your country does not look good, here is what you can do to fix it:
expected_min and expected_max columns :wink:yes in the is_known_failure columnMapzen borders project
deprecated, and without cascading hierarchy
WhosOnFirst
Our main inspiration source :sparkling_heart: Hard to maintain because of the many sources involved that needs deduplication and concordances, difficult to ensure a coherent hierarchy (an object Foo can have an object Bar as a child whereas Foo is not listed as a parent of Bar), etc
OSM boundaries Map
Pretty cool if you just need to inspect the coverage or export a few administrative areas. Still need country specific knowledge to use worldwide.
WhateverShapes : https://github.com/foursquare/quattroshapes, alphashapes, https://github.com/simplegeo/betashapes
Without cascading hierarchy. Duno if it's up to date, and how we can contribute.
All code in this repository is under the Apache License 2.0.
This project uses OpenStreetMap data, licensed under the ODbL by the OpenStreetMap Foundation. You need to visibly credit OpenStreetMap and its contributors if you use or distribute the data from cosmogony. Read more on OpenStreetMap official website.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务