olp catalog layer feature

The OLP CLI supports the following:

  • list features from an interactive map layer
  • get features from an interactive map layer
  • update features in an interactive map layer
  • put features to an interactive map layer
  • delete features from an interactive map layer

catalog layer feature list

Lists the features of the specified interactive map layer to the standard output.

olp catalog layer feature list <catalog HRN> <layer ID> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.

Optional parameters:

  • --ids <ID1 ID2 ...> The list of feature IDs you want to fetch, separated by space.
  • --filter <filter query> Searches features based on property values using a filter query. Use a semicolon to query on multiple properties. For example, --filter "p.age>20;p.country=Germany". Here the prefix p. points to the feature's properties map. For more information, see Search Features.
  • The bounding box to search the area in the westLongitude, southLatitude, eastLongitude, northLatitude format. The coordinates are in the WGS'84 format. For example,--bbox 13.082,52.416,13.628,52.626.
  • --limit <limit> The number of features to be fetched. The default limit is 200.
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays feature IDs, each on a new line.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The following command lists 200 features from the interactive map layer layer1 in the catalog catalog1.


olp catalog layer feature list hrn:here-cn:data::org:catalog1 layer1

Output:


ID                                      geometryType        createdAt           updatedAt
QBqnw3VUGo5bxpNs                        Point               14/05/2021 04:30    14/05/2021 04:30
sQkir7fa7jJZuOHK                        Point               14/05/2021 05:27    15/05/2021 06:45
C5k0BquzEspp7N5I                        LineString          15/05/2021 03:13    16/05/2021 04:30
sAjKucaagZPem005                        Polygon             17/05/2021 07:46    18/05/2021 06:36
08MeHAD5fmhgX2MY                        Polygon             21/05/2021 06:58    22/05/2021 02:30

Use olp catalog layer feature get <catalog HRN> <layer ID> --ids=<featureId> to download features

catalog layer feature get

This command is used for fetching the data from an interactive map layer. By default, the command output is displayed in the standard output in JSON format. This command has different options which you can use to fetch the data according to your needs.

olp catalog layer feature get <catalog HRN> <layer ID> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.

Optional parameters:

  • --ids <ID1 ID2 ...> The list of feature IDs you want to fetch, separated by space.
  • --filter <filter query> Searches features based on property values using a filter query. Use a semicolon to query on multiple properties. For example, --filter "p.age>20;p.country=Germany". Here the prefix p. points to the feature's properties map. For more information, see Search Features.
  • --bbox <bbox> The bounding box to search the area in the westLongitude, southLatitude, eastLongitude, northLatitude format. The coordinates are in the WGS'84 format. For example, --bbox 13.082,52.416,13.628,52.626.
  • --limit <limit> The number of features to be fetched. The default limit is 30,000.
  • --output <path to dir> The output directory to store the downloaded features. If the specified directory doesn't exist, it is automatically created. If no directory is specified, the default value is <current dir>.
  • --all Downloads all the features from the layer to the directory specified in the --output parameter. If no directory is specified, the default download location is <current dir>.
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays the absolute path to the output directory, if available. Otherwise, the features are printed to the standard output.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The following command prints the features with IDs feature1 and feature2 from the interactive map layer interactivemap-layer1 in the catalog catalog1 to the standard output.

Linux
Windows
olp catalog layer feature get hrn:here-cn:data::org:catalog1 interactivemap-layer1 \
--ids feature1 feature2
olp catalog layer feature get hrn:here-cn:data::org:catalog1 interactivemap-layer1 ^
--ids feature1 feature2

Example:

The following command downloads the features by applying filter p.age>20;p.country=Germany from the interactive map layer interactivemap-layer1 in the catalog catalog1 to the specified output directory. This query returns the features whose property age value is greater than 20 and the country is Germany.

Linux
Windows
olp catalog layer feature get hrn:here-cn:data::org:catalog1 interactivemap-layer1 \
--filter "p.age>20;p.country=Germany" --output <output-path>
olp catalog layer feature get hrn:here-cn:data::org:catalog1 interactivemap-layer1 ^
--filter "p.age>20;p.country=Germany" --output <output-path>

catalog layer feature update

This command is used to perform multiple feature updates in a single transaction into an interactive map layer. This command supports .geojson files.

olp catalog layer feature update <catalog HRN> <layer ID> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.

Optional parameters:

  • --modifications <path to input file> The input GeoJSON file for the layer. If no file is specified, the command reads the data from the standard output.
  • --batch-size <number-of-features> The batch size used for uploading data. The minimal batch size is 1, the default value is 1000.
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays empty output with no additional information.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Note

