<?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 Re: GeoJson with a FeatureCollection including Features of different geometry types in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/geojson-with-a-featurecollection-including/m-p/1396318#M6983</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/687453"&gt;@ToddRunstein&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;The information you found on the ArcGIS Pro documentation page is also documented in our ArcGIS Maps SDK for JavaScript GeoJSONLayer class:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#limits" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#limits&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Each GeoJSONLayer will only accept one geometry type. If there are multiple types of geometries, only the type specified in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#geometryType" target="_blank"&gt;geometryType&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;will be loaded. If&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#geometryType" target="_blank"&gt;geometryType&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is not specified, it will default to the geometry type of the first geometry.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This limitation will be the same for Map Viewer since it uses this GeoJSONLayer class to create GeoJSON layers. If you want to have multiple geometry types using GeoJSON, you would have to create separate layers for each geometry type.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 21:17:16 GMT</pubDate>
    <dc:creator>LaurenBoyd</dc:creator>
    <dc:date>2024-03-14T21:17:16Z</dc:date>
    <item>
      <title>GeoJson with a FeatureCollection including Features of different geometry types</title>
      <link>https://community.esri.com/t5/developers-questions/geojson-with-a-featurecollection-including/m-p/1396103#M6980</link>
      <description>&lt;P&gt;I'm trying to understand whether the following GeoJSON is invalid, needs to be reconfigured, or if I'm fighting a losing battle. I have a service that returns a FeatureCollection with 3 Features, each with a different geometry type. When I load this into the &lt;A href="https://www.arcgis.com/apps/mapviewer/index.html" target="_self"&gt;MapViewer&lt;/A&gt;, only the Features matching the first type are displayed. In this case, it's just one Polygon, but if there were other Polygons in the payload, they would show up, but LineStrings and Points would not. Based on &lt;A href="https://community.esri.com/t5/arcgis-online-questions/feature-layers-with-multiple-geometry-types/m-p/1258328#M50357" target="_self"&gt;another post&lt;/A&gt;, I'm thinking this is just how the ArcGIS tools are designed to work, though I'm gonna have a heck of a time convincing my colleagues of this based on one post in a forum. Am I trying to achieve something (putting multiple geometry types in a single GeoJSON payload) that's bound to fail? If so, is there any documentation around this? Any insight would be most appreciated.&lt;/P&gt;&lt;P&gt;Here's an example of what the service returns:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "type": "FeatureCollection",
  "features": [ 
    {
      "type": "Feature",
      "properties": {
        "_status": "grey",
        "_title": "mid",
        "_server_updated_at": "2024-03-14T16:49:08.565Z",
        "updated_by_name": "Fred Flintstone",
        "a_text_field": "mid",
        "marker-color": "#B3B3B3"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [ -81.66371706436922, 40.71829817504227 ],
            [ -81.06224242161565, 39.31625234224697 ],
            [ -80.26034775685123, 40.93560245921894 ],
            [ -81.66371706436922, 40.71829817504227 ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "_status": "grey",
        "_title": "long mid",
        "_server_updated_at": "2023-12-06T18:50:26.849Z",
        "updated_by_name": "Wilma Flintstone",
        "a_text_field": "long mid",
        "marker-color": "#B3B3B3"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [ -80.25972907881545, 43.42321525687475 ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "_status": "grey",
        "_title": "abc",
        "_server_updated_at": "2023-11-15T17:49:59.679Z",
        "updated_by_name": "Fred Flintstone",
        "a_text_field": "abc",
        "marker-color": "#B3B3B3"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [ -77.57057954205416, 40.614879553515614 ],
          [ -76.89765822721861, 39.74043573381558 ],
          [ -77.36075502468489, 39.58287875921611 ]
        ]
      }
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 17:16:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/geojson-with-a-featurecollection-including/m-p/1396103#M6980</guid>
      <dc:creator>ToddRunstein</dc:creator>
      <dc:date>2024-03-14T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: GeoJson with a FeatureCollection including Features of different geometry types</title>
      <link>https://community.esri.com/t5/developers-questions/geojson-with-a-featurecollection-including/m-p/1396215#M6982</link>
      <description>&lt;P&gt;Well, I'm not sure whether the Map Viewer is using ArcGIS Pro tools, but if it is, I think I found the documentation I was looking for:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/conversion/json-to-features.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/conversion/json-to-features.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This tool "Converts feature collections in an Esri JSON formatted file (.json) or a GeoJSON formatted file (.geojson) to a feature class"&lt;SPAN&gt; and "specifies that &lt;/SPAN&gt;a feature class must be composed of features of the same feature type"&lt;SPAN&gt;. Finally, it says "&lt;/SPAN&gt;When the input is a .geojson file, the attributes of the first record are used to define the schema of the output feature class".&lt;/P&gt;&lt;P&gt;That definitely describes the behavior I'm seeing. Unfortunately, I think that means returning GeoJSON is never going to work, at least, not with more than one geometry type.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 18:41:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/geojson-with-a-featurecollection-including/m-p/1396215#M6982</guid>
      <dc:creator>ToddRunstein</dc:creator>
      <dc:date>2024-03-14T18:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: GeoJson with a FeatureCollection including Features of different geometry types</title>
      <link>https://community.esri.com/t5/developers-questions/geojson-with-a-featurecollection-including/m-p/1396318#M6983</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/687453"&gt;@ToddRunstein&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;The information you found on the ArcGIS Pro documentation page is also documented in our ArcGIS Maps SDK for JavaScript GeoJSONLayer class:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#limits" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#limits&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Each GeoJSONLayer will only accept one geometry type. If there are multiple types of geometries, only the type specified in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#geometryType" target="_blank"&gt;geometryType&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;will be loaded. If&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#geometryType" target="_blank"&gt;geometryType&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is not specified, it will default to the geometry type of the first geometry.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This limitation will be the same for Map Viewer since it uses this GeoJSONLayer class to create GeoJSON layers. If you want to have multiple geometry types using GeoJSON, you would have to create separate layers for each geometry type.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 21:17:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/geojson-with-a-featurecollection-including/m-p/1396318#M6983</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2024-03-14T21:17:16Z</dc:date>
    </item>
  </channel>
</rss>

