Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
geojson-validation
Advanced tools
A GeoJSON Validation Library
Check JSON objects to see whether or not they are valid GeoJSON. Validation is based off of the GeoJSON Format Specification revision 1.0
npm install geojson-validation
All Function return a boolean and take a JSON object that will be evalatued to see if it is a GeoJSON object.
Arguments
errors
is an array of validation errors for an invalid JSON objectAlias: isGeoJSONObject
Checks if an object is a GeoJSON Object.
Checks if an object is a GeoJSON Object.
Checks if an array is a Position
Checks if an object is a Geometry Object
Checks if an object is a Point
Checks if an object is a MultiPoint
Checks if an object is a Line String
Checks if an object is a MultiLine String
Checks if an object is a Polygon
Checks if an object is a MultiPolygon
Checks if an object is a Geometry Collection
Checks if an object is a Feature Object
Checks if an object is a Feature Collection Object
Checks if an object is a Bounding Box
gjVal = require("geojson-validation");
var validFeatureCollection = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
"properties": {"prop0": "value0"}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
]
},
"properties": {
"prop0": "value0",
"prop1": 0.0
}
}
]
};
//simple test
if(gjVal.valid(validFeatureCollection)){
console.log("this is valid GeoJSON!");
}
var invalidFeature = {
"type": "feature",
"geometry": {
"type": "LineString",
"coordinates": [
[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
]
},
"properties": {
"prop0": "value0",
"prop1": 0.0
}
};
//test to see if `invalidFeature` is valid
gjVal.isFeature(invalidFeature, function(valid, errs){
//log the errors
if(!valid){
console.log(errs);
}
});
To run tests npm test
Test use mocha
FAQs
A GeoJSON Validation Library
We found that geojson-validation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.