/generate: Generate

URL:
https://[root]/content/features/generate
Methods:
GET

Example usage

URL for Generate

Use dark colors for code blocksCopy
1
2
3
4
https://www.arcgis.com/sharing/rest/content/features/generate
item id=345313e619df46f387f9ededbe15ac56
type=csv
publishParameters=<publish parameters>

For a complete description of publishParameters, see Publish Item.

Description

The Generate call helps a client generate features from a CSV file, Shapefile, GPX, or GeoJSON file.

CSV files that contain location fields (either address fields or x,y fields) are spatially enabled by the Generate operation.

The result of Generate is a JSON feature collection.

If the file to be analyzed already exists in the portal as an item, callers can pass in its itemId. Callers can also directly post the file. In this case, the request must be a multipart post request pursuant to IETF RFC1867. The third option for text files is to pass the text in as the value of the text parameter.

Generate requires that the caller pass in publish parameters that describe the layers in the feature collection to be generated.

Callers can use the Analyze operation to generate the default publishing parameters for the source input.

Request parameters

ParameterDetails

[Common Parameters]

For a complete listing, see Common Parameters.

f

The output format is JSON.

itemId

The ID of the source item.

Example:

Use dark colors for code blocksCopy
1
id=345313e619df46f387f9ededbe15ac56

file

The source file.

Example:

Use dark colors for code blocksCopy
1
file=mystreets.zip

text

The source text.

Example: text=<text file data>

filetype

File type.

Values: shapefile | csv | gpx | geojson

Example:

Use dark colors for code blocksCopy
1
filetype=shapefile

publishParameters

A JSON object describing the layer and service to be created as part of the Publish operation​. The appropriate value for publish parameters depends on the file type being published. For a complete description, see Publish.

Example:

Use dark colors for code blocksCopy
1
publishParameters={"name":"Streets"}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{
   "featureCollection":{
      "layers":[
         {
            "layerDefinition":{
               "currentVersion":10.1,
               "id":0,
               "name":"",
               "type":"Feature Layer",
               "displayField":"",
               "description":"",
               "copyrightText":"",
               "defaultVisibility":true,
               "editFieldsInfo":{
                  "creationDateField":"",
                  "creatorField":"",
                  "editDateField":"",
                  "editorField":""
               },
               "relationships":[
               ],
               "isDataVersioned":false,
               "supportsRollbackOnFailureParameter":true,
               "supportsAdvancedQueries":true,
               "geometryType":"esriGeometryPoint",
               "minScale":0,
               "maxScale":0,
               "extent":{
                  "xmin":-13138866.901578393,
                  "ymin":4036479.8868969772,
                  "xmax":-13046159.729973687,
                  "ymax":4044266.7022668216,
                  "spatialReference":{
                     "wkid":102100,
                     "latestWkid":3857
                  }
               },
               "drawingInfo":{
                  "renderer":{
                     "type":"simple",
                     "symbol":{
                        "type":"esriPMS",
                        "url":"RedSphere.png",
                        "imageData":"iVBORw...K5CYII=",
                        "contentType":"image/png",
                        "color":null,
                        "width":15,
                        "height":15,
                        "angle":0,
                        "xoffset":0,
                        "yoffset":0
                     },
                     "label":"",
                     "description":""
                  },
                  "labelingInfo":null
               },
               "allowGeometryUpdates":true,
               "hasAttachments":false,
               "htmlPopupType":"esriServerHTMLPopupTypeNone",
               "hasM":false,
               "hasZ":false,
               "objectIdField":"FID",
               "globalIdField":"",
               "typeIdField":"",
               "fields":[
                  {
                     "name":"Address",
                     "type":"esriFieldTypeString",
                     "alias":"Address",
                     "sqlType":"sqlTypeNVarchar",
                     "length":256,
                     "nullable":true,
                     "editable":true,
                     "domain":null,
                     "defaultValue":null
                  },
                  {
                     "name":"City",
                     "type":"esriFieldTypeString",
                     "alias":"City",
                     "sqlType":"sqlTypeNVarchar",
                     "length":256,
                     "nullable":true,
                     "editable":true,
                     "domain":null,
                     "defaultValue":null
                  },
                  {
                     "name":"State",
                     "type":"esriFieldTypeString",
                     "alias":"State",
                     "sqlType":"sqlTypeNVarchar",
                     "length":256,
                     "nullable":true,
                     "editable":true,
                     "domain":null,
                     "defaultValue":null
                  },
                  {
                     "name":"Zip",
                     "type":"esriFieldTypeString",
                     "alias":"Zip",
                     "sqlType":"sqlTypeNVarchar",
                     "length":16,
                     "nullable":true,
                     "editable":true,
                     "domain":null,
                     "defaultValue":null
                  },
                  {
                     "name":"Value",
                     "type":"esriFieldTypeInteger",
                     "alias":"Value",
                     "sqlType":"sqlTypeInteger",
                     "nullable":true,
                     "editable":true,
                     "domain":null,
                     "defaultValue":null
                  },
                  {
                     "name":"FID",
                     "type":"esriFieldTypeInteger",
                     "alias":"FID",
                     "sqlType":"sqlTypeInteger",
                     "nullable":false,
                     "editable":false,
                     "domain":null,
                     "defaultValue":null
                  }
               ],
               "indexes":[

               ],
               "types":[

               ],
               "templates":[

               ],
               "supportedQueryFormats":"JSON",
               "hasStaticData":false,
               "maxRecordCount":-1,
               "capabilities":"Create,Delete,Query,Update,Editing"
            },
            "featureSet":{
               "features":[
                  {
                     "attributes":{
                        "Address":"56 E Arthur Ave",
                        "City":"Arcadia",
                        "State":"CA",
                        "Zip":"91006",
                        "Value":1000,
                        "FID":1
                     },
                     "geometry":{
                        "x":-13138866.901578393,
                        "y":4044266.7022668216,
                        "spatialReference":{
                           "wkid":102100,
                           "latestWkid":3857
                        }
                     }
                  },
                  {
                     "attributes":{
                        "Address":"380 New York Street",
                        "City":"Redlands",
                        "State":"CA",
                        "Zip":"92373",
                        "Value":2000,
                        "FID":2
                     },
                     "geometry":{
                        "x":-13046159.729973687,
                        "y":4036479.8868969772,
                        "spatialReference":{
                           "wkid":102100,
                           "latestWkid":3857
                        }
                     }
                  }
               ],
               "geometryType":"esriGeometryPoint"
            }
         }
      ]
   },
   "geocodeResults":{
      "accepted":2,
      "rejected":0
   }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.