<?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: Deleting features using 'where' clause? in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1192177#M2595</link>
    <description>&lt;P&gt;The service I'm using to delete features is this one&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you can get me a reproducer I can take a closer look at your code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For info, I was working on a Mac using 100.14.1.&amp;nbsp; The fact that you are using Linux shouldn't make any difference.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 12:50:47 GMT</pubDate>
    <dc:creator>MarkBaird</dc:creator>
    <dc:date>2022-07-14T12:50:47Z</dc:date>
    <item>
      <title>Deleting features using 'where' clause?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191525#M2589</link>
      <description>&lt;P&gt;By looking at REST API docs for &lt;FONT face="courier new,courier"&gt;/deleteFeature&lt;/FONT&gt; here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/delete-features.htm" target="_self"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/delete-features.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems that deletes can be performed in multiple ways:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;by giving &lt;FONT face="courier new,courier"&gt;objectid&lt;/FONT&gt;(s) of feature(s) to delete&lt;/LI&gt;&lt;LI&gt;by specifying geometry to overlap/intersect features to delete with&lt;/LI&gt;&lt;LI&gt;by specifying SQL-like 'where' clause which will select features to delete&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;However, by looking at &lt;A href="https://developers.arcgis.com/java/api-reference/reference/com/esri/arcgisruntime/data/FeatureTable.html#deleteFeatureAsync(com.esri.arcgisruntime.data.Feature)" target="_self"&gt;Javadocs&lt;/A&gt;, it seems that ArcGIS Runtime for Java supports only first method using &lt;FONT face="courier new,courier"&gt;deleteFeature(s)Async&lt;/FONT&gt; on&amp;nbsp;&lt;FONT face="courier new,courier"&gt;FeatureTable&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;Are 2 and 3 unsupported or am I missing something?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 14:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191525#M2589</guid>
      <dc:creator>gkresic</dc:creator>
      <dc:date>2022-07-12T14:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting features using 'where' clause?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191565#M2590</link>
      <description>&lt;P&gt;I can see you've posted a couple of similar editing and delete questions so I'll use this thread to hopefully help with your issue.&lt;/P&gt;&lt;P&gt;The Java API isn't aiming to be a 1:1 mapping of the REST api, although as you've seen we use it in the background.&amp;nbsp; The Java API has been designed to make editing workflows on desktop based applications easy.&lt;/P&gt;&lt;P&gt;All the things you list above are possible, but rather than me trying to make a comparison with the REST and and Java it may be more useful if you were to explain what you are trying to achieve.&lt;/P&gt;&lt;P&gt;Remember that the Java API is intended for writing desktop (JavaFX) applications and isn't intended for writing server side components like microservices.&lt;/P&gt;&lt;P&gt;There are lots of sample apps in &lt;A href="https://github.com/Esri/arcgis-runtime-samples-java" target="_self"&gt;github&lt;/A&gt; which may help you including this one which shows you how to &lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/main/editing/delete-features" target="_self"&gt;select and delete features&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;If the samples don't help then if you explain your application a little more I can point you in the right direction.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 14:54:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191565#M2590</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2022-07-12T14:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting features using 'where' clause?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191835#M2592</link>
      <description>&lt;P&gt;Well, I'm simply trying to delete features from hosted layer table - that should be a basic operation unrelated to type of application, don't you agree?&lt;/P&gt;&lt;P&gt;So far, I didn't find any way to do it using ArcGIS Java lib. &lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/main/editing/delete-features" target="_self"&gt;Provided example&lt;/A&gt; queries for features and then deletes them using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ServiceFeatureTable.deleteFeaturesAsync(Iterable&amp;lt;Feature&amp;gt;)&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;ServiceGeodatabase.applyEditsAsync()&lt;/FONT&gt;, but like I explained in &lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-java-questions/bug-in-delete-part-of-applyedits/m-p/1191517" target="_self"&gt;another post&lt;/A&gt;, that approach doesn't work for me, since&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ServiceGeodatabase.applyEditsAsync()&lt;/FONT&gt; throws an error (probably due to wrong serialization of parameters during API invocation, but I'm not sure).&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 11:29:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191835#M2592</guid>
      <dc:creator>gkresic</dc:creator>
      <dc:date>2022-07-13T11:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting features using 'where' clause?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191945#M2593</link>
      <description>&lt;P&gt;The reason I'm asking what kind of application you are writing is to make sure you are not investing time in a project which can't be licensed.&amp;nbsp; If you are writing a desktop JavaFX application this is fine, but if you are writing a server side component such as a micro-service then is isn't covered in the license agreement for the ArcGIS Runtime Product and the advice I give needs to be different.&lt;/P&gt;&lt;P&gt;The API can delete features from a hosted feature service.&amp;nbsp; For example, I tried it as follows using the objectid of a feature in a service.&amp;nbsp; Starting by getting the feature using a where clause:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;            // query parameters to get a specific feature
            QueryParameters queryParameters = new QueryParameters();
            queryParameters.setWhereClause("objectid=1594564");

            // get a quest result containing the feature to be deleted.
            var resultFuture = featureTable.queryFeaturesAsync(queryParameters);
            FeatureQueryResult selected = resultFuture.get();&lt;/LI-CODE&gt;&lt;P&gt;Then I deleted it using the same techniques used in the sample.&lt;/P&gt;&lt;P&gt;If you explain exactly what you are doing and maybe share some code I can give you some more pointers.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 16:05:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191945#M2593</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2022-07-13T16:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting features using 'where' clause?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191969#M2594</link>
      <description>&lt;P&gt;This was exactly my approach, but calling either &lt;FONT face="courier new,courier"&gt;ServiceFeatureTable.applyEditsAsync()&lt;/FONT&gt; or&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ServiceGeodatabase.applyEditsAsync()&lt;/FONT&gt; after (successful)&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ServiceFeatureTable.deleteFeaturesAsync(Iterable&amp;lt;Feature&amp;gt;)&lt;/FONT&gt; resulted in 'Object ID '885192' is not valid.'.&lt;/P&gt;&lt;P&gt;Which version or ArcGIS Runtime and on which OS did you test?&lt;/P&gt;&lt;P&gt;Regarding app type, I current don't have any - I'm just experimenting what is possible with this Java lib. I'll try to put up something reproducible.&lt;/P&gt;&lt;P&gt;BTW, we digressed into problem I described in &lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-java-questions/bug-in-delete-part-of-applyedits/m-p/1191517" target="_self"&gt;previous post&lt;/A&gt;, so maybe it would be cleaner if we continue over there?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 16:49:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1191969#M2594</guid>
      <dc:creator>gkresic</dc:creator>
      <dc:date>2022-07-13T16:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting features using 'where' clause?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1192177#M2595</link>
      <description>&lt;P&gt;The service I'm using to delete features is this one&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you can get me a reproducer I can take a closer look at your code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For info, I was working on a Mac using 100.14.1.&amp;nbsp; The fact that you are using Linux shouldn't make any difference.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 12:50:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/deleting-features-using-where-clause/m-p/1192177#M2595</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2022-07-14T12:50:47Z</dc:date>
    </item>
  </channel>
</rss>

