Google Spreadsheet RE2 Regex and Geojson - json

I have a Geojson in a google sheet cell. I'd like to extract coordinates from that. I tried using Regexextract function but I'm really having trouble in making the regex work.
This is a sample structure:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
62.22656249999999,
61.438767493682825
],
[
54.140625,
44.33956524809713
],
[
79.453125,
48.45835188280866
],
[
62.22656249999999,
61.438767493682825
]
]
]
}
}
]
}
what I want to obtain is
[[[62.22656249999999,61.438767493682825],[54.140625,44.33956524809713],[79.453125,48.45835188280866],[62.22656249999999,61.438767493682825]]]
Can you help me with that?
Thanks

=REGEXREPLACE(A5,"[^\[\]\.\d+,]",)
Anything except []., and digits gives a close approximation.
EDIT:
=REGEXEXTRACT(A5,"(?s)(\[\s+\[\s+\[.*\]\s+\]\s+\])")

Related

Unable to extract values from a dynamic list of lists in a JSON response in Power Automate

In Power Automate, from the following json response which is obtained from azure-application-insights, I wish to extract each of the sub-lists in the “rows” list. The number of sub-lists would be variable depending upon the responses from the insights.
{
"tables": [
{
"name": "PrimaryResult",
"columns": [
{
"name": "Name",
"type": "dynamic"
},
{
"name": "Question",
"type": "dynamic"
},
{
"name": "Answer",
"type": "dynamic"
],
"rows": [
[
"John",
"when are you going",
"January’ 2022?"
],
[
"Albert",
"who will add deal co-owners for a deal?",
"The authorizers"
],
[
"Mohan",
"co-deal owner name can be added by whom?",
"The approvers”
]
]
}
]
}
I wish to dynamically extract the contents of all the sub-lists, and use each of the extracted outputs separately.

GeoJSON without javascript object - can InfoWindow be drawn?

I'm wondering if an InfoWindow (or similarly rich component) can be handed to a Google Map within the GeoJSON itself as a "feature", or "shape", etc.
(I'm working in an environment where I don't have access to the google.maps.Map object, but I do have access to the GeoJSON that is rendered on the map.)
In other words, is something like this possible?:
{
"type": "FeatureCollection",
"features": [
{
"type":"Feature",
"properties":
{
"strokeColor":"#00FF00",
"strokeWeight":4,
"strokeOpacity":1
},
"geometry":
{
"type":"LineString",
"coordinates":
[
[-150.6339948,64.98646889999999],
[-147.8560028,64.81510162]
]
}
},
{
"type":"Feature",
"properties":
{
"content":"testing testing",
"minWidth":100
},
"geometry":
{
"type":"InfoWindow",
"coordinates":
[-150.6339948,64.98646889999999]
}
}
]
}
Thanks in advance for your time!

Couchbase query array

I have the following json saved in my couchbase bucket "geo".
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"ID": "1753242",
"TYPE": "8003"
}
},
{
"type": "Feature",
"properties": {
"ID": "4823034",
"TYPE": "7005"
}
},
{
"type": "Feature",
"properties": {
"ID": "4823034",
"TYPE": "8003"
}
}
]
}
To get all "features" with "properties.TYPE : 8003" I tried the following.
SELECT features FROM geo
WHERE ANY f IN features SATISFIES f.properties.TYPE = "8003" END;
But this returns the whole json document and not just the "features" with the properties.TYPE "8003".
Does anybody know, how to query to get just the matching features with "properties.TYPE": "8003" as result?
The ANY expression in the WHERE-clause is used to only filter the documents of interest. If you want specific project list, you need to write corresponding expression in the projection list as well. The projection in your query is asking for 'features' and hence the whole 'features' array is being returned. You can write following expression on the projection list to get the output you want:
SELECT ARRAY f FOR f IN features WHEN f.properties.TYPE = "8003" END
FROM geo
WHERE ANY f IN features SATISFIES f.properties.TYPE = "8003" END;
[
{
"$1": [
{
"properties": {
"ID": "1753242",
"TYPE": "8003"
},
"type": "Feature"
},
{
"properties": {
"ID": "4823034",
"TYPE": "8003"
},
"type": "Feature"
}
]
}
]
hth,
-Prasad

Something wrong with format of json

