Closed jmamanpara closed 6 years ago
@jmamanpara I'm currently unable to reproduce this. Your stack trace points us to here and suggests that the classificationDef.type
is undefined. But the request URL you note above has classificationDef={"type":"classBreaksDef"}
. When I issue a similar request on my own instance with the same query string, the request proceed to (https://github.com/koopjs/winnow/blob/master/src/options/normalizeClassification.js#L10). Are you able to put a break point into [here] (https://github.com/koopjs/winnow/blob/master/src/options/normalizeClassification.js#L9) and report the value of inClass
?
I might also note here that your request has parameter classificationMethod
equal to esriClassifyGeometricalInterval
, which is currently unsupported. However, that doesn't seem to be the source of the error reported above.
@jmamanpara - anything to add with respect to my June 4 comment?
Parsed param for 'classificationDef' to JSON before sending request to koop helped to resolve the issue. i.e. if (param === 'classificationDef') { params[param] = (typeof params[param] === "string") ? JSON.parse(params[param]) : params[param]; }
Thanks @rgwozdz. Closing the issue.
It needs to convert "options.classificationDef" to Javascript Object function normalizeGeoservicesClassBreaks (options) in /build/koop/node_modules/winnow/dist/options/normalizeClassification.js
URL : /marklogic/GDeltGKG/FeatureServer/0/generateRenderer?classificationDef=%7B%22type%22%3A%22classBreaksDef%22%2C%22classificationField%22%3A%22OBJECTID%22%2C%22classificationMethod%22%3A%22esriClassifyGeometricalInterval%22%2C%22breakCount%22%3A10%7D&f=json&where=1%3D1&
req.query { classificationDef: '{"type":"classBreaksDef","classificationField":"OBJECTID","classificationMethod":"esriClassifyGeometricalInterval","breakCount":10}', f: 'json', where: '1=1' }
Error : Error: Input classification type invalid:undefined at normalizeGeoservicesClassBreaks (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/normalizeClassification.js:26:18) at normalizeClassification (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/normalizeClassification.js:3:48) at Object.prepare (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/index.js:32:21) at Model.getData (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/marklogic.js:24:28) at /Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:13:14 at Cache.retrieve (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop-cache-memory/dist/index.js:75:38) at Model.pull (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:9:14) at Controller.Geoservices.featureServer (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop-output-geoservices/index.js:7:14) at Layer.handle [as handle_request] (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/layer.js:95:5) at next (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/layer.js:95:5) at /Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:281:22 at param (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:354:14) at param (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:365:14) at param (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:365:14)