This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new eace4030 Regen for commit 438d54a28700a96c0e5c55d4ae1dc026195df2e9
eace4030 is described below

commit eace4030dee73896520931696d9e5f93a8f1bb95
Author: oscerd <osc...@users.noreply.github.com>
AuthorDate: Wed Jul 27 17:59:20 2022 +0000

    Regen for commit 438d54a28700a96c0e5c55d4ae1dc026195df2e9
    
    Signed-off-by: GitHub <nore...@github.com>
---
 docs/modules/ROOT/nav.adoc                         |   1 +
 .../kamelets/ogcapi-features-action.kamelet.yaml   | 124 +++++++++++++++++++++
 2 files changed, 125 insertions(+)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 1c9454c7..49abb682 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -144,6 +144,7 @@
 * xref:nats-sink.adoc[]
 * xref:nats-source.adoc[]
 * xref:nominatim-geocode-action.adoc[]
+* xref:ogcapi-features-action.adoc[]
 * xref:openai-classification-action.adoc[]
 * xref:openai-completion-action.adoc[]
 * xref:oracle-database-sink.adoc[]
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/ogcapi-features-action.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/ogcapi-features-action.kamelet.yaml
new file mode 100644
index 00000000..08a1df73
--- /dev/null
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/ogcapi-features-action.kamelet.yaml
@@ -0,0 +1,124 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: ogcapi-features-action
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgd2lkdGg9IjIxMDAiCiAgIGhlaWdodD0iMjEwMCIKICAgdmlld0JveD0iMCAwIDIxMDAgMjEwMCIKICAgdmVyc2lvbj0iMS4xIgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICBzdHlsZT0iY2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjIiCiAgIGlkPSJzdmcxMTEwIgogICBzb2RpcG9kaTpkb2NuYW1lPSJPcGVuX0dlb3NwYXRpYWxfQ29uc29ydGl1bV9sb2dvLnN2Zy
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "Geospatial"
+  labels:
+    camel.apache.org/kamelet.type: "action"
+spec:
+  definition:
+    title: "OGC Api Feature Get Item Action"
+    description: |-
+      Returns the items of the collection provided of an OGC API Features 
server. 
+      The collection must be a valid collection name on the server.
+      
+      Query can be defined in the body too.
+      
+      See https://www.ogc.org/standards/ogcapi-features
+    required:
+      - url
+      - collection
+    type: object
+    properties:
+      url:
+        title: URL
+        description: The URL to fetch for data
+        type: string
+        example: "https://emotional.byteroad.net";
+        pattern: "^(http|https)://.*"
+      collection:
+        title: "Collection"
+        description: "Name of the collection we want to extract items from."
+        type: string
+      bbox:
+        title: "Bounding Box"
+        description: "Bounding Box of the items we want to retrieve."
+        example: "160.6,-55.95,-170,-25.89"
+        default: "-180,-90,180,90"
+        type: string
+      limit:
+        title: "Limit"
+        description: "Maximum number of items to retrieve. Must be a number 
between 1 and 10 000."
+        type: integer
+        default: 10
+      split:
+        title: "Split by Feature"
+        description: "When true, instead of returning the full geojson, split 
the message into each feature."
+        type: boolean
+        default: false
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+      query:
+        title: "Query"
+        description: "Separated list by `&` of properties we want to query."
+        example: "property1=1&property2=dos"
+        default: ""
+        type: string
+  types:
+    in:
+      mediaType: text/plain
+    out:
+      mediaType: application/json
+  dependencies:
+    - "camel:core"
+    - "camel:http"
+    - "camel:kamelet"
+    - "camel:jsonpath"
+    - "camel:jackson"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - set-header:
+          name: "Accept"
+          constant: "application/geo+json"
+      - set-header:
+          name: "CamelHttpQuery"
+          simple: "limit={{limit}}&bbox={{bbox}}&{{?query}}&${body}"
+      - set-body:
+          simple: ""
+      - to: 
+          uri: "{{url}}/collections/{{collection}}/items"
+      - remove-header:
+          name: "Accept"
+      - remove-header:
+          name: "CamelHttpQuery"
+      - convert-body-to:
+          type: "java.lang.String"
+      - choice:
+          when:
+          - simple: "{{split}}"
+            steps:
+            - split:
+                jsonpath: "$.features[*]"
+                steps:
+                  - marshal:
+                      json: {}
+                  - to: "kamelet:sink"
+          otherwise:
+            steps:
+            - to: "kamelet:sink"
+
+
+

Reply via email to