Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

remove crs validation and associated tests #91

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions lib/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.3
function FeatureCollection(featureCollection) {
crs(featureCollection);
bbox(featureCollection);
if (featureCollection.properties !== undefined) {
errors.push({
Expand Down Expand Up @@ -229,22 +228,6 @@ function hint(gj, options) {
}
}

function crs(_) {
if (!_.crs) return;
var defaultCRSName = 'urn:ogc:def:crs:OGC:1.3:CRS84';
if (typeof _.crs === 'object' && _.crs.properties && _.crs.properties.name === defaultCRSName) {
errors.push({
message: 'old-style crs member is not recommended, this object is equivalent to the default and should be removed',
line: _.__line__
});
} else {
errors.push({
message: 'old-style crs member is not recommended',
line: _.__line__
});
}
}

function bbox(_) {
if (!_.bbox) {
return;
Expand Down Expand Up @@ -293,7 +276,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.1.2
function Point(point) {
crs(point);
bbox(point);
geometrySemantics(point);
if (!requiredProperty(point, 'coordinates', 'array')) {
Expand All @@ -303,7 +285,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.1.6
function Polygon(polygon) {
crs(polygon);
bbox(polygon);
if (requiredProperty(polygon, 'coordinates', 'array')) return;
if (positionArray(polygon.coordinates, 'LinearRing', 2)) return;
Expand All @@ -313,7 +294,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.1.7
function MultiPolygon(multiPolygon) {
crs(multiPolygon);
bbox(multiPolygon);
if (requiredProperty(multiPolygon, 'coordinates', 'array')) return;
if (positionArray(multiPolygon.coordinates, 'LinearRing', 3)) return;
Expand All @@ -323,7 +303,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.1.4
function LineString(lineString) {
crs(lineString);
bbox(lineString);
if (!requiredProperty(lineString, 'coordinates', 'array')) {
positionArray(lineString.coordinates, 'Line', 1);
Expand All @@ -332,7 +311,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.1.5
function MultiLineString(multiLineString) {
crs(multiLineString);
bbox(multiLineString);
if (!requiredProperty(multiLineString, 'coordinates', 'array')) {
positionArray(multiLineString.coordinates, 'Line', 2);
Expand All @@ -341,7 +319,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.1.3
function MultiPoint(multiPoint) {
crs(multiPoint);
bbox(multiPoint);
if (!requiredProperty(multiPoint, 'coordinates', 'array')) {
positionArray(multiPoint.coordinates, '', 1);
Expand All @@ -350,7 +327,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.1.8
function GeometryCollection(geometryCollection) {
crs(geometryCollection);
bbox(geometryCollection);
if (!requiredProperty(geometryCollection, 'geometries', 'array')) {
if (!everyIs(geometryCollection.geometries, 'object')) {
Expand Down Expand Up @@ -381,7 +357,6 @@ function hint(gj, options) {

// https://tools.ietf.org/html/rfc7946#section-3.2
function Feature(feature) {
crs(feature);
bbox(feature);
// https://github.com/geojson/draft-geojson/blob/master/middle.mkd#feature-object
if (feature.id !== undefined &&
Expand Down
Loading