Skip to content

Create GUI to help to build an ArcGIS Feature Layer Definition from a SQL sentence #9

@hhkaos

Description

@hhkaos

I think the ArcGIS Feature Layer Definition is not documented anywhere, at least not like the web map spec, right? (this is the most advanced documentation I have found).

If that's the case... I think It would be nice to have a simple GUI capable of doing the translation in order to facilitate the layer/table creation process through the REST API. Something like this:

CREATE TABLE Point_layer (
  OBJECTID INT NOT NULL,
  START_DATE DATETIME,
  EVENT_TITLE VARCHAR(256),
  CATEGORY INT,
  PRIMARY KEY (OBJECTID)
);

To the spec the ArcGIS API expects when adding a new layer/table to a Feature service:

{
	"layers": [{
		"currentVersion": 10.51,
		"id": 0,
		"name": "Point_layer",
		"type": "Feature Layer",
		"displayField": "",
		"description": "",
		"copyrightText": "",
		"defaultVisibility": true,
		"editingInfo": {
			"lastEditDate": null
		},
		"relationships": [],
		"isDataVersioned": false,
		"supportsAppend": true,
		"supportsCalculate": true,
		"supportsTruncate": true,
		"supportsAttachmentsByUploadId": true,
		"supportsAttachmentsResizing": true,
		"supportsRollbackOnFailureParameter": true,
		"supportsStatistics": true,
		"supportsAdvancedQueries": true,
		"supportsValidateSql": true,
		"supportsCoordinatesQuantization": true,
		"supportsApplyEditsWithGlobalIds": false,
		"advancedQueryCapabilities": {
			"supportsPagination": true,
			"supportsPaginationOnAggregatedQueries": true,
			"supportsQueryRelatedPagination": true,
			"supportsQueryWithDistance": true,
			"supportsReturningQueryExtent": true,
			"supportsStatistics": true,
			"supportsOrderBy": true,
			"supportsDistinct": true,
			"supportsQueryWithResultType": true,
			"supportsSqlExpression": true,
			"supportsAdvancedQueryRelated": true,
			"supportsCountDistinct": true,
			"supportsLod": true,
			"supportsReturningGeometryCentroid": false,
			"supportsQueryWithDatumTransformation": true,
			"supportsHavingClause": true,
			"supportsOutFieldSQLExpression": true
		},
		"useStandardizedQueries": true,
		"geometryType": "esriGeometryPoint",
		"minScale": 0,
		"maxScale": 0,
		"extent": {
			"xmin": -20037508.342788905,
			"ymin": -8175201.3721496435,
			"xmax": -10018754.171394452,
			"ymax": 12175461.54272524,
			"spatialReference": {
				"wkid": 102100
			}
		},
		"drawingInfo": {
			"renderer": {
				"type": "simple",
				"symbol": {
					"type": "esriPMS",
					"url": "RedSphere.png",
					"imageData": "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xTuc4+QAAB3VJREFUeF7tmPlTlEcexnve94U5mANQbgQSbgiHXHINlxpRIBpRI6wHorLERUmIisKCQWM8cqigESVQS1Kx1piNi4mW2YpbcZONrilE140RCTcy3DDAcL/zbJP8CYPDL+9Ufau7uqb7eZ7P+/a8PS8hwkcgIBAQCAgEBAICAYGAQEAgIBAQCAgEBAICAYGAQEAgIBAQCDx/AoowKXFMUhD3lQrioZaQRVRS+fxl51eBTZUTdZ41U1Rox13/0JF9csGJ05Qv4jSz/YPWohtvLmSKN5iTGGqTm1+rc6weICOBRbZs1UVnrv87T1PUeovxyNsUP9P6n5cpHtCxu24cbrmwKLdj+osWiqrVKhI0xzbmZ7m1SpJ+1pFpvE2DPvGTomOxAoNLLKGLscZYvB10cbYYjrJCb7A5mrxleOBqim+cWJRakZY0JfnD/LieI9V1MrKtwokbrAtU4Vm0A3TJnphJD4B+RxD0u0LA7w7FTE4oprOCMbklEGNrfdGf4IqnQTb4wc0MFTYibZqM7JgjO8ZdJkpMln/sKu16pHZGb7IfptIWg389DPp9kcChWODoMuDdBOhL1JgpisbUvghM7AqFbtNiaFP80RLnhbuBdqi0N+1dbUpWGde9gWpuhFi95yL7sS7BA93JAb+Fn8mh4QujgPeTgb9kAZf3Apd2A+fXQ38yHjOHozB1IAJjOSEY2RSIwVUv4dd4X9wJccGHNrJ7CYQ4GGjLeNNfM+dyvgpzQstKf3pbB2A6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33NCZRcPHOGJYZIKfpQyq7JjHS6yJjcHujLHADgkpuC7h8F8zEVqXSNC2awE69lqhs8AamkO26HrbDt2H7dBVQov2NcW26CiwQtu+BWjdY4n2nZboTbfCmKcCnRyDO/YmyLPnDlHvjDH8G6zhS9/wlEnYR7X00fWrFYuWdVI0ZpuhcbcczW/R2qdAcz6t/bRov4mONeaaoYl+p22rHF0bVNAmKtBvweIXGxNcfFH8eNlC4m6wMWMusEnKpn5hyo48pj9gLe4SNG9QoGGLAk8z5XiaJUd99u8122/IpBA2K9BGg2vWWKAvRYVeLzEa7E1R422m2+MsSTem97nSYnfKyN6/mzATv7AUgqcMrUnmaFlLX3ysM0fj+t/b5lQLtK22QEfyAmiSLKFZpUJ7kBRPXKW4HqCYynWVHKSG2LkyZex1uO1mZM9lKem9Tx9jjY5iNEYo0bKMhn7ZAu0r6H5PpLXCAq0rKJClSjSGynE/QIkrQYqBPe6S2X+AJsY2Ped6iWZk6RlL0c2r5szofRsO9R5S1IfQLRCpQL1aifoYFerpsbkuTImaUJXuXIDiH6/Ys8vm3Mg8L2i20YqsO7fItKLcSXyn0kXccclVqv3MS6at9JU/Ox+ouns+SF6Z4cSupz7l8+z1ucs7LF1AQjOdxfGZzmx8Iu1TRcfnrioICAQEAgIBgYBAQCAgEBAICAQEAgIBgYBAQCAgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=",
					"contentType": "image/png",
					"width": 15,
					"height": 15
				}
			}
		},
		"allowGeometryUpdates": true,
		"hasAttachments": true,
		"htmlPopupType": "esriServerHTMLPopupTypeNone",
		"hasM": false,
		"hasZ": false,
		"objectIdField": "OBJECTID",
		"uniqueIdField": {
			"name": "OBJECTID",
			"isSystemMaintained": true
		},
		"globalIdField": "",
		"typeIdField": "",
		"fields": "fields": [{
            "name": "OBJECTID",
            "type": "esriFieldTypeOID",
            "actualType": "int",
            "alias": "OBJECTID",
            "sqlType": "sqlTypeInteger",
            "nullable": false,
            "editable": false,
            "visible": true,
            "domain": null,
            "defaultValue": null
        },{
            "name": "START_DATE",
            "type": "esriFieldTypeDate",
            "actualType": "datetime2",
            "alias": "START_DATE",
            "sqlType": "sqlTypeTimestamp2",
            "length": 8,
            "nullable": true,
            "editable": true,
            "visible": true,
            "domain": null,
            "defaultValue": null
        }, {
            "name": "EVENT_TITLE",
            "type": "esriFieldTypeString",
            "actualType": "nvarchar",
            "alias": "EVENT_TITLE",
            "sqlType": "sqlTypeNVarchar",
            "length": 256,
            "nullable": true,
            "editable": true,
            "visible": true,
            "domain": null,
            "defaultValue": null
        }, {
            "name": "CATEGORY",
            "type": "esriFieldTypeInteger",
            "actualType": "int",
            "alias": "CATEGORY",
            "sqlType": "sqlTypeInteger",
            "nullable": true,
            "editable": true,
            "visible": true,
            "domain": null,
            "defaultValue": null
        }],
		"indexes": [],
		"types": [],
		"templates": [{
			"name": "New Feature",
			"description": "",
			"drawingTool": "esriFeatureEditToolPoint",
			"prototype": {
				"attributes": {}
			}
		}],
		"supportedQueryFormats": "JSON, geoJSON",
		"hasStaticData": false,
		"maxRecordCount": 2000,
		"standardMaxRecordCount": 32000,
		"tileMaxRecordCount": 8000,
		"maxRecordCountFactor": 1,
		"capabilities": "Query,Editing,Create,Update,Delete,Sync",
		"syncEnabled": true,
		"adminLayerInfo": {
			"geometryField": {
				"name": "Shape",
				"srid": 102100
			}
		}
	}],
	"tables": []
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions