Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,24 @@
"dtype",
"Dtype",
"epsg",
"ETRS",
"gnbu",
"GNBU",
"haline",
"HALINE",
"Haline",
"jsons",
"Jsons",
"lanczos",
"Lanczos",
"LANCZOS",
"LAEA",
"LAEAQUAD",
"lcmap",
"lulc",
"LULC",
"LINZANTARTICA",
"Antartica",
"maxx",
"maxy",
"mgrs",
Expand All @@ -534,6 +542,7 @@
"Nipy",
"nrcan",
"NRCAN",
"NZTM",
"orrd",
"ORRD",
"palsar",
Expand Down Expand Up @@ -576,6 +585,9 @@
"Tilematrixsetid",
"tiler",
"tilers",
"topo",
"TOPO",
"Topo",
"terrainrgb",
"titiler",
"unscale",
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ com.azure:azure-monitor-query-metrics;1.0.5;1.1.0-beta.1
com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-openrewrite;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-perf-test-parent;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-analytics-planetarycomputer;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-analytics-planetarycomputer;1.0.0;1.0.0
com.azure:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-search-documents;12.0.0;12.1.0-beta.2
com.azure:azure-search-perf;1.0.0-beta.1;1.0.0-beta.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Release History

## 1.0.0-beta.1 (Unreleased)
## 1.0.0 (Unreleased)

- Azure PlanetaryComputer client library for Java. This package contains Microsoft Azure PlanetaryComputer client library.
- Initial GA release of the Azure Planetary Computer client library for Java targeting API version `2026-04-15`.

### Features Added
## 1.0.0-beta.1 (2026-06-08)

### Breaking Changes

### Bugs Fixed

### Other Changes
- Initial preview release of the Azure Planetary Computer client library for Java.
- Added `StacClient`, `DataClient`, `IngestionClient`, and `SharedAccessSignatureClient` with synchronous and asynchronous variants.
- Targeting API version `2025-04-30-preview`.
214 changes: 197 additions & 17 deletions sdk/planetarycomputer/azure-analytics-planetarycomputer/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Azure PlanetaryComputer client library for Java
# Azure Planetary Computer client library for Java

Azure PlanetaryComputer client library for Java.
The Azure Planetary Computer client library provides programmatic access to Microsoft Planetary Computer Pro, a geospatial data management service built on Azure's hyperscale infrastructure. Microsoft Planetary Computer Pro empowers organizations to unlock the full potential of geospatial data by providing foundational capabilities to ingest, manage, search, and distribute geospatial datasets using the SpatioTemporal Asset Catalog (STAC) open specification.

This package contains Microsoft Azure PlanetaryComputer client library.
This client library enables developers to interact with GeoCatalog resources, supporting workflows from gigabytes to tens of petabytes of geospatial data.

## Key capabilities

- **STAC Collection Management**: Create, read, update, and delete STAC collections and items to organize your geospatial datasets
- **Collection Configuration**: Configure render options, mosaics, tile settings, and queryables to optimize query performance and visualization
- **Data Visualization**: Generate map tiles (XYZ, TileJSON, WMTS), preview images, crop by GeoJSON or bounding box, extract point values, and compute statistics
- **Mosaic Operations**: Register STAC search-based mosaics for pixel-wise data query and retrieval, generate tiles from multiple items
- **Map Legends**: Retrieve class map legends (categorical) and interval legends (continuous) as JSON or PNG images
- **Data Ingestion**: Set up ingestion sources (Managed Identity or SAS token), define ingestions from STAC catalogs, and monitor ingestion runs
- **STAC API Operations**: Full CRUD operations on items, search with spatial/temporal filters and sorting, retrieve queryable properties, and check API conformance
- **Secure Access**: Generate SAS tokens for collections, sign asset HREFs for secure downloads, and revoke tokens — all secured via Microsoft Entra ID

[Source code][source] | [API reference documentation][docs] | [Product documentation][product_documentation] | [Samples][samples]

