@@ -40,7 +40,8 @@ public GtfsEntityContainer load(
4040 List <GtfsGeoJsonFeature > entities = extractFeaturesFromStream (inputStream , noticeContainer );
4141 return geoJsonFileDescriptor .createContainerForEntities (entities , noticeContainer );
4242 } catch (JsonParseException jpex ) {
43- noticeContainer .addValidationNotice (new MalformedJsonNotice (GtfsGeoJsonFeature .FILENAME ));
43+ noticeContainer .addValidationNotice (
44+ new MalformedJsonNotice (GtfsGeoJsonFeature .FILENAME , jpex .getMessage ()));
4445 logger .atSevere ().withCause (jpex ).log ("Malformed JSON in locations.geojson" );
4546 return fileDescriptor .createContainerForInvalidStatus (TableStatus .UNPARSABLE_ROWS );
4647 } catch (IOException ioex ) {
@@ -55,6 +56,15 @@ public GtfsEntityContainer load(
5556 }
5657 }
5758
59+ /**
60+ * Extracts features from the provided GeoJSON input stream.
61+ *
62+ * @param inputStream the input stream containing GeoJSON data
63+ * @param noticeContainer the container to collect validation notices
64+ * @return a list of parsed GeoJSON features
65+ * @throws IOException if an I/O error occurs while reading the input stream
66+ * @throws UnparsableGeoJsonFeatureException if any GeoJSON feature is unparsable
67+ */
5868 public List <GtfsGeoJsonFeature > extractFeaturesFromStream (
5969 InputStream inputStream , NoticeContainer noticeContainer )
6070 throws IOException , UnparsableGeoJsonFeatureException {
@@ -67,7 +77,11 @@ public List<GtfsGeoJsonFeature> extractFeaturesFromStream(
6777 throw new UnparsableGeoJsonFeatureException ("Missing required field 'type'" );
6878 } else if (!jsonObject .get ("type" ).getAsString ().equals ("FeatureCollection" )) {
6979 noticeContainer .addValidationNotice (
70- new UnsupportedGeoJsonTypeNotice (jsonObject .get ("type" ).getAsString ()));
80+ new UnsupportedGeoJsonTypeNotice (
81+ jsonObject .get ("type" ).getAsString (),
82+ "Unsupported GeoJSON type: "
83+ + jsonObject .get ("type" ).getAsString ()
84+ + ". Use 'FeatureCollection' instead." ));
7185 throw new UnparsableGeoJsonFeatureException ("Unsupported GeoJSON type" );
7286 }
7387 JsonArray featuresArray = jsonObject .getAsJsonArray ("features" );
0 commit comments