I am using this json data
{
"type":"Polygon",
"coordinates":[[[72.8282833,19.0175056],[72.8285408,19.017849],[72.8292274,19.0185356],[72.8302574,19.0188789],[72.8309441,19.0195656],[72.8311157,19.0200806],[72.8311157,19.0207672],[72.8312874,19.0212822],[72.833004,19.0229988],[72.8333473,19.0240288],[72.8336906,19.0243721],[72.834034,19.0254021],[72.8343773,19.0257454],[72.8347206,19.0267754],[72.8350639,19.0271187],[72.8354073,19.0281487],[72.8357506,19.028492],[72.8357506,19.0288353],[72.8354073,19.0291786],[72.8352356,19.0296936],[72.8352356,19.0303802],[72.8354073,19.0308952],[72.8357506,19.0312386],[72.8360939,19.0322685],[72.8371239,19.0326118],[72.8374672,19.0329552],[72.8379822,19.0331268],[72.8384972,19.0329552],[72.8388405,19.0326118],[72.8393555,19.0324402],[72.8398705,19.0326118],[72.8412437,19.0339851],[72.8415871,19.0350151],[72.8422737,19.0357018],[72.8427887,19.0358734],[72.8434753,19.0358734],[72.8439903,19.0360451],[72.8443336,19.0363884],[72.8448486,19.0365601],[72.8455353,19.0365601],[72.8460503,19.0367317],[72.8463936,19.037075],[72.8474236,19.0374184],[72.8475952,19.0379333],[72.8475952,19.0399933],[72.8474236,19.0405083],[72.8469086,19.0406799],[72.8462219,19.0406799],[72.8457069,19.0408516],[72.8453636,19.0418816],[72.8439903,19.0432549],[72.8434753,19.0434265],[72.8427887,19.0434265],[72.8422737,19.0435982],[72.8419304,19.0439415],[72.8414154,19.0441132],[72.8400421,19.0441132],[72.8395271,19.0442848],[72.8393555,19.0447998],[72.8393555,19.0468597],[72.8395271,19.0473747],[72.8415871,19.0494347],[72.8421021,19.0496063],[72.8427887,19.0496063],[72.8433037,19.0494347],[72.844677,19.0480614],[72.8450203,19.0470314],[72.8455353,19.0468597],[72.8469086,19.0468597],[72.8474236,19.0470314],[72.8477669,19.0473747],[72.8487968,19.047718],[72.8487968,19.0480614],[72.8484535,19.0484047],[72.8481102,19.0494347],[72.8457069,19.0518379],[72.8455353,19.0523529],[72.8455353,19.0537262],[72.8457069,19.0542412],[72.8462219,19.0544128],[72.8475952,19.0544128],[72.8481102,19.0542412],[72.8487968,19.0535545],[72.8491402,19.0525246],[72.8508568,19.050808],[72.8512001,19.049778],[72.8518867,19.0490913],[72.8522301,19.0490913],[72.8525734,19.0494347],[72.8530884,19.0496063],[72.8544617,19.0496063],[72.8549767,19.049778],[72.8563499,19.0511513],[72.8566933,19.0521812],[72.8573799,19.0528679],[72.8578949,19.0530396],[72.8640747,19.0530396],[72.8645897,19.0532112],[72.8652763,19.0538979],[72.865448,19.0544128],[72.865448,19.0550995],[72.8656197,19.0556145],[72.8661346,19.0557861],[72.8668213,19.0557861],[72.8673363,19.0559578],[72.8690529,19.0576744],[72.8695679,19.0578461],[72.8709412,19.0578461],[72.8714561,19.0576744],[72.8717995,19.0573311],[72.8721428,19.0573311],[72.8731728,19.0583611],[72.8736877,19.0585327],[72.8742027,19.0583611],[72.8745461,19.0580177],[72.875061,19.0578461],[72.875576,19.0580177],[72.8759193,19.0590477],[72.8769493,19.059391],[72.8772926,19.060421],[72.877636,19.0607643],[72.8779793,19.0617943],[72.8784943,19.0619659],[72.8798676,19.0619659],[72.8803825,19.0617943],[72.8807259,19.0607643],[72.8814125,19.0600777],[72.8819275,19.059906],[72.8826141,19.059906],[72.8831291,19.0597343],[72.8834724,19.059391],[72.8839874,19.0592194],[72.8845024,19.059391],[72.8848457,19.0597343],[72.8853607,19.059906],[72.8860474,19.059906],[72.8865623,19.0600777],[72.8869057,19.060421],[72.8874207,19.0605927],[72.8879356,19.060421],[72.888279,19.0600777],[72.8886223,19.0600777],[72.8889656,19.060421],[72.8899956,19.0607643],[72.8917122,19.0624809],[72.8922272,19.0626526],[72.8942871,19.0626526],[72.8948021,19.0624809],[72.8949738,19.0619659],[72.8949738,19.0605927],[72.8948021,19.0600777],[72.8937721,19.0597343],[72.8927422,19.0587044],[72.8917122,19.0583611],[72.8896523,19.0563011],[72.8894806,19.0557861],[72.8896523,19.0552711],[72.8906822,19.0549278],[72.8913689,19.0542412],[72.8913689,19.0538979],[72.8906822,19.0532112],[72.8901672,19.0530396],[72.8894806,19.0530396],[72.8889656,19.0528679],[72.8886223,19.0525246],[72.8881073,19.0523529],[72.886734,19.0523529],[72.886219,19.0521812],[72.8858757,19.0518379],[72.8853607,19.0516663],[72.8846741,19.0516663],[72.8841591,19.0518379],[72.8838158,19.0521812],[72.8834724,19.0521812],[72.8833008,19.0516663],[72.8833008,19.0509796],[72.8831291,19.0504646],[72.8827858,19.0501213],[72.8827858,19.049778],[72.8831291,19.0494347],[72.8833008,19.0489197],[72.8833008,19.0454865],[72.8831291,19.0449715],[72.8826141,19.0447998],[72.8784943,19.0447998],[72.8779793,19.0449715],[72.8772926,19.0456581],[72.8769493,19.0466881],[72.8759193,19.047718],[72.875576,19.048748],[72.875061,19.0489197],[72.8736877,19.0489197],[72.8731728,19.048748],[72.8728294,19.0484047],[72.8717995,19.0480614],[72.8714561,19.047718],[72.8704262,19.0473747],[72.8702545,19.0468597],[72.8702545,19.0461731],[72.8700829,19.0456581],[72.8697395,19.0453148],[72.8693962,19.0442848],[72.8690529,19.0439415],[72.8688812,19.0434265],[72.8690529,19.0429115],[72.8700829,19.0418816],[72.8702545,19.0413666],[72.8702545,19.0406799],[72.8700829,19.0401649],[72.8697395,19.0398216],[72.8697395,19.0394783],[72.8700829,19.039135],[72.8704262,19.038105],[72.8709412,19.0379333],[72.8723145,19.0379333],[72.8728294,19.0377617],[72.8735161,19.037075],[72.8736877,19.0365601],[72.8735161,19.0360451],[72.8728294,19.0353584],[72.8723145,19.0351868],[72.8716278,19.0351868],[72.8711128,19.0350151],[72.8711128,19.0346718],[72.8714561,19.0343285],[72.8716278,19.0338135],[72.8716278,19.0324402],[72.8714561,19.0319252],[72.8709412,19.0317535],[72.8695679,19.0317535],[72.8690529,19.0315819],[72.8688812,19.0310669],[72.8688812,19.0303802],[72.8687096,19.0298653],[72.8683662,19.0295219],[72.8681946,19.029007],[72.8683662,19.028492],[72.8697395,19.0271187],[72.8707695,19.0267754],[72.8709412,19.0262604],[72.8709412,19.0255737],[72.8707695,19.0250587],[72.8704262,19.0247154],[72.8704262,19.0243721],[72.8711128,19.0236855],[72.8714561,19.0236855],[72.8717995,19.0240288],[72.8723145,19.0242004],[72.8730011,19.0242004],[72.8735161,19.0240288],[72.8742027,19.0233421],[72.8742027,19.0229988],[72.8738594,19.0226555],[72.8736877,19.0221405],[72.8738594,19.0216255],[72.8743744,19.0214539],[72.875061,19.0214539],[72.875576,19.0212822],[72.8757477,19.0207672],[72.8757477,19.0193939],[72.875576,19.0188789],[72.8752327,19.0185356],[72.8748894,19.0175056],[72.8742027,19.016819],[72.8736877,19.0166473],[72.8730011,19.0166473],[72.8724861,19.0164757],[72.8721428,19.0161324],[72.8716278,19.0159607],[72.8709412,19.0159607],[72.8704262,19.0161324],[72.8700829,19.0164757],[72.8697395,19.0164757],[72.8693962,19.0154457],[72.8687096,19.0147591],[72.8681946,19.0145874],[72.8668213,19.0145874],[72.8663063,19.0144157],[72.8661346,19.0139008],[72.8661346,19.0132141],[72.865963,19.0126991],[72.865448,19.0125275],[72.8647614,19.0125275],[72.8642464,19.0123558],[72.8642464,19.0120125],[72.8652763,19.0116692],[72.865448,19.0111542],[72.865448,19.0097809],[72.8652763,19.0092659],[72.8645897,19.0085793],[72.8635597,19.0082359],[72.8632164,19.0078926],[72.8621864,19.0075493],[72.8618431,19.0065193],[72.8613281,19.0063477],[72.8585815,19.0063477],[72.8580666,19.0065193],[72.8570366,19.0075493],[72.8565216,19.0077209],[72.8560066,19.0075493],[72.855835,19.0070343],[72.8560066,19.0065193],[72.8563499,19.006176],[72.8563499,19.0058327],[72.8560066,19.0054893],[72.855835,19.0049744],[72.8560066,19.0044594],[72.8563499,19.0041161],[72.8563499,19.0037727],[72.8560066,19.0034294],[72.8556633,19.0023994],[72.85532,19.0020561],[72.8551483,19.0015411],[72.8551483,19.0008545],[72.8549767,19.0003395],[72.85429,18.9996529],[72.853775,18.9994812],[72.85326,18.9996529],[72.8525734,19.0003395],[72.8524017,19.0008545],[72.8524017,19.0029144],[72.8522301,19.0034294],[72.8518867,19.0037727],[72.8517151,19.0042877],[72.8517151,19.0049744],[72.8518867,19.0054893],[72.8522301,19.0058327],[72.8524017,19.0063477],[72.8524017,19.0090942],[72.8525734,19.0096092],[72.8529167,19.0099525],[72.8529167,19.0102959],[72.8524017,19.0104675],[72.8518867,19.0102959],[72.8517151,19.0097809],[72.8517151,19.0077209],[72.8515434,19.007206],[72.8512001,19.0068626],[72.8508568,19.0058327],[72.8503418,19.005661],[72.8482819,19.005661],[72.8477669,19.0054893],[72.8475952,19.0049744],[72.8477669,19.0044594],[72.8481102,19.0041161],[72.8482819,19.0036011],[72.8482819,19.0015411],[72.8484535,19.0010262],[72.8487968,19.0006828],[72.8489685,19.0001678],[72.8487968,18.9996529],[72.8477669,18.9986229],[72.8475952,18.9981079],[72.8475952,18.9974213],[72.8474236,18.9969063],[72.8469086,18.9967346],[72.8448486,18.9967346],[72.8443336,18.996563],[72.843647,18.9958763],[72.8434753,18.9953613],[72.8434753,18.9946747],[72.8433037,18.9941597],[72.842617,18.9934731],[72.8421021,18.9933014],[72.8414154,18.9933014],[72.8409004,18.9931297],[72.8405571,18.9920998],[72.8395271,18.9917564],[72.8395271,18.9914131],[72.8398705,18.9910698],[72.8398705,18.9907265],[72.8384972,18.9893532],[72.8374672,18.9890099],[72.8372955,18.9884949],[72.8372955,18.9857483],[72.8371239,18.9852333],[72.8367805,18.98489],[72.8366089,18.984375],[72.8366089,18.9823151],[72.8364372,18.9818001],[72.8360939,18.9814568],[72.8359222,18.9809418],[72.8359222,18.9802551],[72.8357506,18.9797401],[72.8354073,18.9793968],[72.8352356,18.9788818],[72.8352356,18.9768219],[72.8350639,18.9763069],[72.834549,18.9761353],[72.8331757,18.9761353],[72.8326607,18.9763069],[72.832489,18.9768219],[72.832489,18.9802551],[72.8326607,18.9807701],[72.833004,18.9811134],[72.8331757,18.9816284],[72.8331757,18.9823151],[72.8333473,18.98283],[72.8336906,18.9831734],[72.8338623,18.9836884],[72.8338623,18.9864349],[72.834034,18.9869499],[72.8343773,18.9872932],[72.834549,18.9878082],[72.8343773,18.9883232],[72.8333473,18.9886665],[72.8331757,18.9891815],[72.8331757,18.9912415],[72.8333473,18.9917564],[72.8343773,18.9920998],[72.8347206,18.9931297],[72.8350639,18.9934731],[72.8350639,18.9938164],[72.834034,18.9941597],[72.8338623,18.9946747],[72.8338623,18.996048],[72.834034,18.996563],[72.8347206,18.9972496],[72.8357506,18.9975929],[72.8359222,18.9981079],[72.8359222,18.9987946],[72.8360939,18.9993095],[72.8364372,18.9996529],[72.8366089,19.0001678],[72.8366089,19.0015411],[72.8367805,19.0020561],[72.8371239,19.0023994],[72.8372955,19.0029144],[72.8371239,19.0034294],[72.8360939,19.0044594],[72.8357506,19.0054893],[72.8354073,19.0058327],[72.8352356,19.0063477],[72.8352356,19.0077209],[72.8354073,19.0082359],[72.8359222,19.0084076],[72.8372955,19.0084076],[72.8378105,19.0082359],[72.8381538,19.0078926],[72.8384972,19.0078926],[72.8386688,19.0084076],[72.8386688,19.0090942],[72.8388405,19.0096092],[72.8398705,19.0099525],[72.8402138,19.0109825],[72.8405571,19.0113258],[72.8407288,19.0118408],[72.8407288,19.0139008],[72.8405571,19.0144157],[72.8402138,19.0144157],[72.8395271,19.0137291],[72.8391838,19.0126991],[72.8378105,19.0113258],[72.8372955,19.0111542],[72.8359222,19.0111542],[72.8354073,19.0113258],[72.8347206,19.0120125],[72.8347206,19.0123558],[72.8350639,19.0126991],[72.8350639,19.0130424],[72.8347206,19.0133858],[72.8343773,19.0144157],[72.8338623,19.0145874],[72.8331757,19.0145874],[72.8326607,19.0147591],[72.8323174,19.0151024],[72.8312874,19.0154457],[72.8309441,19.015789],[72.8306007,19.015789],[72.8295708,19.0147591],[72.8290558,19.0145874],[72.8285408,19.0147591],[72.8278542,19.0154457],[72.8276825,19.0159607],[72.8276825,19.0166473],[72.8277683,19.0171623],[72.8282833,19.017]]]
}
to plot on http://geojson.io/
Is it a syntax error?
Please try this i have ploted the polygon on googlemap and the syntax i got as following
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
61.17187499999999,
59.712097173322924
],
[
116.01562499999999,
59.5343180010956
],
[
136.40625,
41.77131167976407
],
[
116.3671875,
10.487811882056683
],
[
71.015625,
6.315298538330033
],
[
36.2109375,
23.88583769986199
],
[
61.17187499999999,
59.712097173322924
]
]
]
}
}
]
}
link to the polygon which i have created
https://gist.github.com/anonymous/4f79e65b677f7171c7b1