When uploading large feature modifications, use the --modifications parameter. If this parameter is not used, only pass feature modifications up to 50 MB.

Input:

The input contains a list of FeatureModification(s) where each FeatureModification contains a FeatureCollection and details that specify the action to be performed when the given set of features in the FeatureCollection either exists or does not exist. For every FeatureModification entry, action specified by onFeatureExists is executed on a contained feature when it exists already whereas action specified by onFeatureNotExists is executed when the feature is newly created.

{
    "type": "FeatureModificationList",
    "modifications": [
        {
            "type": "FeatureModification",
            "featureData": {
                "type": "FeatureCollection",
                "features": [
                    {
                        "type": "Feature",
                        "id": "BfiimUxHjj",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                -2.960847,
                                53.430828
                            ]
                        },
                        "properties": {
                            "name": "Anfield",
                            "@ns:com:here:xyz": {
                                "tags": [
                                    "football",
                                    "stadium"
                                ]
                            },
                            "amenity": "Football Stadium",
                            "capacity": 54074,
                            "description": "Home of Liverpool Football Club"
                        }
                    }
                ]
            },
            "onFeatureNotExists": "create",
            "onFeatureExists": "retain"
        },
        {
            "type": "FeatureModification",
            "featureData": {
                "type": "FeatureCollection",
                "features": [
                    {
                        "type": "Feature",
                        "id": "BfiimUxHxx",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                -2.960839,
                                53.340012
                            ]
                        },
                        "properties": {
                            "name": "Anfield",
                            "@ns:com:here:xyz": {
                                "tags": [
                                    "cricket",
                                    "stadium"
                                ]
                            },
                            "amenity": "Cricket Stadium",
                            "capacity": 54074,
                            "description": "Home of Surrey Cricket Club"
                        }
                    }
                ]
            },
            "onFeatureNotExists": "create",
            "onFeatureExists": "delete"
        }
    ]
}

Example:

The following command uploads the data from the specified input file to the interactive map layer interactivemap-layer in the catalog catalog.

Linux
Windows
olp catalog layer feature update hrn:here-cn:data::org:catalog interactivemap-layer \ 
--modifications path/to/input.json
olp catalog layer feature update hrn:here-cn:data::org:catalog interactivemap-layer ^ --modifications path/to/input.json

catalog layer feature put

This command is used to upload the data into an interactive map layer. It supports .geojson files.

olp catalog layer feature put <catalog HRN> <layer ID> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.

Optional parameters:

  • --data <path to input file> The input GeoJSON file for the layer. If no file is specified, the command reads the data from the standard input.
  • --batch-size <number-of-features> The batch size used for uploading data. Minimal batch size is 1, the default is 1000.
  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays empty output with no additional information.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Note

If ID is available in the input feature, then the service uses the same ID, else UUID is generated for those features.

Example:

The following command uploads the data from the specified input file to the interactive map layer interactivemap-layer1 in the catalog catalog1.

Linux
Windows
olp catalog layer feature put hrn:here-cn:data::org:catalog1 interactivemap-layer1 \
--data <input_file_path>
olp catalog layer feature put hrn:here-cn:data::org:catalog1 interactivemap-layer1 ^
--data <input_file_path>

catalog layer feature delete

This command is used to delete features from an interactive map layer.

olp catalog layer feature delete <catalog HRN> <layer ID> [command options]

Required parameters:

  • <catalog HRN> The HRN of the catalog.
  • <layer ID> The ID of the layer.
  • --ids <ID1 ID2 ...> The list of feature IDs you want to delete from the layer, separated by space.

Optional parameters:

  • --credentials <path to credentials file> The name of a credentials file to use with the command. Credentials files are downloaded separately from the platform portal.
  • --profile <profile name> The name of the credentials profile to use from the olpcli.ini file.
  • --quiet Displays empty output with no additional information.
  • --scope <project HRN> Specifies the project HRN to use as the scope in the request. The value specified with --scope overrides any value for here.token.scope provided in the credentials file used for the command.

For more information on using credentials and profiles, see Credentials setup.

Example:

The following command deletes the features with IDs feature1 and feature2 from the interactive map layer interactivemap-layer1 in the catalog catalog1.

Linux
Windows
olp catalog layer feature delete hrn:here-cn:data::org:catalog1 interactivemap-layer1 \
--ids feature1 feature2
olp catalog layer feature delete hrn:here-cn:data::org:catalog1 interactivemap-layer1 ^
--ids feature1 feature2

results matching ""

    No results matching ""