fittings-geo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesefittings-geo
fittings-geo
Eleven services on that answer where something is. Every one that touches data
fronts a US federal public-domain source — the Census Bureau geocoder and its TIGER street layers,
the FCC block lookup, USGS 3DEP elevation — or the public-domain OurAirports dataset; one is pure
arithmetic and touches nothing. Browsing and searching cost nothing. A call costs between $0.003 and
$0.008 in this slice; nothing anywhere in the wider catalog exceeds $0.01.
https://fittings.shLive list for this slice, free to read and free to search:
bash
curl -s "https://fittings.sh/catalog?category=Geography%20and%20places"
node scripts/call.mjs --search "address to census tract"
node scripts/call.mjs --describe census.geography-bundle| Service | Price | What it answers |
|---|---|---|
| $0.003 | Where is this address, as a coordinate |
| $0.003 | The same, plus the tract, county and block the address falls in |
| $0.003 | What is the canonical form of this messy address |
| $0.004 | The same for up to ten addresses in one request |
| $0.003 | What address, county and tract is this coordinate in |
| $0.003 | The 15-digit block FIPS code containing this coordinate |
| $0.008 | Every Census layer through this coordinate, districts included |
| $0.004 | Which street is this GPS fix on |
| $0.003 | Which airports are near this coordinate, and how far |
| $0.003 | How high is the ground here |
| $0.003 | How far and in what direction between two coordinates |
https://fittings.sh该分类的实时服务列表,可免费查看和搜索:
bash
curl -s "https://fittings.sh/catalog?category=Geography%20and%20places"
node scripts/call.mjs --search "address to census tract"
node scripts/call.mjs --describe census.geography-bundle| 服务 | 价格 | 功能说明 |
|---|---|---|
| $0.003 | 将地址转换为坐标点 |
| $0.003 | 同上,额外返回地址所属的人口普查区、县和地块信息 |
| $0.003 | 将混乱地址转换为标准格式 |
| $0.004 | 单次请求最多处理10个地址,功能同上 |
| $0.003 | 根据坐标点返回对应的地址、县和人口普查区信息 |
| $0.003 | 返回坐标点所属的15位地块FIPS代码 |
| $0.008 | 返回坐标点对应的所有人口普查层级数据,包括选区信息 |
| $0.004 | 查询GPS定位点所在的街道 |
| $0.003 | 查询坐标点附近的机场及距离 |
| $0.003 | 查询该点的地面海拔 |
| $0.003 | 查询两个坐标点之间的距离和方位 |
When to reach for this
适用场景
The failure this exists to prevent is a fabricated location. A model asked for the coordinates of an
address will produce a lat/lon of the right shape, in roughly the right city, and wrong by a few
hundred metres or a few degrees; asked for a census tract it will produce eleven digits that parse,
sort and join like a real GEOID and belong to somewhere else entirely. Neither is visible to a
reader, neither is caught by a schema, and both survive every downstream step until someone drives to
the wrong building or files a report about the wrong neighbourhood. So buy the lookup rather than
recall it, every time the answer leaves your context.
Two jobs cover nearly all of it. Placing an address — which is geocoding, standardizing, or
joining to a tract so the address can meet a public dataset. Placing a point — which is naming
the address, the jurisdiction, the street or the terrain underneath a coordinate you were handed by a
device, a photo or an earlier call. The rest are small spatial facts that are tedious to compute and
easy to get quietly wrong: how far apart, which way, how high, which airport.
The tract is the one worth understanding, because it is why this slice earns its keep. A Census tract
GEOID is the join key for almost every US public dataset — ACS demographics, HMDA lending, CDC
health, EPA screening, most grant and eligibility rules — and the address-to-tract mapping lives in a
TIGER shapefile, not in a model. Until an address has a tract, none of that data is reachable.
该服务旨在避免生成虚假位置信息。当模型被要求返回某地址的坐标时,会生成格式正确、大致位于目标城市的经纬度,但误差可能达到数百米甚至数度;当被要求返回人口普查区时,会生成符合格式的11位数字,看似真实的GEOID,但实际对应完全不同的区域。这些错误无法通过人工核验,也不会被模式校验捕获,会一直存在于下游流程中,直到有人导航到错误建筑或提交关于错误社区的报告。因此,每当答案超出你的上下文范围时,请选择调用该服务进行查询,而非自行生成。
该服务主要覆盖两类任务:地址定位——即地理编码、地址标准化,或关联到人口普查区以便对接公共数据集;坐标点定位——即根据设备、照片或前期调用获取的坐标,返回对应的地址、管辖区域、街道或地形信息。其余功能则用于处理繁琐且容易出错的小型空间信息计算:距离、方位、海拔、附近机场等。
人口普查区的作用尤为重要,也是该服务的核心价值所在。人口普查区GEOID是几乎所有美国公共数据集的关联键——包括ACS人口统计数据、HMDA贷款数据、CDC健康数据、EPA筛查数据,以及大多数拨款和资格规则——而地址到人口普查区的映射仅存在于TIGER shapefile中,而非模型权重里。只有获取到地址对应的人口普查区,才能访问这些公共数据集。
When not to use it
不适用场景
This is not a maps product. There is no routing, no drive time, no traffic, no turn-by-turn, no
isochrone, no polygon geometry to draw, no tiles, no places search and no points of interest. It will
not tell you what business is at an address, whether a building exists, or what a neighbourhood is
like. names the street a point sits on; it does not route along it.
road.nearestIt also does not go one hop past the data. names the congressional district
containing a point and not the member who holds the seat — the bills that member filed are the civic
slice, . Flood zone, weather grid and hazard layers for a point are the
weather slice. And do not buy a lookup whose answer you already hold: an address the user supplied
with its coordinates does not need geocoding unless the point of the call is to check that pairing.
census.geography-bundle/skill/fittings-civic这并非地图类产品,不提供路径规划、行驶时间、交通状况、逐向导航、等时线、可绘制的多边形几何图形、地图瓦片、地点搜索和兴趣点查询服务。无法告知你某地址对应的商业机构、建筑是否存在,或社区情况。仅返回坐标点所在的街道名称,不提供沿街道的路径规划。
road.nearest此外,该服务不会提供数据源之外的衍生信息。仅返回坐标点所属的国会选区,不包含该选区的议员信息——议员提交的法案属于政务分类服务。坐标点的洪水区、气象网格和灾害图层属于气象分类服务。另外,若你已掌握所需答案,无需调用服务:用户提供的地址若已附带坐标,除非需要验证坐标与地址的匹配性,否则无需进行地理编码。
census.geography-bundle/skill/fittings-civicUS-only, and why
仅支持美国地区的原因
Geocoding here runs on the US Census Bureau geocoder, which is a work of the US federal
government and therefore public domain, rather than on OpenStreetMap, whose ODbL share-alike terms
conflict with reselling processed output. That is a deliberate trade, stated in every service
description and repeated here so you learn it before a foreign address teaches it to you: coverage
was traded for a licence that permits the sale. For an address outside the US, say the catalog does
not cover it. Do not reformat the address and try again, do not fall back to recalling the
coordinates yourself, and do not present a near-miss as an answer.
The same constraint runs through the rest of the slice. , ,
and are all US layers, and is US 3DEP.
Exactly two services are exempt: is arithmetic on WGS-84 and works for any two points
on earth, and runs on a global dataset.
geo.reverse-geocodefcc.census-blockcensus.geography-bundleroad.nearestgeo.elevationgeo.distanceairport.nearby此处的地理编码服务基于美国人口普查局地理编码器,该工具属于美国联邦政府作品,因此处于公共领域;而非基于OpenStreetMap,因其ODbL共享条款与转售处理后的输出内容存在冲突。这是一项刻意的选择,所有服务描述中均已说明,在此再次强调,避免你因处理国外地址才发现这一限制:我们以覆盖范围为代价,换取了允许售卖服务的许可。对于美国以外的地址,请告知用户服务目录不支持该区域。不要重新格式化地址后再次尝试,不要自行生成坐标,也不要将近似结果作为正确答案呈现。
该分类下的其他服务也受此限制。、、和均仅支持美国地区图层,基于美国3DEP数据。仅有两项服务例外:基于WGS-84的算术运算,适用于地球上任意两点;基于全球数据集。
geo.reverse-geocodefcc.census-blockcensus.geography-bundleroad.nearestgeo.elevationgeo.distanceairport.nearbyThe free surface
免费功能
Search, catalog reads and schema reads cost nothing, and so does an attempted call with no wallet
configured — the shared client prints the quote and the exact request it would have sent, then stops.
Use that to check your arguments rather than paying to discover a typo.
bash
node scripts/call.mjs --describe road.nearest
curl -s "https://fittings.sh/catalog?domain=census"--describekey=value搜索、查看服务目录和读取模式均免费;未配置钱包时尝试调用服务也免费——共享客户端会显示报价和即将发送的具体请求,然后停止。你可以利用此功能检查参数,避免因输入错误而付费。
bash
node scripts/call.mjs --describe road.nearest
curl -s "https://fittings.sh/catalog?domain=census"--describekey=valueRecipe — an address to a point you can join on
示例:将地址转换为可关联的坐标点
bash
node scripts/call.mjs census.address-geographies address="4600 Silver Hill Rd, Washington, DC 20233"Prefer this over for most work. They cost the same and go to the same matcher,
but this one also returns the state, county, tract and block codes with their FIPS and GEOID forms,
so the cheaper-looking choice is the one that makes you pay twice when the tract turns out to matter.
Reach for only when a
coordinate is genuinely all you need.
geo.forward-geocodegeo.forward-geocode address="1600 Pennsylvania Ave NW, Washington, DC 20500"Read before you use anything else. The matcher normalizes aggressively and will
happily settle on a different building on the same street; that substitution is visible in
and nowhere else in the payload. Compare it with what the user wrote, and say what
changed if anything did.
matchedAddressmatchedAddressfound: falseWhen the job is deduplicating or comparing addresses rather than locating them, standardization is
the cheaper and more honest tool:
bash
node scripts/call.mjs addr.standardize address="4600 silver hill rd washington dc 20233"It returns the USPS-style one-line form plus parsed components — house number, directionals, street
name, suffix, city, state, five-digit ZIP — which is what you want as a dedupe key. It shares the
matcher with the geocoders, so an address it cannot standardize will not geocode either; learning
that for $0.003 without a coordinate you were going to discard is the point.
bash
node scripts/call.mjs census.address-geographies address="4600 Silver Hill Rd, Washington, DC 20233"大多数情况下,优先选择该服务而非。两者价格相同,且使用相同的匹配器,但该服务还会返回州、县、人口普查区和地块的FIPS及GEOID编码,若选择看似更便宜的,后续需要人口普查区信息时可能需要再次付费,反而成本更高。只有当你确实只需要坐标时,才调用。
geo.forward-geocodegeo.forward-geocodegeo.forward-geocode address="1600 Pennsylvania Ave NW, Washington, DC 20500"在使用任何结果前,请先查看字段。匹配器会进行严格的标准化处理,可能会匹配到同一条街道上的另一栋建筑;这种替换仅会在中体现,不会在响应的其他字段中显示。请将其与用户提供的地址进行对比,若有变更需告知用户。
matchedAddressmatchedAddressfound: false当任务是去重或比较地址而非定位时,标准化服务更便宜且更可靠:
bash
node scripts/call.mjs addr.standardize address="4600 silver hill rd washington dc 20233"该服务会返回USPS格式的单行地址及解析后的组件——门牌号、方向标识、街道名称、后缀、城市、州、五位邮政编码——这正是你需要的去重键。它与地理编码服务使用相同的匹配器,因此无法标准化的地址也无法进行地理编码;花费0.003美元确认这一点,避免生成无用的坐标,正是该服务的价值所在。
Recipe — a list of addresses at once
示例:批量处理地址列表
bash
node scripts/call.mjs census.geocode-batch addresses="1600 Pennsylvania Ave NW Washington DC 20500,350 Fifth Ave New York NY 10118"Up to ten addresses per request, resolved to coordinates plus state, county, tract, block, CBSA and
CSA. Repeated addresses within a batch are resolved once, so a list with duplicates is not billed
twice for the same string.
One trap, and it belongs to the client rather than the service: splits an array argument
on commas, so an address written with its internal commas is torn into three broken fragments. Write
each address without internal commas, as above, and check the dry run's printed body before paying —
the mis-split is visible there for free. An eleventh address is refused with a before anything
is charged.
call.mjs413Read against : the first is how many addresses you sent, the second how many the
matcher placed. A batch where those differ is not a failed call, it is a list with bad rows in it,
and the per-address flag tells you which ones.
countmatchedmatchedbash
node scripts/call.mjs census.geocode-batch addresses="1600 Pennsylvania Ave NW Washington DC 20500,350 Fifth Ave New York NY 10118"单次请求最多处理10个地址,返回坐标及州、县、人口普查区、地块、CBSA和CSA信息。批量请求中的重复地址仅会被解析一次,因此包含重复地址的列表不会被重复计费。
需要注意一个陷阱,这属于客户端而非服务端的问题:会按逗号分割数组参数,因此包含内部逗号的地址会被拆分为三个无效片段。请像示例中那样,每个地址不包含内部逗号,并在付费前查看试运行打印的请求体——拆分错误会在免费的试运行中显示。若包含第11个地址,服务会返回错误,且不会产生费用。
call.mjs413请对比和字段:前者是你发送的地址数量,后者是匹配器成功定位的地址数量。两者不一致的批量请求并非失败,而是列表中存在无效地址,每个地址对应的标志会告诉你哪些地址无效。
countmatchedmatchedRecipe — what contains this point
示例:查询坐标点所属的区域
Three services answer this, and the whole question is how much of the answer you actually need.
bash
node scripts/call.mjs geo.reverse-geocode lat=38.8977 lon=-77.0365
node scripts/call.mjs fcc.census-block lat=38.8977 lon=-77.0365
node scripts/call.mjs census.geography-bundle lat=32.7767 lon=-96.7969geo.reverse-geocodefcc.census-blockcensus.geography-bundlesummarylayersA point in the ocean, in Canada, or otherwise outside US coverage comes back with and
nulls rather than an error, and it is billed. Report that as "outside coverage", not as a failure and
never as an empty jurisdiction.
found: falseCoordinates are rounded to five decimal places — about a metre — before the upstream call and before
the cache key is built, so passing eight decimals buys nothing and two callers a metre apart share an
answer. Do not manufacture precision in the other direction either: a coordinate you rounded to two
decimals is a different point, roughly a kilometre away, and the tract it lands in may be a different
tract.
有三项服务可回答该问题,选择哪项取决于你实际需要的信息范围。
bash
node scripts/call.mjs geo.reverse-geocode lat=38.8977 lon=-77.0365
node scripts/call.mjs fcc.census-block lat=38.8977 lon=-77.0365
node scripts/call.mjs census.geography-bundle lat=32.7767 lon=-96.7969geo.reverse-geocodefcc.census-blockcensus.geography-bundlesummarylayers位于海洋、加拿大或美国覆盖范围之外的坐标点会返回和空值,而非错误,且会被计费。请告知用户“超出服务覆盖范围”,不要将其视为失败,更不要返回空的管辖区域信息。
found: false坐标会被四舍五入到小数点后五位——约1米——然后再发送给上游服务并生成缓存键,因此传入八位小数不会带来任何精度提升,相距1米的两个调用者会共享同一结果。同样,不要刻意降低精度:将坐标四舍五入到两位小数会对应到约1公里外的不同点,所属的人口普查区可能也不同。
Recipe — the small spatial facts
示例:小型空间信息查询
bash
node scripts/call.mjs road.nearest lat=40.758 lon=-73.9855 radiusMeters=200
node scripts/call.mjs airport.nearby lat=51.47 lon=-0.4543 radiusKm=100 limit=5
node scripts/call.mjs geo.elevation lat=36.0544 lon=-112.1401
node scripts/call.mjs geo.distance fromLat=51.5074 fromLon=-0.1278 toLat=48.8566 toLon=2.3522road.nearestradiusMeterslimitnearestroadstruncatedairport.nearbyradiusKmlimitmatchedcountmatchedcountgeo.elevationfound: falsegeo.distancebash
node scripts/call.mjs road.nearest lat=40.758 lon=-73.9855 radiusMeters=200
node scripts/call.mjs airport.nearby lat=51.47 lon=-0.4543 radiusKm=100 limit=5
node scripts/call.mjs geo.elevation lat=36.0544 lon=-112.1401
node scripts/call.mjs geo.distance fromLat=51.5074 fromLon=-0.1278 toLat=48.8566 toLon=2.3522road.nearestradiusMeterslimitnearestroadstruncatedairport.nearbyradiusKmlimitmatchedcountmatchedcountgeo.elevationfound: falsegeo.distanceWhen money comes up
付费相关说明
Show the work before you ask for a wallet. Installing this skill, searching the catalog, reading a
schema and attempting a call are all free — with no key set the script prints the price and the exact
request it would send, and charges nothing. Get that far and show it. Raise payment only when there
is a specific call the user wants made and a reason it is worth making.
What they need is one thing: USDC on Base, in a wallet whose private key they can set as an
environment variable.
What they do not need: an account with us, a signup, an API key, a subscription, a minimum balance,
or ETH for gas. Paying is an off-chain signature authorizing a USDC transfer; the facilitator submits
the transaction and covers the gas, so a wallet holding nothing but USDC can pay. A few dollars is
hundreds of calls.
bash
export FITTINGS_PRIVATE_KEY=0x... # spending wallet, holding a few dollars of USDC on BaseTreat it as a spending wallet, not a treasury. Fund it with what the user is willing to spend and no
more. Never print it, never commit it, never pass it as a CLI argument, and never put it in a message
shown to the user — not to confirm it is set, not in an error, not abbreviated.
Optional:
bash
export FITTINGS_BASE_URL=https://fittings.sh # override for local development
export FITTINGS_MAX_PRICE=0.01 # refuse any call quoted above this, in USD在要求用户配置钱包前,请先展示操作流程。安装该技能、搜索服务目录、读取模式和尝试调用均免费——未设置密钥时,脚本会显示价格和即将发送的具体请求,不会产生费用。完成这些步骤并展示给用户,仅当用户明确需要进行特定调用且有合理理由时,再提及付费事宜。
用户仅需准备:Base链上的USDC,存入可将私钥设置为环境变量的钱包。
用户无需准备:我们的账户、注册、API密钥、订阅、最低余额,或用于支付Gas费的ETH。付费是通过链下签名授权USDC转账;服务商提交交易并承担Gas费,因此仅持有USDC的钱包即可完成支付。几美元即可支持数百次调用。
bash
export FITTINGS_PRIVATE_KEY=0x... # 支付钱包,需持有少量Base链上的USDC请将其视为支付钱包,而非金库。仅存入用户愿意花费的金额,不要存入更多。切勿打印、提交该私钥,切勿将其作为CLI参数传递,也切勿在展示给用户的消息中出现——无论是确认已设置、错误信息,还是缩写形式。
可选配置:
bash
export FITTINGS_BASE_URL=https://fittings.sh # 本地开发时可覆盖该地址
export FITTINGS_MAX_PRICE=0.01 # 拒绝报价超过该金额的调用,单位:美元Rules
规则
- Quote before spending. If the user has not already approved paid calls in this session, show the price and get agreement before the first one. A dry run gives you the exact figure for free. Cheap is not free.
- One call per fact. Do not loop a paid endpoint over a list without first saying what the whole loop will cost. Do not buy an answer you already hold, or one the user supplied.
- Prefer the free surface. Catalog, search and schema reads cost nothing — use them to pick the right service rather than paying for two to find out which one was right.
- Respect the cap. exists to stop a runaway loop. Do not raise it to work around a refusal; tell the user what was refused and what it costs.
FITTINGS_MAX_PRICE - Pass attribution through. Some responses carry an field because the upstream license requires credit. If you surface the data to a user, surface that with it.
attribution - No wallet, or an empty one, is an answer. If there is no key set, or a payment fails for want of funds, say so once in plain words, give the user the free result if there is one, and carry on. Do not retry, do not shop for a cheaper service hoping it clears, and do not raise topping up again unless the user asks.
- 付费前先报价:若用户在本次会话中尚未批准付费调用,首次调用前需展示价格并获得用户同意。试运行可免费获取准确价格。便宜不等于免费。
- 一个事实一次调用:不要在未告知总费用的情况下,循环调用付费接口处理列表。不要为已掌握或用户已提供的答案付费。
- 优先使用免费功能:查看目录、搜索和读取模式均免费——使用这些功能选择合适的服务,而非付费调用两个服务来判断哪个更合适。
- 遵守价格上限:用于防止失控循环。不要提高上限来绕过拒绝;请告知用户被拒绝的调用及其费用。
FITTINGS_MAX_PRICE - 传递归属信息:部分响应包含字段,因为上游许可证要求署名。若向用户展示数据,请同时展示该归属信息。
attribution - 未配置钱包或钱包为空即告知结果:若未设置密钥,或因资金不足导致支付失败,请用简洁语言告知用户一次,若有免费结果则提供给用户,然后继续流程。不要重试,不要寻找更便宜的服务尝试,除非用户主动询问,否则不要再次提及充值事宜。
Reading what comes back
解读响应结果
matched: falsefound: falseA means your arguments do not match the schema and you were not charged — read
and fix them. A means the input exceeded a cap, such as an eleventh address, and is likewise
free. A means the service id is wrong. A is the upstream being down, which the Census
geocoder does periodically; you are not billed, and the honest move is to name the source and stop
rather than substituting a different service and presenting its answer as the one that was asked for.
400/catalog/{id}413404502Every source in this slice is public domain, so credit is not a licensing obligation here the way it
is elsewhere in the catalog — check the field on any response anyway and pass it
through if one appears. Cite the source regardless. A coordinate with "US Census Bureau geocoder" and
a date attached is checkable; the same coordinate on its own is indistinguishable from one you made
up, which is precisely the thing this slice exists to prevent.
attributionmatched: falsefound: false400/catalog/{id}413404502该分类下的所有数据源均属于公共领域,因此无需像目录中其他服务那样承担署名的许可义务——但仍需检查响应中的字段,若存在则传递给用户。无论如何,请引用数据源。带有“美国人口普查局地理编码器”和日期的坐标是可核验的;而单独的坐标与自行生成的坐标无法区分,这正是该分类服务旨在避免的问题。
attribution