shapely

shapely is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 44 tokens per session (3,704 once invoked), scanned A, original, MIT.

A Python library for working with shapes such as points, lines, and polygons. It can compare, combine, measure, validate, and convert these shapes.

In plain words
What is it for?
Use it in Python programs for spatial analysis, such as finding intersections, creating buffers, simplifying shapes, calculating distances, and reading GeoJSON or other geometry formats.
Why use it?
It removes the need to implement common geometry calculations yourself when building software that works with maps or location data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it in Python programs for spatial analysis, such as finding intersections, creating buffers, simplifying shapes, calculating distances, and reading GeoJSON or other geometry formats.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/shapely
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill shapely
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shapely

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/shapely/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/shapely)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/shapely"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/shapely/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for shapely

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/shapely"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/shapely.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.03704
Opus 5 $0.00022 $0.01852
Sonnet 5 $0.00009 $0.00741
Haiku 4.5 $0.00004 $0.00370

Measured today against content hash cf0e01ddb9a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

shapely scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

gis/shapely/SKILL.md · 339 lines

How it starts

The opening of the file, as written. The whole thing — 339 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://github.com/shapely/shapely

官方文档: https://shapely.readthedocs.io/

PyPI: https://pypi.org/project/shapely/

许可证: BSD-3-Clause

概述

Shapely 是 Python 计算几何的核心库,基于 GEOS(Geometry Engine - Open Source)的 C++ 几何引擎。它为 PostGIS、GeoPandas、PyQGIS 等众多开源 GIS 项目提供几何计算底层支持。核心能力:

  • 几何对象模型:Point、LineString、Polygon、Multi*、GeometryCollection
  • 空间关系判断:contains、intersects、within、touches、covers、disjoint、relate(DE-9IM)
  • 集合运算:intersection、union、difference、symmetric_difference
  • 构造操作:buffer、simplify、convex_hull、delaunay_triangles、voronoi_polygons、make_valid
  • 几何度量:area、length、distance、hausdorff_distance、frechet_distance
  • 空间索引:STRtree,加速批量空间查询
  • 格式读写:WKT、WKB、GeoJSON
  • 双重 API:函数式(向量化,支持 NumPy 广播)+ OOP(标量便捷)

环境要求: Python 3.9+,Shapely 2.0+


Geometry Types

Type Class Description
Point shapely.Point Single coordinate (x, y [, z [, m]])
LineString shapely.LineString Ordered sequence of 2+ points
LinearRing shapely.LinearRing Closed, simple LineString
Polygon shapely.Polygon Exterior ring + optional holes
MultiPoint shapely.MultiPoint Collection of Points
MultiLineString shapely.MultiLineString Collection of LineStrings
MultiPolygon shapely.MultiPolygon Collection of Polygons
GeometryCollection shapely.GeometryCollection Heterogeneous collection

Z coordinates are ignored for all spatial analysis — operations are performed in the x-y plane only.

Dual API Pattern

Shapely provides two APIs. Prefer the function-based API for arrays and performance; use the OOP API for scalar convenience.

Function-based (vectorized, NumPy ufunc)

All functions release the GIL during GEOS execution, support NumPy broadcasting, and handle arrays natively.

import shapely
import numpy as np

geoms = np.array([shapely.Point(0, 0), shapely.Point(1, 1)])
shapely.area(geoms)                    # array of floats
shapely.contains(polygon, geoms)       # array of bools
shapely.buffer(geoms, 1.0)            # array of polygons
shapely.distance(geoms, other)        # array of distances

Read the full file on GitHub · 339 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed cf0e01ddb9a4
  2. 2d ago Changed 5b70ce58a11f
  3. 9d ago First seen · 339 lines · 44 tokens per session scan A 05d4d8405d23

Subscribe to this mod's changes

shapely is a skill published in the GitHub repository znlgis/opengis-skills (61 stars, last pushed yesterday), licensed MIT. It adds 44 tokens to every session and 3,704 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.