Class GeomentService

java.lang.Object
com.cercalia.sdk.CercaliaClient
com.cercalia.sdk.services.GeomentService

public class GeomentService extends CercaliaClient
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:
  • Constructor Details

    • GeomentService

      public GeomentService(@NotNull @NotNull CercaliaConfig config)
      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