<?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 ESRI LEaflet - Adding ESRI GeoJSON / MultiPart Polygons to a REST service in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/esri-leaflet-adding-esri-geojson-multipart/m-p/1027591#M5767</link>
    <description>&lt;P&gt;I'm currently allowing users to draw into an ESRI-Leaflet map using a drawing layer, adding some additional properties to that layer, and then submitting the results to a feature service.&lt;/P&gt;&lt;P&gt;This is great for single polygons. The methodology, however, doesn't work for multipart (multipolygon) polygons, or mixed feature types in a FeatureCollection. I specifically wish to submit multipart polygons rather than iterating through available features. There are some follow on GIS functions that rely on them being multipart.&lt;/P&gt;&lt;P&gt;Below is a sampleset of how I'm currently dealing with things. Then, a concept of what I'm thinking regarding multipart.&lt;/P&gt;&lt;P&gt;My question is -&lt;BR /&gt;When using geojsonToArcGIS can I use the result with addFeature to have a multipart polygon added to the feature service?&lt;/P&gt;&lt;P&gt;Not only do I not know if this is a valid approach, I'm not sure if there might be a better way of approaching this. There's not much documentation or examples to work with online around adding multipart feature collections using ESRI Leaflet. &lt;A href="https://protigwelders.com/" target="_self"&gt;protigwelders&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Currently using:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var feature = {&lt;BR /&gt;type: 'Feature',&lt;BR /&gt;geometry: Geometry,&lt;BR /&gt;properties: {&lt;BR /&gt;LGA: String(lga),&lt;BR /&gt;Locality: String(locality),&lt;BR /&gt;Region: String(region),&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;service.addFeature(feature, function (error, response) {&lt;BR /&gt;if (error) {&lt;BR /&gt;console.log('error creating feature' + error.message);&lt;BR /&gt;} else {&lt;BR /&gt;console.log('Successfully created feature with id ' + response.objectId);&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;Rather than using the above, I'm wondering if it is possible to do something more along the lines of:&lt;/P&gt;&lt;P&gt;//We start with a drawing layer, ingested as drawngeo. Lets assume it has 3 polygons (or lines) at this point.&lt;BR /&gt;if (eventtype == "create") {&lt;BR /&gt;var drawngeo = drawnItems.toGeoJSON(); //This makes the JSON accessible&lt;BR /&gt;drawngeo.features[0].properties.TestKey = "Test"; //Add a custom property, for example.&lt;BR /&gt;var drawnesrijson = L.esri.Util.geojsonToArcGIS(drawngeo,"OBJECTID"); //Make it ESRI-JSON&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;service.addFeature(drawnesrijson, function (error, response) { //We have used the ESRI GeoJSON instead&lt;BR /&gt;if (error) {&lt;BR /&gt;console.log('error creating feature' + error.message);&lt;BR /&gt;} else {&lt;BR /&gt;console.log('Successfully created feature with id ' + response.objectId);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;In case this helps with people finding this in future, here are a few extra keywords: ArcGIS Online, AGOL, ESRI, ArcGIS Portal.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2021 12:31:19 GMT</pubDate>
    <dc:creator>annahernandez99</dc:creator>
    <dc:date>2021-02-18T12:31:19Z</dc:date>
    <item>
      <title>ESRI LEaflet - Adding ESRI GeoJSON / MultiPart Polygons to a REST service</title>
      <link>https://community.esri.com/t5/developers-questions/esri-leaflet-adding-esri-geojson-multipart/m-p/1027591#M5767</link>
      <description>&lt;P&gt;I'm currently allowing users to draw into an ESRI-Leaflet map using a drawing layer, adding some additional properties to that layer, and then submitting the results to a feature service.&lt;/P&gt;&lt;P&gt;This is great for single polygons. The methodology, however, doesn't work for multipart (multipolygon) polygons, or mixed feature types in a FeatureCollection. I specifically wish to submit multipart polygons rather than iterating through available features. There are some follow on GIS functions that rely on them being multipart.&lt;/P&gt;&lt;P&gt;Below is a sampleset of how I'm currently dealing with things. Then, a concept of what I'm thinking regarding multipart.&lt;/P&gt;&lt;P&gt;My question is -&lt;BR /&gt;When using geojsonToArcGIS can I use the result with addFeature to have a multipart polygon added to the feature service?&lt;/P&gt;&lt;P&gt;Not only do I not know if this is a valid approach, I'm not sure if there might be a better way of approaching this. There's not much documentation or examples to work with online around adding multipart feature collections using ESRI Leaflet. &lt;A href="https://protigwelders.com/" target="_self"&gt;protigwelders&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Currently using:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var feature = {&lt;BR /&gt;type: 'Feature',&lt;BR /&gt;geometry: Geometry,&lt;BR /&gt;properties: {&lt;BR /&gt;LGA: String(lga),&lt;BR /&gt;Locality: String(locality),&lt;BR /&gt;Region: String(region),&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;service.addFeature(feature, function (error, response) {&lt;BR /&gt;if (error) {&lt;BR /&gt;console.log('error creating feature' + error.message);&lt;BR /&gt;} else {&lt;BR /&gt;console.log('Successfully created feature with id ' + response.objectId);&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;Rather than using the above, I'm wondering if it is possible to do something more along the lines of:&lt;/P&gt;&lt;P&gt;//We start with a drawing layer, ingested as drawngeo. Lets assume it has 3 polygons (or lines) at this point.&lt;BR /&gt;if (eventtype == "create") {&lt;BR /&gt;var drawngeo = drawnItems.toGeoJSON(); //This makes the JSON accessible&lt;BR /&gt;drawngeo.features[0].properties.TestKey = "Test"; //Add a custom property, for example.&lt;BR /&gt;var drawnesrijson = L.esri.Util.geojsonToArcGIS(drawngeo,"OBJECTID"); //Make it ESRI-JSON&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;service.addFeature(drawnesrijson, function (error, response) { //We have used the ESRI GeoJSON instead&lt;BR /&gt;if (error) {&lt;BR /&gt;console.log('error creating feature' + error.message);&lt;BR /&gt;} else {&lt;BR /&gt;console.log('Successfully created feature with id ' + response.objectId);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;In case this helps with people finding this in future, here are a few extra keywords: ArcGIS Online, AGOL, ESRI, ArcGIS Portal.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 12:31:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/esri-leaflet-adding-esri-geojson-multipart/m-p/1027591#M5767</guid>
      <dc:creator>annahernandez99</dc:creator>
      <dc:date>2021-02-18T12:31:19Z</dc:date>
    </item>
  </channel>
</rss>

