<?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 Does AddFeatures endpoint accept WKT format in the geometry of each feature? in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/does-addfeatures-endpoint-accept-wkt-format-in-the/m-p/1165571#M4118</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Did anyone try to add features using the /rest/services/.../{layerid}/addFeatures endpoint and using WKT json input for the geometry?&lt;/P&gt;&lt;P&gt;I find the documentation quite ambiguous when it shows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For the Features parameter: "The structure of each feature in the array is the same as the structure of the &lt;A href="https://developers.arcgis.com/documentation/common-data-types/feature-object.htm" target="_blank" rel="noopener"&gt;json feature object&lt;/A&gt; returned by the ArcGIS REST API."&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;For the Geometry in &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/feature-object.htm" target="_blank" rel="noopener"&gt;json feature object&lt;/A&gt;&lt;SPAN class=""&gt;: geometry&lt;/SPAN&gt;—The feature geometry. It can be any of the supported geometry types. It is a JSON object as defined in the &lt;A href="https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm" target="_blank" rel="noopener"&gt;Geometry Objects&lt;/A&gt; documentation.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm" target="_blank" rel="noopener"&gt;Geometry Objects documentation&lt;/A&gt;: Appears the json WKT-based syntax as a valid syntax to represent geometries.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I tried in the add features web form the following input:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[{
    "wkt": "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",POINT[\"WGS_1984\",-79.419591,43.647131]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]",
    "attributes": {
      "ProductId": 10175
    }
}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see in the attached image, the endpoint ended with success adding a new item with objectid 3636.&lt;/P&gt;&lt;P&gt;But this is the result of the features query after the "creation". It seems to create an empty/invalid geometry storing only the attributes but no geometry information.:&lt;/P&gt;&lt;PRE&gt;{
 "objectIdFieldName": "OBJECTID",
 "globalIdFieldName": "",
 "geometryType": "esriGeometryPoint",
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "fields": [
  {
   "name": "ProductId",
   "alias": "ProductId",
   "type": "esriFieldTypeInteger"
  }
 ],
 "features": [
  {
   "attributes": {
    "ProductId": 10175
   }
  }
 ]
}&lt;/PRE&gt;&lt;P&gt;My doubts are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is WKT format allowed as geometry input format in this endpoint? In case it is not allowed, why did it end with success instead of a wrong geometry "input format/invalid geometry" message?&lt;/LI&gt;&lt;LI&gt;In the other hand, if it is because of a wrong input WKT json, I need to know how to create a valid WKT json for points and polygons (I could not find enough esri documentation or topics in this forum talking about the WKT format when querying/adding geometries)&lt;/LI&gt;&lt;LI&gt;Is there any way to obtain from the API query endpoint, the features within a layer with the geometry in WKT format? I can only see PBF, Json and GeoJson as output formats. In case I could query an existing valid geometry and get the geometry in WKT, maybe I could use it as input in the addfeatures web form and try it.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If I use the normal json geometry for a Point, it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[{
    "geometry": {
      "x": 12.474212758000021,
      "y": 45.662661214000025
    },  
    "attributes": {
      "ProductId": 10175
    }
}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 14:01:27 GMT</pubDate>
    <dc:creator>dbarriop2000</dc:creator>
    <dc:date>2022-04-19T14:01:27Z</dc:date>
    <item>
      <title>Does AddFeatures endpoint accept WKT format in the geometry of each feature?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/does-addfeatures-endpoint-accept-wkt-format-in-the/m-p/1165571#M4118</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Did anyone try to add features using the /rest/services/.../{layerid}/addFeatures endpoint and using WKT json input for the geometry?&lt;/P&gt;&lt;P&gt;I find the documentation quite ambiguous when it shows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For the Features parameter: "The structure of each feature in the array is the same as the structure of the &lt;A href="https://developers.arcgis.com/documentation/common-data-types/feature-object.htm" target="_blank" rel="noopener"&gt;json feature object&lt;/A&gt; returned by the ArcGIS REST API."&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;For the Geometry in &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/feature-object.htm" target="_blank" rel="noopener"&gt;json feature object&lt;/A&gt;&lt;SPAN class=""&gt;: geometry&lt;/SPAN&gt;—The feature geometry. It can be any of the supported geometry types. It is a JSON object as defined in the &lt;A href="https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm" target="_blank" rel="noopener"&gt;Geometry Objects&lt;/A&gt; documentation.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm" target="_blank" rel="noopener"&gt;Geometry Objects documentation&lt;/A&gt;: Appears the json WKT-based syntax as a valid syntax to represent geometries.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I tried in the add features web form the following input:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[{
    "wkt": "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",POINT[\"WGS_1984\",-79.419591,43.647131]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]",
    "attributes": {
      "ProductId": 10175
    }
}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see in the attached image, the endpoint ended with success adding a new item with objectid 3636.&lt;/P&gt;&lt;P&gt;But this is the result of the features query after the "creation". It seems to create an empty/invalid geometry storing only the attributes but no geometry information.:&lt;/P&gt;&lt;PRE&gt;{
 "objectIdFieldName": "OBJECTID",
 "globalIdFieldName": "",
 "geometryType": "esriGeometryPoint",
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "fields": [
  {
   "name": "ProductId",
   "alias": "ProductId",
   "type": "esriFieldTypeInteger"
  }
 ],
 "features": [
  {
   "attributes": {
    "ProductId": 10175
   }
  }
 ]
}&lt;/PRE&gt;&lt;P&gt;My doubts are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is WKT format allowed as geometry input format in this endpoint? In case it is not allowed, why did it end with success instead of a wrong geometry "input format/invalid geometry" message?&lt;/LI&gt;&lt;LI&gt;In the other hand, if it is because of a wrong input WKT json, I need to know how to create a valid WKT json for points and polygons (I could not find enough esri documentation or topics in this forum talking about the WKT format when querying/adding geometries)&lt;/LI&gt;&lt;LI&gt;Is there any way to obtain from the API query endpoint, the features within a layer with the geometry in WKT format? I can only see PBF, Json and GeoJson as output formats. In case I could query an existing valid geometry and get the geometry in WKT, maybe I could use it as input in the addfeatures web form and try it.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If I use the normal json geometry for a Point, it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[{
    "geometry": {
      "x": 12.474212758000021,
      "y": 45.662661214000025
    },  
    "attributes": {
      "ProductId": 10175
    }
}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 14:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/does-addfeatures-endpoint-accept-wkt-format-in-the/m-p/1165571#M4118</guid>
      <dc:creator>dbarriop2000</dc:creator>
      <dc:date>2022-04-19T14:01:27Z</dc:date>
    </item>
  </channel>
</rss>

