This is the documentation of version 1.0.0-rc.0. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Function geometryData

    • Retrieves polygon geometries representing geographic area boundaries.

      The Geometry Data service returns coordinate sets that define the outlines of geographic areas such as cities, countries, administrative regions, or POI footprints. Use these polygons to visualise area boundaries, for spatial analysis and in geofencing applications.

      Parameters

      Returns Promise<PolygonFeatures>

      Polygon features of the area boundaries.

      You can fetch up to 20 geometries in a single call, at scales from countries down to building footprints. The service can merge them with place data for enriched results, and returns standard GeoJSON Polygon/MultiPolygon features.

      Use it to display city or country boundaries on maps, show POI building footprints, create geofences for spatial queries, visualise administrative divisions, or calculate areas and spatial relationships.

      It returns polygons, not places, so pass the result to GeometriesModule.show(), not PlacesModule.show(). The geometryId comes from a prior search result.

      // Fetch geometry by ID
      const cityBoundary = await geometryData({
      geometries: ['geometry-id-123']
      });

      // Fetch multiple geometries at once
      const boundaries = await geometryData({
      geometries: ['country-id-1', 'city-id-2', 'poi-id-3']
      });

      // Fetch and merge with place data
      const searchResults = await discoverPlaces({ query: 'Amsterdam' });
      const withBoundaries = await geometryData({
      geometries: searchResults // Places with geometry IDs
      });
      // Result includes both place properties and polygon boundaries
    • Retrieves polygon geometries representing geographic area boundaries.

      The Geometry Data service returns coordinate sets that define the outlines of geographic areas such as cities, countries, administrative regions, or POI footprints. Use these polygons to visualise area boundaries, for spatial analysis and in geofencing applications.

      Parameters

      Returns Promise<PolygonFeatures<CommonPlaceProps>>

      Polygon features of the area boundaries.

      You can fetch up to 20 geometries in a single call, at scales from countries down to building footprints. The service can merge them with place data for enriched results, and returns standard GeoJSON Polygon/MultiPolygon features.

      Use it to display city or country boundaries on maps, show POI building footprints, create geofences for spatial queries, visualise administrative divisions, or calculate areas and spatial relationships.

      It returns polygons, not places, so pass the result to GeometriesModule.show(), not PlacesModule.show(). The geometryId comes from a prior search result.

      // Fetch geometry by ID
      const cityBoundary = await geometryData({
      geometries: ['geometry-id-123']
      });

      // Fetch multiple geometries at once
      const boundaries = await geometryData({
      geometries: ['country-id-1', 'city-id-2', 'poi-id-3']
      });

      // Fetch and merge with place data
      const searchResults = await discoverPlaces({ query: 'Amsterdam' });
      const withBoundaries = await geometryData({
      geometries: searchResults // Places with geometry IDs
      });
      // Result includes both place properties and polygon boundaries