Read and Write to an Interactive Map Layer

Read Data from an Interactive Map Layer

The following snippet shows how to retrieve data from an interactive map layer in a catalog using getFeatureCollectionByTile.

Scala
Java
// create dataclient
val client = new FlinkDataClient()
val queryApi = client.queryApi(hrn)

val tileId = "some-tile-id"
val tileType = TileType.HERE
val featureCollection =
  queryApi.getFeatureCollectionByTile(layer, tileId, tileType, Set.empty, Set.empty, None);
FlinkDataClient client = new FlinkDataClient();
FlinkQueryApi queryApi = client.queryApi(hrn);

String tileId = "some-tile-id";
InteractiveMapOptions.TileType tileType = InteractiveMapOptions.TileType.HERE;

FeatureCollection featureCollection =
    queryApi.getFeatureCollectionByTile(
        layer,
        tileId,
        tileType,
        Collections.emptySet(),
        Collections.emptySet(),
        OptionalInt.empty());
DataStream<Feature> featureStream = env.fromCollection(featureCollection.getFeatures());

Upload Data to an Interactive Map Layer

The following snippet shows how to upload data to an interactive map layer in the catalog using postFeatureCollection.

Scala
Java
// create dataclient
val client = new FlinkDataClient()
val publishApi = client.publishApi(hrn)

val featureCollection = getFeatureCollection

val response = publishApi.postFeatureCollection(layer,
                                                featureCollection,
                                                Some(IfExistType.PATCH),
                                                Some(IfNotExistType.CREATE),
                                                true)
FlinkDataClient client = new FlinkDataClient();
FlinkPublishApi publishApi = client.publishApi(hrn);

FeatureCollection response =
    publishApi.postFeatureCollection(
        layer,
        featureCollection,
        Optional.of(InteractiveMapOptions.IfExistType.PATCH),
        Optional.of(InteractiveMapOptions.IfNotExistType.CREATE),
        true);

For the meaning of geo-coordinates, see chapter Geo-coordinates.

results matching ""

    No results matching ""