<?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: Is it possible to create a feature set from feature service objects selected by an area of interest? in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151352#M705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;UNCLASSIFIED&lt;/P&gt;&lt;P&gt;Thanks for the reply, Freddie.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data are hosted as feature services. The Australian government may not be happy with server details. However, the identical data is publicly available from http://www.ntv.nntt.gov.au/intramaps/download/download.asp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ILUA_Nat has 1085 records&lt;/P&gt;&lt;P&gt;NTDA_Register_Nat has 271 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The process takes approx. 3 mins 48 secs to extract these 2 feature services to layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is some very basic code - apologies for the lack of commenting and general untidiness.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************&lt;/P&gt;&lt;P&gt;baseUrl = "http:///arcgis/rest/services/"+ service['name'] +"/FeatureServer/0/query"&lt;/P&gt;&lt;P&gt;        where = '1=1'&lt;/P&gt;&lt;P&gt;        fields = '*'&lt;/P&gt;&lt;P&gt;        query = "?where={}&amp;amp;outFields={}&amp;amp;returnGeometry=true&amp;amp;f=json&amp;amp;token={}".format(where, fields, token)&lt;/P&gt;&lt;P&gt;        fsURL = RestURL + query&lt;/P&gt;&lt;P&gt;        fs = arcpy.FeatureSet()&lt;/P&gt;&lt;P&gt;        fs.load(fsURL)&lt;/P&gt;&lt;P&gt;        lname = service['name']&lt;/P&gt;&lt;P&gt;        FeatureLayer = arcpy.MakeFeatureLayer_management(fs,lname[lname.find("/")+1:])&lt;/P&gt;&lt;P&gt;        NewLayer = arcpy.mapping.Layer(lname[lname.find("/")+1:])&lt;/P&gt;&lt;P&gt;        arcpy.mapping.AddLayer(df,NewLayer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The aim of this is ultimately to integrate feature services a into broader code that looks for and computes overlap statistics for a standard set of data, including the above. I am hoping to replace the current overlap and intersect processes with equivalent processes on the feature service side, but still provide detailed reports.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Sep 2015 04:15:19 GMT</pubDate>
    <dc:creator>RichardMacNeill1</dc:creator>
    <dc:date>2015-09-22T04:15:19Z</dc:date>
    <item>
      <title>Is it possible to create a feature set from feature service objects selected by an area of interest?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151347#M700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Can anyone out there help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm generating a feature set for display and analysis in ArcGIS 10.2.2 from a large ESRI feature class and have written python code to achieve this based on the standard source URL and query of the kind:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RestURL = "&lt;A href="http://per-arc.nntt.gov.au/arcgis/rest/services/"&gt;&amp;lt;my URL&amp;gt;&lt;/A&gt;"+ service['name'] +"/FeatureServer/0/query"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where = '1=1'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields = '*'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query = "?where={}&amp;amp;outFields={}&amp;amp;returnGeometry=true&amp;amp;f=json&amp;amp;token={}".format(where, fields, token)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fsURL = RestURL + query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While this is working, the process is slow and I am only interested in a small set of these features. Is there any way an area of interest can be integrated into the query to access only a subset of these features?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice at this stage would be really helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 05:54:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151347#M700</guid>
      <dc:creator>RichardMacNeill1</dc:creator>
      <dc:date>2015-09-21T05:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create a feature set from feature service objects selected by an area of interest?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151348#M701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried supplying a spatial filter in your REST call? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ArcGIS REST API: Query (Feature Service/Layer)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000r1000000" title="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000r1000000"&gt;http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000r1000000&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="2015-09-21_0947.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/127736_2015-09-21_0947.png" style="width: 620px; height: 336px;" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 16:49:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151348#M701</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-09-21T16:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create a feature set from feature service objects selected by an area of interest?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151349#M702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unofficial&lt;/P&gt;&lt;P&gt;Thanks Freddie. I'll follow up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 22:09:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151349#M702</guid>
      <dc:creator>RichardMacNeill1</dc:creator>
      <dc:date>2015-09-21T22:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create a feature set from feature service objects selected by an area of interest?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151350#M703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;UNCLASSIFIED&lt;/P&gt;&lt;P&gt;Thanks Freddie for your suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To give you more background, I'm new to this, am filling in the gaps,  and have developed the following code to retrieve the total feature service content:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RestURL = "http:///arcgis/rest/services/"+ "richard/ILUA_nat_svc" +"/FeatureServer/0/query"&lt;/P&gt;&lt;P&gt;where = '1=1'&lt;/P&gt;&lt;P&gt;fields = '*'&lt;/P&gt;&lt;P&gt;query = "?where={}&amp;amp;outFields={}&amp;amp;returnGeometry=true&amp;amp;f=json&amp;amp;token={}".format(where, fields, token)&lt;/P&gt;&lt;P&gt;fsURL = RestURL + query&lt;/P&gt;&lt;P&gt;fs = arcpy.FeatureSet()&lt;/P&gt;&lt;P&gt;fs.load(fsURL)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works fine but its slow speed makes it impractical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I note the parameters in an approach similar to your suggestion, providing an overlay JSON string - fGeom:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;params = urllib.urlencode({'f': 'json', 'geometryType': 'esriGeometryPolygon',&lt;/P&gt;&lt;P&gt;           'geometry': fGeom, 'spatialRel': 'esriSpatialRelIntersects',&lt;/P&gt;&lt;P&gt;           'where': '1=1', 'outFields': '', 'returnGeometry': 'true'})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;req = urllib2.Request(RestURL,params)&lt;/P&gt;&lt;P&gt;response = urllib2.urlopen(req,"?f=json&amp;amp;token=" + token)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason this request fails. I'm also not sure if there is any variation on how to load the results of this (should I ever get it to work).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 01:37:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151350#M703</guid>
      <dc:creator>RichardMacNeill1</dc:creator>
      <dc:date>2015-09-22T01:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create a feature set from feature service objects selected by an area of interest?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151351#M704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where do you have the data hosted? What is the speed you're seeing to execute the query? And could you either provide a sample of your data to test against or describe it enough so that I can create similar data on my end?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 02:59:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151351#M704</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2015-09-22T02:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create a feature set from feature service objects selected by an area of interest?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151352#M705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;UNCLASSIFIED&lt;/P&gt;&lt;P&gt;Thanks for the reply, Freddie.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data are hosted as feature services. The Australian government may not be happy with server details. However, the identical data is publicly available from http://www.ntv.nntt.gov.au/intramaps/download/download.asp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ILUA_Nat has 1085 records&lt;/P&gt;&lt;P&gt;NTDA_Register_Nat has 271 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The process takes approx. 3 mins 48 secs to extract these 2 feature services to layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is some very basic code - apologies for the lack of commenting and general untidiness.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************************&lt;/P&gt;&lt;P&gt;baseUrl = "http:///arcgis/rest/services/"+ service['name'] +"/FeatureServer/0/query"&lt;/P&gt;&lt;P&gt;        where = '1=1'&lt;/P&gt;&lt;P&gt;        fields = '*'&lt;/P&gt;&lt;P&gt;        query = "?where={}&amp;amp;outFields={}&amp;amp;returnGeometry=true&amp;amp;f=json&amp;amp;token={}".format(where, fields, token)&lt;/P&gt;&lt;P&gt;        fsURL = RestURL + query&lt;/P&gt;&lt;P&gt;        fs = arcpy.FeatureSet()&lt;/P&gt;&lt;P&gt;        fs.load(fsURL)&lt;/P&gt;&lt;P&gt;        lname = service['name']&lt;/P&gt;&lt;P&gt;        FeatureLayer = arcpy.MakeFeatureLayer_management(fs,lname[lname.find("/")+1:])&lt;/P&gt;&lt;P&gt;        NewLayer = arcpy.mapping.Layer(lname[lname.find("/")+1:])&lt;/P&gt;&lt;P&gt;        arcpy.mapping.AddLayer(df,NewLayer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The aim of this is ultimately to integrate feature services a into broader code that looks for and computes overlap statistics for a standard set of data, including the above. I am hoping to replace the current overlap and intersect processes with equivalent processes on the feature service side, but still provide detailed reports.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 04:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/is-it-possible-to-create-a-feature-set-from/m-p/151352#M705</guid>
      <dc:creator>RichardMacNeill1</dc:creator>
      <dc:date>2015-09-22T04:15:19Z</dc:date>
    </item>
  </channel>
</rss>

