Chuyển đến nội dung
Skillpedia
Lập trình chung51k · #3470

geopandas

Skill này làm gì

GeoPandas là công cụ làm việc với dữ liệu địa lý trên bản đồ bằng Python. Nó giúp sắp xếp và phân tích thông tin không gian, chẳng hạn vị trí các thành phố hoặc đường biên giới quốc gia.

Khi nào nên dùng

  • ✓Khi bạn cần tính khoảng cách giữa các điểm trên bản đồ.
  • ✓Khi so sánh diện tích của các vùng khác nhau.
  • ✓Để kết hợp thông tin từ nhiều lớp bản đồ.

Liên kết skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/geopandas/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/geopandas/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để tính diện tích của tất cả các bang của Brazil bằng một tệp bản đồ?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

GeoPandas dùng cấu trúc dữ liệu dạng bảng để lưu thông tin bản đồ. Nó cho phép bạn thực hiện các phép toán không gian như tính khoảng cách hoặc diện tích trực tiếp trên dữ liệu này.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

GeoPandas

Use GeoPandas for planar vector data represented as pandas-like GeoSeries and GeoDataFrame objects. This skill targets stable GeoPandas 1.2.0 (released 2026-09-28). The stable website currently carries a development build label; release-specific behavior below was checked against the v1.2.0 source and wheel.

Reproducible environment

GeoPandas 1.2.0 requires Python 3.11+, NumPy >=2, pandas >=2.2, Shapely >=2.1, pyproj >=3.7, pyogrio >=0.8, and packaging. The current pyproj wheel below requires Python 3.12+. This exact Python 3.12 snapshot was smoke-tested on 2026-10-01:

uv venv --python 3.12
uv pip install \
  "geopandas==1.2.0" \
  "numpy==2.5.3" \
  "pandas==3.0.6" \
  "shapely==2.1.2" \
  "pyproj==3.8.0" \
  "pyogrio==0.13.0" \
  "pyarrow==25.0.1" \
  "packaging==26.3"

Keep optional plotting and PostGIS packages pinned in the project lock as well. Do not mix binary geospatial packages from incompatible package channels.

Workflow

  1. Inspect a vetted local layer with vector_inventory.py; retain source hashes.
  2. Use crs_reprojection_plan.py to inspect candidate transformations. It plans only: execute an appropriate to_crs()/pyproj transformation separately.
  3. Audit geometry with geometry_validity_report.py; compare simulated repair changes before requesting its optional new GeoPackage output.
  4. Run the intended analysis with explicit predicates, CRS units, precision, and aggregation rules. spatial_join_audit.py measures join cardinality; it does not export joined features or perform a dissolve.
  5. Use export_plan.py to inspect the proposed contract, then write and reopen the actual output separately. A successful plan has not written a file.
  6. Review disclosure and generalization before sharing derived geodata/maps, using sensitive_coordinates_checklist.py when sensitive locations occur.

Examples below use synthetic or placeholder local inputs. File/database examples need the named dataset or service; PostGIS and tile-provider calls were reviewed against upstream contracts but were not exercised against a live service.

Safety and privacy contract

  • Treat exact coordinates, addresses, parcel boundaries, trajectories, and small-area joins as sensitive. Default reports to counts, categories, coarse extents, and redacted identifiers. Generalize before publication.
  • Never automatically load a URL, cloud URI, GDAL /vsi* path, archive, or geocode an address. Obtain explicit approval, validate provenance and hashes, then stage an unpacked local file in an isolated workspace.
  • GDAL/OGR drivers, GEOS, PROJ, pyogrio, Shapely, pyproj, and their wheels are a native-code trust boundary. Prefer official wheels/conda-forge, record native versions, restrict drivers, and process untrusted data in a sandbox.
  • Do not open macro-enabled office files or nested archives through permissive GDAL drivers. The bundled CLIs use an extension allowlist and reject archives.
  • Read only named database secrets such as GEOPANDAS_POSTGIS_PASSWORD; use a secret manager or scoped environment variable. Never embed a password in a URL or source, print an engine/URL, or dump the environment.
  • Every derived artifact needs source hashes/versions, CRS, operation parameters, predicate, join cardinality, precision/repair choices, and row-count checks.

Correctness gates

Apply these gates before trusting a result:

  1. Identity and provenance — identify the source layer, stable feature key, duplicate IDs, row count, geometry column, parser/driver, and content hash.
  2. Geometry state — count null, empty, invalid, mixed, Z/M, and collapsed geometries separately. None is missing; an empty Shapely geometry is real.
  3. CRS semantics — require CRS metadata. set_crs() assigns metadata; to_crs() transforms coordinates. Never guess a CRS from coordinate ranges.
  4. Units and operation — GeoPandas is planar. Geographic coordinates are angular; do not use them directly for buffer, distance, area, nearest joins, precision grids, or tolerances. Choose a fit-for-purpose local/equal-area CRS or a geodesic method.
  5. Transform quality — inspect axis order, area of use, datum pipeline, expected accuracy, ballpark status, and missing grids. Keep PROJ network disabled unless the user explicitly approves grid retrieval.
  6. Topology and precision — validate before and after repair/overlay. Pick a

…

Câu hỏi thường gặp

Dữ liệu địa lý là gì?

Đó là thông tin có vị trí trên Trái Đất, như một địa chỉ, một điểm GPS hoặc một đa giác biểu diễn một quốc gia.

CRS là gì?

CRS là viết tắt của Coordinate Reference System (hệ quy chiếu tọa độ). Đây là bộ quy tắc cho biết tọa độ (vĩ độ và kinh độ) liên hệ với bề mặt Trái Đất như thế nào, giúp bản đồ chính xác.

Tôi có thể dùng GeoPandas với mọi loại bản đồ không?

GeoPandas phù hợp nhất với dữ liệu vector (điểm, đường, đa giác) và làm việc tốt với các định dạng bản đồ phổ biến, nhưng có thể cần cài đặt thêm cho dữ liệu phức tạp hơn hoặc nguồn đặc thù.

Chi tiết

Mô tả gốc của tác giả

Guidance and local audit tools for Python workflows that directly use GeoPandas GeoSeries, GeoDataFrame, spatial operations, or vector-data I/O.

repo: K-Dense-AI/scientific-agent-skills

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3470
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự