featureserver
Advanced tools
Comparing version 1.2.6 to 1.3.0
@@ -5,5 +5,5 @@ # Change Log | ||
## [1.2.6] - 2017-02-28 | ||
### Fixed | ||
* Prevent exception in computing when passed in geojson has no features | ||
## [1.3.0] - 2017-03-16 | ||
### Added | ||
* Support for `f=geojson` | ||
@@ -86,3 +86,3 @@ ## [1.2.5] - 2017-02-28 | ||
[1.2.6]: https://github.com/featureserver/featureserver/compare/v1.2.6...v1.2.5 | ||
[1.3.0]: https://github.com/featureserver/featureserver/compare/v1.2.5...v1.3.0 | ||
[1.2.5]: https://github.com/featureserver/featureserver/compare/v1.2.5...v1.2.4 | ||
@@ -89,0 +89,0 @@ [1.2.4]: https://github.com/featureserver/featureserver/compare/v1.2.3...v1.2.4 |
@@ -24,3 +24,3 @@ var Utils = require('./utils.js') | ||
id: 0, | ||
name: geojson.metadata && geojson.metadata.name || 'layer 1', | ||
name: (geojson.metadata && geojson.metadata.name) || 'layer 1', | ||
parentLayerId: -1, | ||
@@ -27,0 +27,0 @@ defaultVisibility: true, |
@@ -20,6 +20,7 @@ var Templates = require('./templates') | ||
if (data.filtersApplied && data.filtersApplied.geometry) { delete params.geometry } | ||
if (data.filtersApplied && data.filtersApplied.where || params.where === '1=1') { delete params.where } | ||
if ((data.filtersApplied && data.filtersApplied.where) || params.where === '1=1') { delete params.where } | ||
if (data.statistics) { return statisticsResponse(data.statistics) } | ||
if (params.returnCountOnly && data.count) { return {count: data.count} } | ||
// TODO this should happen within winnow | ||
// TODO support datasets that already have an integer unique ID | ||
// add objectIds as long as this is not a stats request | ||
@@ -31,5 +32,11 @@ if (!params.outStatistics) { | ||
} | ||
params.toEsri = true | ||
if (params.f !== 'geojson') { params.toEsri = true } | ||
var queriedData = Winnow.query(data, params) | ||
if (params.f === 'geojson') { return { type: 'FeatureCollection', features: queriedData.features } } | ||
else { return geoservicesPostQuery(data, queriedData, params) } | ||
} | ||
function geoservicesPostQuery (data, queriedData, params) { | ||
// options.objectIds works alongside returnCountOnly but not statistics | ||
@@ -51,4 +58,5 @@ if (params.objectIds && !params.outStatistics) { | ||
} else { | ||
params.extent = Utils.getExtent(data) | ||
params.extent = Utils.getExtent(queriedData) | ||
params.geometryType = Utils.getGeomType(data) | ||
// TODO should these be calculated using the whole dataset? | ||
params.spatialReference = params.outSR | ||
@@ -55,0 +63,0 @@ params.attributeSample = data.features[0] && data.features[0].properties |
@@ -36,3 +36,3 @@ var FsInfo = require('./info.js') | ||
var url = req.originalUrl || req.url | ||
url.substr(-4) === 'info' | ||
return url.substr(-4) === 'info' | ||
} | ||
@@ -46,3 +46,3 @@ | ||
if (process.env.NODE_ENV === 'test') { console.trace(e) } | ||
res.status(500).json({error: e.message}) | ||
return res.status(500).json({error: e.message}) | ||
} | ||
@@ -69,3 +69,3 @@ if (req.query.callback) { res.send(((req.query.callback) + "(" + (JSON.stringify(response)) + ")")) } | ||
if (process.env.NODE_ENV === 'test') { console.trace(e) } | ||
res.status(500).json({error: e.message}) | ||
return res.status(500).json({error: e.message}) | ||
} | ||
@@ -72,0 +72,0 @@ if (req.query.callback) { res.send(((req.query.callback) + "(" + (JSON.stringify(info)) + ")")) } |
{ | ||
"name": "featureserver", | ||
"version": "1.2.6", | ||
"version": "1.3.0", | ||
"description": "*An open source implementation of the GeoServices specification*", | ||
@@ -28,6 +28,6 @@ "main": "dist/index.js", | ||
"express": "^4.14.0", | ||
"mocha": "^2.4.5", | ||
"should": "^8.3.1", | ||
"standard": "^8.0.1", | ||
"supertest": "^2.0.1" | ||
"mocha": "^3.2.0", | ||
"should": "^11.2.1", | ||
"standard": "^9.0.1", | ||
"supertest": "^3.0.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "standard": { |
# FeatureServer | ||
*An open source implementation of the GeoServices specification* | ||
[![npm][npm-image]][npm-url] | ||
[![travis][travis-image]][travis-url] | ||
[![Greenkeeper badge][greenkeeper-image]][greenkeeper-url] | ||
[npm-image]: https://img.shields.io/npm/v/featureserver.svg?style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/featureserver | ||
[travis-image]: https://img.shields.io/travis/FeatureServer/FeatureServer.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/FeatureServer/FeatureServer | ||
[greenkeeper-image]: https://badges.greenkeeper.io/FeatureServer/FeatureServer.svg | ||
[greenkeeper-url]: https://greenkeeper.io/ | ||
## Usage | ||
@@ -5,0 +17,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34681
32
800
107