<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic GeoEvent Server - parsing many cardinality for array of coordinates to create geometry in ArcGIS GeoEvent Server Questions</title>
    <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/geoevent-server-parsing-many-cardinality-for-array/m-p/465739#M2052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with the JSON below.&amp;nbsp; I would like to use data.last_known_position.geometry.coordinates as my X and Y.&amp;nbsp; The goal is to send the JSON to a stream service.&amp;nbsp; I am using the connector poll and external website for JSON.&amp;nbsp; I have referenced this thread here &lt;A href="https://community.esri.com/thread/229673" target="_blank"&gt;Parse JSON location data from array&lt;/A&gt;&amp;nbsp;, to no avail.&amp;nbsp; My logs indicate that the fields&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;data.last_known_position.geometry.coordinates[0]&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;data.last_known_position.geometry.coordinates[1]&lt;/STRONG&gt;&amp;nbsp;do no exist which would construct the geometry.&amp;nbsp; When I select "Create a GeoEvent Definition"&amp;nbsp;for my input, the definition that is created contains many cardinality for the coordinates array. How can I get the values from&amp;nbsp;&lt;STRONG&gt;data.last_known_position.geometry.coordinates&amp;nbsp;&lt;/STRONG&gt;to create my geometry?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
"paging": {
"limit":&amp;nbsp;100,
"total":&amp;nbsp;292453,
"next":&amp;nbsp;"dGltZT0xNTAyNTc5MzE1Ljc4ODA4LGlkPTA4MGRkYTM2LWU1MTktNDExNC1iZGRmLTJiNGM2ODk3YWRhMw=="
},
"data": [
{
"id":&amp;nbsp;"b2c2626d-ff0b-4892-8262-5acae60946a4",
"name":&amp;nbsp;"JUPITER II",
"mmsi":&amp;nbsp;701000533,
"imo":&amp;nbsp;9123726,
"call_sign":&amp;nbsp;"LW 9897",
"ship_type":&amp;nbsp;"Fishing",
"class":&amp;nbsp;"A",
"flag":&amp;nbsp;"AR",
"length":&amp;nbsp;27,
"width":&amp;nbsp;7,
"ais_version":&amp;nbsp;0,
"created_at":&amp;nbsp;"2017-08-11T19:35:18.200135+00:00",
"updated_at":&amp;nbsp;"2018-07-02T18:04:11.279030+00:00",
"last_known_position": {
"timestamp":&amp;nbsp;"2018-07-02T14:57:58+00:00",
"geometry": {
"type":&amp;nbsp;"Point",
"coordinates": [
-&amp;nbsp;62.82619,
-&amp;nbsp;45.29533
]
},
"heading":&amp;nbsp;511,
"speed":&amp;nbsp;4.3,
"rot":&amp;nbsp;-&amp;nbsp;128,
"accuracy":&amp;nbsp;null,
"collection_type":&amp;nbsp;"satellite",
"draught":&amp;nbsp;null,
"maneuver":&amp;nbsp;0,
"course":&amp;nbsp;154.6
},
"most_recent_voyage": {
"eta":&amp;nbsp;"2019-06-12T17:00:00+00:00",
"destination":&amp;nbsp;"MAR DEL PLATA"
},
"predicted_position": {
"timestamp":&amp;nbsp;"2018-07-02T17:51:06+00:00",
"geometry": {
"type":&amp;nbsp;"Point",
"coordinates": [
-&amp;nbsp;62.7929417229,
-&amp;nbsp;44.9985799193
]
},
"speed":&amp;nbsp;6.2,
"course":&amp;nbsp;5.3,
"confidence_radius":&amp;nbsp;34.3429
},
"general_classification":&amp;nbsp;"Fishing Industry",
"individual_classification":&amp;nbsp;"Fishing Vessel",
"gross_tonnage":&amp;nbsp;"148",
"lifeboats":&amp;nbsp;null,
"person_capacity":&amp;nbsp;8,
"navigational_status":&amp;nbsp;"Moored"
}
]
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="502626" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/502626_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="502627" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/502627_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="502628" class="image-3 jive-image" height="299" src="https://community.esri.com/legacyfs/online/502628_pastedImage_8.png" width="400" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:40:06 GMT</pubDate>
    <dc:creator>GeoffreyWest</dc:creator>
    <dc:date>2021-12-11T20:40:06Z</dc:date>
    <item>
      <title>GeoEvent Server - parsing many cardinality for array of coordinates to create geometry</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/geoevent-server-parsing-many-cardinality-for-array/m-p/465739#M2052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with the JSON below.&amp;nbsp; I would like to use data.last_known_position.geometry.coordinates as my X and Y.&amp;nbsp; The goal is to send the JSON to a stream service.&amp;nbsp; I am using the connector poll and external website for JSON.&amp;nbsp; I have referenced this thread here &lt;A href="https://community.esri.com/thread/229673" target="_blank"&gt;Parse JSON location data from array&lt;/A&gt;&amp;nbsp;, to no avail.&amp;nbsp; My logs indicate that the fields&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;data.last_known_position.geometry.coordinates[0]&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;data.last_known_position.geometry.coordinates[1]&lt;/STRONG&gt;&amp;nbsp;do no exist which would construct the geometry.&amp;nbsp; When I select "Create a GeoEvent Definition"&amp;nbsp;for my input, the definition that is created contains many cardinality for the coordinates array. How can I get the values from&amp;nbsp;&lt;STRONG&gt;data.last_known_position.geometry.coordinates&amp;nbsp;&lt;/STRONG&gt;to create my geometry?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
"paging": {
"limit":&amp;nbsp;100,
"total":&amp;nbsp;292453,
"next":&amp;nbsp;"dGltZT0xNTAyNTc5MzE1Ljc4ODA4LGlkPTA4MGRkYTM2LWU1MTktNDExNC1iZGRmLTJiNGM2ODk3YWRhMw=="
},
"data": [
{
"id":&amp;nbsp;"b2c2626d-ff0b-4892-8262-5acae60946a4",
"name":&amp;nbsp;"JUPITER II",
"mmsi":&amp;nbsp;701000533,
"imo":&amp;nbsp;9123726,
"call_sign":&amp;nbsp;"LW 9897",
"ship_type":&amp;nbsp;"Fishing",
"class":&amp;nbsp;"A",
"flag":&amp;nbsp;"AR",
"length":&amp;nbsp;27,
"width":&amp;nbsp;7,
"ais_version":&amp;nbsp;0,
"created_at":&amp;nbsp;"2017-08-11T19:35:18.200135+00:00",
"updated_at":&amp;nbsp;"2018-07-02T18:04:11.279030+00:00",
"last_known_position": {
"timestamp":&amp;nbsp;"2018-07-02T14:57:58+00:00",
"geometry": {
"type":&amp;nbsp;"Point",
"coordinates": [
-&amp;nbsp;62.82619,
-&amp;nbsp;45.29533
]
},
"heading":&amp;nbsp;511,
"speed":&amp;nbsp;4.3,
"rot":&amp;nbsp;-&amp;nbsp;128,
"accuracy":&amp;nbsp;null,
"collection_type":&amp;nbsp;"satellite",
"draught":&amp;nbsp;null,
"maneuver":&amp;nbsp;0,
"course":&amp;nbsp;154.6
},
"most_recent_voyage": {
"eta":&amp;nbsp;"2019-06-12T17:00:00+00:00",
"destination":&amp;nbsp;"MAR DEL PLATA"
},
"predicted_position": {
"timestamp":&amp;nbsp;"2018-07-02T17:51:06+00:00",
"geometry": {
"type":&amp;nbsp;"Point",
"coordinates": [
-&amp;nbsp;62.7929417229,
-&amp;nbsp;44.9985799193
]
},
"speed":&amp;nbsp;6.2,
"course":&amp;nbsp;5.3,
"confidence_radius":&amp;nbsp;34.3429
},
"general_classification":&amp;nbsp;"Fishing Industry",
"individual_classification":&amp;nbsp;"Fishing Vessel",
"gross_tonnage":&amp;nbsp;"148",
"lifeboats":&amp;nbsp;null,
"person_capacity":&amp;nbsp;8,
"navigational_status":&amp;nbsp;"Moored"
}
]
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="502626" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/502626_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="502627" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/502627_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="502628" class="image-3 jive-image" height="299" src="https://community.esri.com/legacyfs/online/502628_pastedImage_8.png" width="400" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:40:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/geoevent-server-parsing-many-cardinality-for-array/m-p/465739#M2052</guid>
      <dc:creator>GeoffreyWest</dc:creator>
      <dc:date>2021-12-11T20:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: GeoEvent Server - parsing many cardinality for array of coordinates to create geometry</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/geoevent-server-parsing-many-cardinality-for-array/m-p/465740#M2053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/69628" target="_blank"&gt;Geoffrey West&lt;/A&gt; –&lt;/P&gt;&lt;DIV style="font-family: sans-serif; color: #3d3d3d; font-size: 11.5pt;"&gt;&lt;P style="margin: 8.0pt 0in 8.0pt 0in;"&gt;Looking at the JSON you illustrated it looks to me like the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/EM&gt; object is an array of JSON objects:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"data"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"id"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"b2c2626d-ff0b-4892-8262-5acae60946a4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"name"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"JUPITER II"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"mmsi"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;701000533&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin: 8.0pt 0in 8.0pt 0in;"&gt;You probably need to add an index into your hierarchy parsing string to change&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;data.last_known_position.geometry.coordinates[0]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 8.0pt 0in 8.0pt 0in;"&gt;to&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;data&lt;SPAN style="color: #ff0000;"&gt;[0]&lt;/SPAN&gt;.last_known_position.geometry.coordinates[0]&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV style="margin: 14.0pt 0in 8.0pt 0in; font-size: 11.5pt;"&gt;Also, I noticed that all of the negative double values seem to have an extra space between the '-' and the actual value. Quick experiments with GeoEvent Server seem to show that the extra white-space is being removed by the library used to parse the data ... I noticed &lt;A href="https://jsonlint.com" rel="nofollow noopener noreferrer" target="_blank"&gt;https://jsonlint.com&lt;/A&gt;&amp;nbsp;does the same thing ... but a different&amp;nbsp;validator I often use triggered on these values and refused to validate the JSON to show it in a tree with collapsible nodes.&amp;nbsp;&lt;/DIV&gt;&lt;P style="margin: 18.0pt 0in 8.0pt 0in;"&gt;Hope this information is helpful –&lt;/P&gt;&lt;P style="margin: 8.0pt 0in 8.0pt 0in;"&gt;RJ&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:40:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/geoevent-server-parsing-many-cardinality-for-array/m-p/465740#M2053</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2021-12-11T20:40:08Z</dc:date>
    </item>
  </channel>
</rss>

