Introduction to SmartMaps Area
SmartMaps Area is a powerful JavaScript library that provides a simple and efficient way to interact with the SmartMaps Area API. It allows you to retrieve boundary and postal code area data for specific geographic points, rectangles, or OpenStreetMap (OSM) IDs.
Key Features
-
Administrative Levels: Access detailed administrative boundaries based on OpenStreetMap's
admin_level
values, ranging from national borders (level 2) to electoral wards and school districts (level 11). -
Flexible Endpoints: Utilize various endpoints to retrieve area data:
- Get boundaries and areas at a specific geographic point
- Retrieve boundaries and areas within a defined rectangular extent
-
Access boundaries and areas associated with specific OSM IDs
-
Customizable Query Parameters: Tailor your requests with a wide range of query parameters, including geographic filters (
isoCountries
,isoLanguages
), geometry precision (reduceGeometry
,zoom
), and more. -
GeoJSON FeatureCollections: Receive API responses as standardized GeoJSON FeatureCollections, providing a consistent and easily interpretable format for seamless integration with mapping libraries and GIS tools.
Getting Started
To start using SmartMaps Area:
-
Install the library via npm:
-
Import the
Area
class from the package: -
Create a new
Area
instance with your API key: -
Use the available methods to retrieve area data:
Supported Endpoints
SmartMaps Area provides the following endpoints:
-
Area data by point: Takes latitude, longitude, and other parameters to return the desired boundary data for one or multiple locations. Useful for retrieving boundary or postal information for specific geographical points.
-
Area data by rectangle: Retrieves the desired boundary data based on a specific geographical region provided as a boundary. Returns all defined boundary or postal code geometries within the rectangle.
-
Area data by OSM ID: Retrieves area data for specific geometries by providing one or multiple OSM IDs. Returns all defined boundary or postal code geometries associated with the provided IDs.
Area Service API
The Area Service API offers a comprehensive REST interface for querying geographic boundaries and areas. It supports both JSON and GeoJSON formats, ensuring compatibility with a wide range of applications.
With SmartMaps Area, you can easily integrate powerful boundary and area querying capabilities into your applications, enabling location-based services, spatial analysis, and seamless integration with mapping platforms.