<?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: Creating hosted FeatureLayer over 10mb - REST or PYTHON API? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-hosted-featurelayer-over-10mb-rest-or/m-p/1040032#M5791</link>
    <description>&lt;P&gt;I won't publish 2GB data in one go from the client (ArcGIS Pro / ArcMap).&lt;/P&gt;&lt;P&gt;Instead, publish an empty service first, then populate the service. there are two options:&lt;/P&gt;&lt;P&gt;1. Use edit_features function to add data in batches (batch size depends on the data, use smaller size if complicated polygon)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# get the features you are going to add
features = fset_add.features

# divide the features into batches, 100 for example. The batch size depends 
# on the size of the record (paritcularly the geometry)
num = int(len(features)/100)
remain = len(features)%100
print(f'num:{num} remain:{remain}')

for i in range(num):
    pos_start = i*100
    part = features[pos_start:pos_start+100]
    result = feature_layer.edit_features(adds=part)
    print(f"start at:{pos_start}, and the length of the list is:{len(part)}, {len(result['addResults'])} records added!")
if (remain&amp;gt;0):
    pos_start = num*100
    part = features[num*100:]
    result = feature_layer.edit_features(adds=part)
    print(f"start at:{pos_start}, and the length of the list is:{len(part)}, {len(result['addResults'])} records added!")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. You can try if you can create a FGDB and upload it to your portal, and use append the service. I had success to append near 1 million records (points)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;itemId = "xxxxxb4cxxxx2eb7xxxxxxxx"
FL_Property_pnt.append(item_id=itemId,upload_format="filegdb",source_table_name="Property_Pnt")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2021 05:11:34 GMT</pubDate>
    <dc:creator>simoxu</dc:creator>
    <dc:date>2021-03-24T05:11:34Z</dc:date>
    <item>
      <title>Creating hosted FeatureLayer over 10mb - REST or PYTHON API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-hosted-featurelayer-over-10mb-rest-or/m-p/1039675#M5787</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a fairly large layer (about 2gb) that I am propagating through Databricks using ArcGIS API for Python.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;There seems to be a limit on these to 10mb, but also, that you can also do this via the REST API as parts.&amp;nbsp; I can't find anything anywhere that documents this.&lt;BR /&gt;&lt;BR /&gt;Does anyone have any suggestions how to do this?&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 08:16:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-hosted-featurelayer-over-10mb-rest-or/m-p/1039675#M5787</guid>
      <dc:creator>PaulHallett1305</dc:creator>
      <dc:date>2021-03-23T08:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating hosted FeatureLayer over 10mb - REST or PYTHON API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-hosted-featurelayer-over-10mb-rest-or/m-p/1040032#M5791</link>
      <description>&lt;P&gt;I won't publish 2GB data in one go from the client (ArcGIS Pro / ArcMap).&lt;/P&gt;&lt;P&gt;Instead, publish an empty service first, then populate the service. there are two options:&lt;/P&gt;&lt;P&gt;1. Use edit_features function to add data in batches (batch size depends on the data, use smaller size if complicated polygon)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# get the features you are going to add
features = fset_add.features

# divide the features into batches, 100 for example. The batch size depends 
# on the size of the record (paritcularly the geometry)
num = int(len(features)/100)
remain = len(features)%100
print(f'num:{num} remain:{remain}')

for i in range(num):
    pos_start = i*100
    part = features[pos_start:pos_start+100]
    result = feature_layer.edit_features(adds=part)
    print(f"start at:{pos_start}, and the length of the list is:{len(part)}, {len(result['addResults'])} records added!")
if (remain&amp;gt;0):
    pos_start = num*100
    part = features[num*100:]
    result = feature_layer.edit_features(adds=part)
    print(f"start at:{pos_start}, and the length of the list is:{len(part)}, {len(result['addResults'])} records added!")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. You can try if you can create a FGDB and upload it to your portal, and use append the service. I had success to append near 1 million records (points)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;itemId = "xxxxxb4cxxxx2eb7xxxxxxxx"
FL_Property_pnt.append(item_id=itemId,upload_format="filegdb",source_table_name="Property_Pnt")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 05:11:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-hosted-featurelayer-over-10mb-rest-or/m-p/1040032#M5791</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-03-24T05:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating hosted FeatureLayer over 10mb - REST or PYTHON API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-hosted-featurelayer-over-10mb-rest-or/m-p/1040059#M5794</link>
      <description>&lt;P&gt;Thanks for this; I did think about creating an empty map service then adding data; the polygons themselves are quite simple, it's just that there are lots of them.&lt;BR /&gt;&lt;BR /&gt;I am working out of databricks and can't access ArcPy from it, so I can't create a FileGDB unfortunately.&lt;BR /&gt;&lt;BR /&gt;The other option was going to try, was to create a SEDF, create a Shape file from that, zip it up, then publish a featureclass from that.&lt;BR /&gt;&lt;BR /&gt;Thanks for the ideas, will have a go at this today.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 08:11:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-hosted-featurelayer-over-10mb-rest-or/m-p/1040059#M5794</guid>
      <dc:creator>PaulHallett1305</dc:creator>
      <dc:date>2021-03-24T08:11:15Z</dc:date>
    </item>
  </channel>
</rss>

