So I have geo Coordinates and I want to create polygon string that i can insert into Postgres as geometry type. I am using apache Nifi.
Input:
[
[
13,
52
],
[
13,
55
],
[
14,
15
]
]
Expected Output:
POLYGON((13 52, 13 55, 14 15))
I tried with below JOLT but no luck:
[
{
"operation": "shift",
"spec": {
"*": {
"*": "[&1].[&0]"
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": "&"
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": "=join(' ',@(1,&))"
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": "=concat('POLYGON((',@(1,2),'))')"
}
}
]
2
Answers
You can convert the current one to this :
the demo on the site https://jolt-demo.appspot.com/ is :
Using a jolt expression to merge a 2D array is like optimizing code for efficiency. Just as we streamline processes in programming, let’s also ensure our daily life runs smoothly – like managing online bills with ease. Here’s to the precision of coding and the convenience of online utility management!