## Documentation

Expand All @@ -17,6 +30,7 @@ Various documentation is available to help you get started

- [Java Development Kit (JDK)][jdk] with version 8 or above
- [Azure Subscription][azure_subscription]
- A deployed Microsoft Planetary Computer Pro GeoCatalog resource in your Azure subscription

### Adding the package to your product

Expand All @@ -25,20 +39,41 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-analytics-planetarycomputer</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0</version>
</dependency>
```
[//]: # ({x-version-update-end})

### Authentication

[Azure Identity][azure_identity] package provides the default implementation for authenticating the client.
Microsoft Entra ID authentication is required to interact with your GeoCatalog resource.

#### Create the client with Microsoft Entra ID credential

To use `DefaultAzureCredential` or other credential types, add the `azure-identity` dependency:

```xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.15.4</version>
</dependency>
```

`DefaultAzureCredential` will use the values from environment variables `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET`, or authenticate via Azure CLI, IntelliJ, or VS Code.

```java readme-sample-createStacClient
StacClient stacClient = new PlanetaryComputerProClientBuilder()
.credential(new DefaultAzureCredentialBuilder().build())
.endpoint("<your-endpoint>")
.buildStacClient();
```

## Key concepts

### STAC (SpatioTemporal Asset Catalog)

The PlanetaryComputer service is built around the [STAC specification](https://stacspec.org/), which provides a common structure for describing geospatial information. Key STAC concepts include:
The Planetary Computer Pro service is built around the [STAC specification](https://stacspec.org/), which provides a common structure for describing geospatial information. Key STAC concepts include:

- **Collection** — A grouping of related geospatial assets (e.g., satellite imagery, land cover data). Each collection has metadata including spatial and temporal extents, license information, and provider details.
- **Item** — A GeoJSON Feature representing a single spatiotemporal asset within a collection. Items contain geometry, temporal metadata, and references to data assets.
Expand All @@ -53,7 +88,7 @@ The SDK provides four client pairs (synchronous and asynchronous) built from a s
| Client | Purpose |
|--------|---------|
| `StacClient` / `StacAsyncClient` | Manage STAC catalog resources — collections, items, mosaics, render options, queryables, and search |
| `DataClient` / `DataAsyncClient` | Tiler operations — map tiles, previews, statistics, static images, and legends |
| `DataClient` / `DataAsyncClient` | Tiler operations — map tiles, previews, statistics, legends, and point values |
| `IngestionClient` / `IngestionAsyncClient` | Manage data ingestion — definitions, runs, sources, and operations |
| `SharedAccessSignatureClient` / `SharedAccessSignatureAsyncClient` | Generate and manage SAS tokens for accessing underlying Azure Blob Storage |

Expand All @@ -63,11 +98,20 @@ Some operations such as creating collections, deleting collections, and creating

## Examples

The following sections provide code snippets covering common PlanetaryComputer tasks:
The following sections provide code snippets covering common Planetary Computer tasks:

- [Create a client](#create-a-client)
- [List STAC collections](#list-stac-collections)
- [Get a STAC collection](#get-a-stac-collection)
- [Search for STAC items](#search-for-stac-items)
- [Get STAC item details](#get-stac-item-details)
- [Create a STAC collection](#create-a-stac-collection)
- [Configure collection visualization](#configure-collection-visualization)
- [Register and render mosaic tiles](#register-and-render-mosaic-tiles)
- [Extract point values](#extract-point-values)
- [Generate map tiles](#generate-map-tiles)
- [Set up ingestion sources](#set-up-ingestion-sources)
- [Data ingestion management](#data-ingestion-management)
- [Generate a SAS token](#generate-a-sas-token)

### Create a client
Expand All @@ -90,6 +134,17 @@ StacAsyncClient stacAsyncClient = new PlanetaryComputerProClientBuilder()
.buildStacAsyncClient();
```

### List STAC collections

