Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
featureserver
Advanced tools
An open source implementation of the GeoServices specification
This is meant to be used as a plugin to Express
const express = require('express')
const app = express() // set up a basic express server
const featureServer = require('featureserver')
const cache = require('cache')
// We only need one handler because FeatureServer.route is going to do all the work
const handler = (req, res) => {
cache.get(/* some geojson */, (err, data) => {
if (err) res.status(500).json({error: err.message})
else FeatureServer.route(req, res, data)
})
}
// Sets up all of the handled routes to support `GET` and `POST`
const routes = ['/FeatureServer', '/FeatureServer/layers', '/FeatureServer/:layer', '/FeatureServer/:layer/:method']
routes.forEach(route => {
app.route(route)
.get(handler)
.post(handler)
})
Pass in an incoming request object
, an outgoing response object
and geojson
and this function will route and return a geoservices compliant response
Supports: '/FeatureServer', '/FeatureServer/layers', '/FeatureServer/:layer', '/FeatureServer/:layer/:method'
Note: only query
and info
are supported methods at this type
FeatureServer.route(req, res, data, options)
Data is a geojson object extended with some additional properties. These properties are optional and can be used to provide more specific metadata or to shortcut the built in filtering mechanism.
e.g.
{
type: 'FeatureCollection'
features: Array,
statistics: Object, // pass statistics to an outStatistics request to or else they will be calculated from geojson features passed in
metadata: {
name: String, //
description: String
extent: Object || Array // valid extent object or 2 coord array
displayField: String // The display field to be used by a client
id: String // unique identifier field
},
filtersApplied: {
geometry: Boolean, // true if a geometric filter has already been applied to the data
where: Boolean // true if a sql-like where filter has already been applied to the data
}
count: Number // pass count if the number of features in a query has been precalculated
}
Pass in geojson
and a valid geoservices query object
e.g. where=OBJECTID>10
and the function will perform the query and return a valid geoservices query object
FeatureServer.query(geojson, options)
Generate version 10.21
Geoservices-like server info
FeatureServer.serverInfo()
Generate version 10.21
Geoservices-like information about a single layer
FeatureServer.layerInfo(geojson, options)
Generate version 10.21
Geoservices-like information about one or many layers
Can pass a single geojson object or an array of geojson objects
FeatureServer.layers(geojson, options)
[1.2.5] - 2017-02-28
FAQs
*An open source implementation of the GeoServices specification*
The npm package featureserver receives a total of 143 weekly downloads. As such, featureserver popularity was classified as not popular.
We found that featureserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.