@@ -5,2 +5,6 @@ # Change Log | ||
## [1.8.3] - 03-27-2017 | ||
### Fixed | ||
* Handle coded value domains with esriFields passed in | ||
## [1.8.2] - 03-24-2017 | ||
@@ -119,2 +123,3 @@ ### Fixed | ||
[1.8.3]: https://github.com/featureserver/winnow/compare/v1.8.3...v1.8.2 | ||
[1.8.2]: https://github.com/featureserver/winnow/compare/v1.8.1...v1.8.2 | ||
@@ -121,0 +126,0 @@ [1.8.1]: https://github.com/featureserver/winnow/compare/v1.8.1...v1.8.0 |
@@ -25,2 +25,3 @@ var proj4 = require('proj4') | ||
toEsri: options.toEsri, | ||
esriFields: options.esriFields, | ||
collection: options.collection | ||
@@ -27,0 +28,0 @@ } |
@@ -14,4 +14,4 @@ var OPERATORS = ['>', '<', '=', '>=', '<=', 'like', 'ilike', 'in'] | ||
var tokens = tokenize(options.where) | ||
if (options.fields) { | ||
tokens = decodeDomains(tokens, options.fields) | ||
if (options.esriFields) { | ||
tokens = decodeDomains(tokens, options.esriFields) | ||
} | ||
@@ -91,7 +91,7 @@ return translate(tokens, options) | ||
function applyDomain (fieldName, value, fields) { | ||
var temp = value.replace(/^\(+|\)+$/, '') | ||
var temp = value.replace(/['"]/g, '') | ||
fields.forEach(function (field) { | ||
if (field.domain && (field.domain.name && field.domain.name === fieldName)) { | ||
field.domain.codedValues.forEach(function (coded) { | ||
if (parseInt(coded.code, 10) === parseInt(temp, 10)) { | ||
if (parseInt(coded.code) === parseInt(temp)) { | ||
value = value.replace(temp, coded.name) | ||
@@ -98,0 +98,0 @@ } |
{ | ||
"name": "winnow", | ||
"version": "1.8.2", | ||
"version": "1.8.3", | ||
"description": "Apply sql-like filters to GeoJSON", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
49698
0.39%809
0.12%