Browse all available STAC collections in your GeoCatalog:

```java readme-sample-listCollections
StacCatalogCollections collections = stacClient.getCollections();
for (StacCollection col : collections.getCollections()) {
System.out.printf("Collection: %s - %s%n", col.getId(), col.getTitle());
}
```

### Get a STAC collection

Retrieve a specific collection by its identifier:
Expand All @@ -114,6 +169,119 @@ StacItemCollection results = stacClient.search(
System.out.printf("Found %d items%n", results.getFeatures().size());
```

### Get STAC item details

Retrieve a specific item from a collection:

```java readme-sample-getItem
StacItem item = stacClient.getItem("naip-atl", "ga_m_3308421_se_16_060_20211114");
System.out.printf("Item ID: %s, Collection: %s%n", item.getId(), item.getCollection());
System.out.printf("Assets: %s%n", item.getAssets().keySet());
```

### Create a STAC collection

Create a new collection using a long-running operation:

```java readme-sample-createCollection
String collectionJson = "{"
+ "\"id\": \"my-collection\","
+ "\"type\": \"Collection\","
+ "\"stac_version\": \"1.0.0\","
+ "\"description\": \"My geospatial dataset\","
+ "\"license\": \"proprietary\","
+ "\"extent\": {\"spatial\": {\"bbox\": [[-180, -90, 180, 90]]},"
+ "\"temporal\": {\"interval\": [[\"2020-01-01T00:00:00Z\", null]]}},"
+ "\"links\": []}";

SyncPoller<BinaryData, BinaryData> poller = stacClient.beginCreateCollection(
BinaryData.fromString(collectionJson), new RequestOptions());
poller.getFinalResult();
```

### Configure collection visualization

Add render options to control how collection data is visualized on map tiles:

```java readme-sample-configureVisualization
RenderOption renderOption = new RenderOption("natural-color", "Natural Color")
.setType(RenderOptionType.RASTER_TILE)
.setOptions("assets=image&asset_bidx=image|1,2,3")
.setMinZoom(6);
RenderOption created = stacClient.createRenderOption("naip-atl", renderOption);
System.out.printf("Created render option: %s%n", created.getId());
```

### Register and render mosaic tiles

Register a search-based mosaic and retrieve tiles:

```java readme-sample-mosaicTiles
String searchBody = "{\"filter\":{\"op\":\"and\",\"args\":["
+ "{\"op\":\"=\",\"args\":[{\"property\":\"collection\"},\"naip-atl\"]},"
+ "{\"op\":\">=\",\"args\":[{\"property\":\"datetime\"},\"2021-01-01T00:00:00Z\"]}"
+ "]},\"filter-lang\":\"cql2-json\"}";

Response<BinaryData> searchResponse = dataClient.registerMosaicsSearchWithResponse(
BinaryData.fromString(searchBody), new RequestOptions());
String searchId = searchResponse.getValue()
.toObject(TilerMosaicSearchRegistrationResponse.class).getSearchId();
System.out.printf("Registered mosaic search: %s%n", searchId);
```

### Extract point values

Query pixel values at a specific geographic coordinate:

```java readme-sample-pointValues
RequestOptions options = new RequestOptions();
options.addQueryParam("assets", "image", false);
Response<BinaryData> response = dataClient.getItemPointWithResponse(
"naip-atl", "ga_m_3308421_se_16_060_20211114", -84.386, 33.676, options);
System.out.printf("Point data: %s%n", response.getValue().toString());
```

### Generate map tiles

Retrieve a map tile for a specific item:

```java readme-sample-mapTile
RequestOptions options = new RequestOptions();
options.addQueryParam("assets", "image", false);
options.addQueryParam("asset_bidx", "image|1,2,3", false);
BinaryData tile = dataClient.getTileByFormatWithResponse(
"naip-atl", "ga_m_3308421_se_16_060_20211114",
"WebMercatorQuad", 14, 4349, 6564, "png", options).getValue();
System.out.printf("Tile size: %d bytes%n", tile.toBytes().length);
```

### Set up ingestion sources

Configure an ingestion source for importing data into your GeoCatalog:

```java readme-sample-ingestionSource
IngestionSource source = ingestionClient.createSource(
new ManagedIdentityIngestionSource("source-id",
new ManagedIdentityConnection("https://storage.blob.core.windows.net/container",
"managed-identity-object-id")));
System.out.printf("Created ingestion source: %s%n", source.getId());
```

### Data ingestion management

Create an ingestion definition and start a run:

```java readme-sample-ingestion
IngestionDefinition ingestion = new IngestionDefinition();
ingestion.setImportType(IngestionType.STATIC_CATALOG);
ingestion.setDisplayName("My Dataset Ingestion");
ingestion.setSourceCatalogUrl("https://example.com/catalog.json");

IngestionDefinition created = ingestionClient.create("my-collection", ingestion);
IngestionRun run = ingestionClient.createRun("my-collection", created.getId());
System.out.printf("Ingestion run started: %s%n", run.getId());
```

### Generate a SAS token

Generate a SAS token to access data assets in Azure Blob Storage:
Expand All @@ -126,14 +294,6 @@ SharedAccessSignatureClient sasClient = new PlanetaryComputerProClientBuilder()
SharedAccessSignatureToken token = sasClient.getToken("naip-atl", null);
```

### Building the package

To compile the package into a standalone jar, use the following command from the root of the repository:

```bash
mvn clean package -f sdk/planetarycomputer/azure-analytics-planetarycomputer/pom.xml
```

### Service API versions

The client library targets the latest service API version by default.
Expand All @@ -151,8 +311,24 @@ Always ensure that the chosen API version is fully supported and operational for

## Troubleshooting

### Enable client logging

You can set the `AZURE_LOG_LEVEL` environment variable to view logging statements made in the client library. For example, setting `AZURE_LOG_LEVEL=2` would show all informational, warning, and error log messages. The log levels can be found here: [log levels][log_levels].

### Default HTTP Client

All client libraries by default use the Netty HTTP client. Adding the above dependency will automatically configure the client library to use the Netty HTTP client. Configuring or changing the HTTP client is detailed in the [HTTP clients wiki](https://github.com/Azure/azure-sdk-for-java/wiki/HTTP-clients).

### Default SSL library

All client libraries, by default, use the Tomcat-native Boring SSL library to enable native-level performance for SSL operations. The Boring SSL library is an uber jar containing native libraries for Linux / macOS / Windows, and provides better performance compared to the default SSL implementation within the JDK. For more information, including how to reduce the dependency size, refer to the [performance tuning][performance_tuning] section of the wiki.

## Next steps

- Get started with the Azure Planetary Computer client library by exploring the [samples][samples].
- Review the [API reference documentation][docs] for detailed information on available operations.
- Learn more about [Microsoft Planetary Computer Pro][product_documentation].

## Contributing

For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
Expand All @@ -164,8 +340,12 @@ For details on contributing to this repository, see the [contributing guide](htt
1. Create new Pull Request

<!-- LINKS -->
[product_documentation]: https://azure.microsoft.com/services/
[source]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/planetarycomputer/azure-analytics-planetarycomputer/src
[docs]: https://azure.github.io/azure-sdk-for-java/
[product_documentation]: https://learn.microsoft.com/azure/planetary-computer/
[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/planetarycomputer/azure-analytics-planetarycomputer/src/samples
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
[log_levels]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java
[performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo":"Azure/azure-sdk-assets",
"AssetsRepoPrefixPath":"java",
"TagPrefix":"java/planetarycomputer/azure-analytics-planetarycomputer",
"Tag": "java/planetarycomputer/azure-analytics-planetarycomputer_fb1a365bf2"
"Tag": "java/planetarycomputer/azure-analytics-planetarycomputer_b50666de1e"
}
Loading