This internal helper retrieves the administrative department (code_insee)
intersecting each feature of the input sf object. It uses the
Admin Express COG WFS service from IGN via the happign package.
geo_dep(x)A character vector with the INSEE department code corresponding
to each feature of x. Returns NULL if no intersection is found.
An sf object defining the area(s) of interest.
The input is first transform to CRS:4326.
Centroids of the features are computed before querying the WFS service.
The function uses quiet() to suppress warnings/messages during processing.
If the WFS query fails or returns no features, a vector of NA values is returned.
The spatial join is performed using sf::st_join() with st_intersects.