Can't fetching records from nested JSON objects in Sencha Touch Application

I'm stuck with issue for getting web-service response from JSON in Sencha Touch.
I'm getting response from server.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "business_poi_en.1",
"geometry": {
"type": "Point",
"coordinates": [
28.21962354993591,
36.452844361147314
]
},
"geometry_name": "geom",
"properties": {
"status": "M",
"score": 100,
"side": "R",
"ref_id": 0,
"id": null,
"business_p": "AQUARIOUM",
}
},
{
"type": "Feature",
"id": "business_poi_en.2",
"geometry": {
"type": "Point",
"coordinates": [
28.225417523605692,
36.436470953176716
]
},
"geometry_name": "geom",
"properties": {
"status": "M",
"score": 68.44,
"match_type": "A",
"side": "L",
"ref_id": 0,
"id": null,
"business_p": "ZIGOS",
}
},
.... So On ....
I want to fetch data for coordinates from geometry tag, so I can display it on map via these coordinates.I also want to fetch data for business_p from properties tag as displaying title on map.
But, I can't get both of values for coordinates & business_p at same time from same response.
Any idea for getting values at same time ?
Any suggestion will be appreciated.
Please help with this issue.
Thanks in advance.
Your Store's proxy's reader should have correct rootProperty which is common parent of both coordinates and business_p. For that your response should be wrapped into a top level tag like this
{
"featureResponse": [
{
"type": "FeatureCollection",
"features": []
},
{
"type": "Feature",
"features": []
},
]
}
Then you can define reader like this:
reader: {
type: 'json',
rootProperty: 'featureResponse'
}
once you get record from this store, you can go to data or raw children object to fetch required data.