Geography
Encode lat/lng en hexagones Uber H3 (res 0-15) et cellules Hilbert S2 de Google (niveau 1-30) : index, id, token, quadkey, aires, k-ring, compactage, échelle des parents et dérive aller-retour.
Appelez cet outil depuis votre code en trois langages.
curl -X POST 'http://127.0.0.1:3003/fr/api/tools/h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge' \
-H 'Content-Type: application/json' \
-d '{"latitude":37.7796,"longitude":-122.4194,"h3Resolution":9,"s2Level":14,"kRing":1,"showCompact":true}'Envoyez une requête POST avec vos entrées en JSON. Les paramètres de type fichier nécessitent un upload préalable.
POST http://127.0.0.1:3003/fr/api/tools/h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge| Nom | Type | Requis | Description |
|---|---|---|---|
| latitude | number | Oui | — |
| longitude | number | Oui | — |
| h3Resolution | number | Non | — |
| s2Level | number | Non | — |
| kRing | number | Non | — |
Ajoutez cet outil à votre serveur Model Context Protocol pour que les agents IA puissent le lister et l'appeler.
Ajoutez ce bloc à la configuration de votre client MCP :
{
"mcpServers": {
"elysiatools-h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge": {
"name": "h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge",
"description": "Encode lat/lng en hexagones Uber H3 (res 0-15) et cellules Hilbert S2 de Google (niveau 1-30) : index, id, token, quadkey, aires, k-ring, compactage, échelle des parents et dérive aller-retour.",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Après connexion au point d'accès SSE, listez les outils exposés :
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Appelez l'outil par son id ; les arguments sont construits à partir de ses paramètres :
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "h3-and-s2-hexagonal-cell-index-encoder-and-neighbor-bridge",
"arguments": {
"latitude": 37.7796,
"longitude": -122.4194,
"h3Resolution": 9,
"s2Level": 14,
"kRing": 1,
"showCompact": true
}
}
}| showCompact |
| checkbox |
| Non |
| — |
Résultat HTML
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Des questions ou un problème ? Contactez [email protected]