Package com.cercalia.sdk.services
Class GeomentService
java.lang.Object
com.cercalia.sdk.CercaliaClient
com.cercalia.sdk.services.GeomentService
GeomentService - Retrieves geographic and administrative geometries.
This service provides WKT (Well-Known Text) polygons for various administrative and geographic elements like localities, subregions, postal codes, and POIs.
Example usage:
GeomentService service = new GeomentService(config);
// Get locality geometry (municipality)
GeographicElementResult locality = service.getMunicipalityGeometry(
new GeomentMunicipalityOptions("28079", null, 0.001) // Madrid ID
);
String wkt = locality.getWkt();
// Get postal code geometry
GeographicElementResult postalCode = service.getPostalCodeGeometry(
new GeomentPostalCodeOptions("08001", "ESP")
);
- See Also:
-
Field Summary
Fields inherited from class com.cercalia.sdk.CercaliaClient
config, httpClient, logger, objectMapper -
Constructor Summary
ConstructorsConstructorDescriptionGeomentService(@NotNull CercaliaConfig config) Creates a new GeomentService with the specified configuration. -
Method Summary
Modifier and TypeMethodDescription@NotNull GeographicElementResultgetMunicipalityGeometry(@NotNull GeomentMunicipalityOptions options) Get geometry for a municipality or region.@NotNull CompletableFuture<GeographicElementResult>getMunicipalityGeometryAsync(@NotNull GeomentMunicipalityOptions options) Get geometry for a municipality or region asynchronously.@NotNull GeographicElementResultgetPoiGeometry(@NotNull GeomentPoiOptions options) Get geometry for a Point of Interest.@NotNull CompletableFuture<GeographicElementResult>getPoiGeometryAsync(@NotNull GeomentPoiOptions options) Get geometry for a POI asynchronously.@NotNull GeographicElementResultgetPostalCodeGeometry(@NotNull GeomentPostalCodeOptions options) Get geometry for a postal code.@NotNull CompletableFuture<GeographicElementResult>getPostalCodeGeometryAsync(@NotNull GeomentPostalCodeOptions options) Get geometry for a postal code asynchronously.Methods inherited from class com.cercalia.sdk.CercaliaClient
addIfPresent, addIfPresent, addIfPresent, addIfTrue, getConfig, newParams, newParams, request, request, requestAsync, requestAsync
-
Constructor Details
-
GeomentService
Creates a new GeomentService with the specified configuration.- Parameters:
config- the Cercalia configuration
-
-
Method Details
-
getMunicipalityGeometry
@NotNull public @NotNull GeographicElementResult getMunicipalityGeometry(@NotNull @NotNull GeomentMunicipalityOptions options) Get geometry for a municipality or region.- Parameters:
options- Municipality/Region options (munc OR subregc, tolerance)- Returns:
- GeographicElementResult with WKT polygon
- Throws:
CercaliaException- if the request fails
-
getMunicipalityGeometryAsync
@NotNull public @NotNull CompletableFuture<GeographicElementResult> getMunicipalityGeometryAsync(@NotNull @NotNull GeomentMunicipalityOptions options) Get geometry for a municipality or region asynchronously.- Parameters:
options- Municipality/Region options- Returns:
- CompletableFuture with the result
-
getPostalCodeGeometry
@NotNull public @NotNull GeographicElementResult getPostalCodeGeometry(@NotNull @NotNull GeomentPostalCodeOptions options) Get geometry for a postal code.- Parameters:
options- Postal code options (pcode, ctryc, tolerance)- Returns:
- GeographicElementResult with WKT polygon
- Throws:
CercaliaException- if the request fails
-
getPostalCodeGeometryAsync
@NotNull public @NotNull CompletableFuture<GeographicElementResult> getPostalCodeGeometryAsync(@NotNull @NotNull GeomentPostalCodeOptions options) Get geometry for a postal code asynchronously.- Parameters:
options- Postal code options- Returns:
- CompletableFuture with the result
-
getPoiGeometry
@NotNull public @NotNull GeographicElementResult getPoiGeometry(@NotNull @NotNull GeomentPoiOptions options) Get geometry for a Point of Interest.- Parameters:
options- POI options (poic, tolerance)- Returns:
- GeographicElementResult with WKT polygon/point
- Throws:
CercaliaException- if the request fails
-
getPoiGeometryAsync
@NotNull public @NotNull CompletableFuture<GeographicElementResult> getPoiGeometryAsync(@NotNull @NotNull GeomentPoiOptions options) Get geometry for a POI asynchronously.- Parameters:
options- POI options- Returns:
- CompletableFuture with the result
-