Skip to main content
Glama

cadastre

Retrieve cadastral information including district, municipality, plot, and fiscal subdivision data for specific geographic coordinates using France's official Géoplateforme services.

Instructions

Renvoie les informations cadastrales (arrondissement, commune, feuille, parcelle, subdivision_fiscale, localisant) pour une position donnée par sa longitude et sa latitude (source :Géoplateforme (WFS, CADASTRALPARCELS.PARCELLAIRE_EXPRESS)).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lonYesLa longitude du point
latYesLa latitude du point

Implementation Reference

  • The handler function for the 'cadastre' tool. Logs the input coordinates and delegates to the getParcellaireExpress helper to fetch cadastral data.
    async execute(input: CadastreInput) { logger.info(`cadastre(${input.lon},${input.lat})...`); return getParcellaireExpress(input.lon, input.lat); }
  • Zod schema definition for the tool's input parameters: longitude (lon) and latitude (lat).
    schema = { lon: { type: z.number(), description: "La longitude du point", }, lat: { type: z.number(), description: "La latitude du point", }, };
  • Core helper function that queries the Géoplateforme WFS service for cadastral parcels (PARCELLAIRE_EXPRESS) within 10m of the point, processes features, calculates distances, and returns the nearest per type.
    export async function getParcellaireExpress(lon, lat) { logger.info(`getParcellaireExpress(${lon},${lat}) ...`); // note that EPSG:4326 means lat,lon order for GeoServer -> flipped coordinates... const cql_filter = `DWITHIN(geom,Point(${lat} ${lon}),10,meters)`; const sourceGeom = { "type": "Point", "coordinates": [lon,lat] }; // TODO : avoid useless geometry retrieval at WFS level const url = 'https://data.geopf.fr/wfs?' + new URLSearchParams({ service: 'WFS', request: 'GetFeature', typeName: PARCELLAIRE_EXPRESS_TYPES.map((type) => { return `CADASTRALPARCELS.PARCELLAIRE_EXPRESS:${type}` }).join(','), outputFormat: 'application/json', cql_filter: cql_filter }).toString(); const featureCollection = await fetchJSON(url); return filterByDistance(featureCollection.features.map((feature) => { // parse type from id (ex: "commune.3837") const type = feature.id.split('.')[0]; // ignore geometry and extend properties return Object.assign({ type: type, id: feature.id, bbox: feature.bbox, distance: distance( sourceGeom, feature.geometry ), source: PARCELLAIRE_EXPRESS_SOURCE, }, feature.properties); })); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ignfab/geocontext'

If you have feedback or need assistance with the MCP directory API, please join our Discord server