-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,098 additions
and
334 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/InvalidGeometryNotice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2024 MobilityData LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mobilitydata.gtfsvalidator.notice; | ||
|
||
import static org.mobilitydata.gtfsvalidator.notice.SeverityLevel.ERROR; | ||
|
||
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice; | ||
|
||
/** | ||
* A polygon in `locations.geojson` is unparsable or invalid. | ||
* | ||
* <p>Each polygon must be valid by the definition of the <a | ||
* href="http://www.opengis.net/doc/is/sfa/1.2.1" target="_blank"> OpenGIS Simple Features | ||
* Specification, section 6.1.11 </a>. | ||
*/ | ||
@GtfsValidationNotice(severity = ERROR) | ||
public class InvalidGeometryNotice extends ValidationNotice { | ||
|
||
/** The id of the faulty record. */ | ||
private final String featureId; | ||
|
||
/** The geometry type of the feature containing the invalid polygon. */ | ||
private final String geometryType; | ||
|
||
/** The validation error details. */ | ||
private final String message; | ||
|
||
public InvalidGeometryNotice(String featureId, String geometryType, String validationError) { | ||
this.featureId = featureId; | ||
this.geometryType = geometryType; | ||
this.message = validationError; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/MalformedJsonNotice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2024 MobilityData LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mobilitydata.gtfsvalidator.notice; | ||
|
||
import static org.mobilitydata.gtfsvalidator.notice.SeverityLevel.ERROR; | ||
|
||
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice; | ||
|
||
/** A JSON file is malformed. */ | ||
@GtfsValidationNotice(severity = ERROR) | ||
public class MalformedJsonNotice extends ValidationNotice { | ||
|
||
/** The name of the faulty file. */ | ||
private final String filename; | ||
|
||
public MalformedJsonNotice(String filename) { | ||
this.filename = filename; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/MissingRequiredElementNotice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2024 MobilityData LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mobilitydata.gtfsvalidator.notice; | ||
|
||
import static org.mobilitydata.gtfsvalidator.notice.SeverityLevel.ERROR; | ||
|
||
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice; | ||
|
||
/** A required element is missing in `locations.geojson`. */ | ||
@GtfsValidationNotice(severity = ERROR) | ||
public class MissingRequiredElementNotice extends ValidationNotice { | ||
/** Index of the feature in the feature collection. */ | ||
private final Integer featureIndex; | ||
|
||
/** The id of the faulty record. */ | ||
private final String featureId; | ||
|
||
/** The missing required element. */ | ||
private final String missingElement; | ||
|
||
public MissingRequiredElementNotice( | ||
String featureId, String missingElement, Integer featureIndex) { | ||
this.featureId = featureId; | ||
this.featureIndex = featureIndex; | ||
this.missingElement = missingElement; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/UnsupportedFeatureTypeNotice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2024 MobilityData LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mobilitydata.gtfsvalidator.notice; | ||
|
||
import static org.mobilitydata.gtfsvalidator.notice.SeverityLevel.ERROR; | ||
|
||
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice; | ||
|
||
/** | ||
* An unsupported feature type is used in the `locations.geojson` file. | ||
* | ||
* <p>Use `Feature` instead to comply with the spec. | ||
*/ | ||
@GtfsValidationNotice(severity = ERROR) | ||
public class UnsupportedFeatureTypeNotice extends ValidationNotice { | ||
|
||
/** The value of the unsupported GeoJSON type. */ | ||
Integer featureIndex; | ||
|
||
/** The id of the faulty record. */ | ||
String featureId; | ||
|
||
/** The feature type of the faulty record. */ | ||
String featureType; | ||
|
||
public UnsupportedFeatureTypeNotice(Integer featureIndex, String featureId, String featureType) { | ||
this.featureIndex = featureIndex; | ||
this.featureId = featureId; | ||
this.featureType = featureType; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/UnsupportedGeoJsonTypeNotice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2024 MobilityData LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mobilitydata.gtfsvalidator.notice; | ||
|
||
import static org.mobilitydata.gtfsvalidator.notice.SeverityLevel.ERROR; | ||
|
||
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice; | ||
|
||
/** | ||
* An unsupported GeoJSON type is used in the `locations.geojson` file. | ||
* | ||
* <p>Use `FeatureCollection` instead to comply with the spec. | ||
*/ | ||
@GtfsValidationNotice(severity = ERROR) | ||
public class UnsupportedGeoJsonTypeNotice extends ValidationNotice { | ||
|
||
/** The value of the unsupported GeoJSON type. */ | ||
private final String geoJsonType; | ||
|
||
public UnsupportedGeoJsonTypeNotice(String geoJsonType) { | ||
this.geoJsonType = geoJsonType; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/UnsupportedGeometryTypeNotice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2024 MobilityData LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mobilitydata.gtfsvalidator.notice; | ||
|
||
import static org.mobilitydata.gtfsvalidator.notice.SeverityLevel.ERROR; | ||
|
||
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice; | ||
|
||
/** | ||
* A GeoJSON feature has an unsupported geometry type in `locations.geojson`. | ||
* | ||
* <p>Each feature must have a geometry type that is supported by the GTFS spec. The supported | ||
* geometry types `Polygon` and `MultiPolygon`. | ||
*/ | ||
@GtfsValidationNotice(severity = ERROR) | ||
public class UnsupportedGeometryTypeNotice extends ValidationNotice { | ||
|
||
/** The index of the feature in the feature collection. */ | ||
private final int featureIndex; | ||
|
||
/** The id of the faulty record. */ | ||
private final String featureId; | ||
|
||
/** The geometry type of the faulty record. */ | ||
private final String geometryType; | ||
|
||
public UnsupportedGeometryTypeNotice(int featureIndex, String featureId, String geometryType) { | ||
this.featureIndex = featureIndex; | ||
this.featureId = featureId; | ||
this.geometryType = geometryType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.