@@ -78,13 +78,12 @@ public GisExportJob(ExportType exportType, File file, Collection<String> feedIds
78
78
ShapefileDataStore datastore = (ShapefileDataStore ) dataStoreFactory .createNewDataStore (params );
79
79
datastore .forceSchemaCRS (DefaultGeographicCRS .WGS84 );
80
80
81
- final SimpleFeatureType STOP_TYPE = // createStopFeatureType();
82
- DataUtilities .createType (
81
+ final SimpleFeatureType STOP_TYPE = DataUtilities .createType (
83
82
"Stop" ,
84
83
String .join ("," ,
85
84
// Geometry must be the first attribute for a shapefile (and must be named
86
- // "the_geom").
87
- "the_geom:Point" ,
85
+ // "the_geom"). We must include SRID, otherwise the projection will be undefined.
86
+ "the_geom:Point:srid=4326 " ,
88
87
"name:String" ,
89
88
"code:String" ,
90
89
"desc:String" ,
@@ -96,6 +95,8 @@ public GisExportJob(ExportType exportType, File file, Collection<String> feedIds
96
95
final SimpleFeatureType ROUTE_TYPE = DataUtilities .createType (
97
96
"Route" , // <- the name for our feature type
98
97
String .join ("," ,
98
+ // Geometry must be the first attribute for a shapefile (and must be named
99
+ // "the_geom"). We must include SRID, otherwise the projection will be undefined.
99
100
"the_geom:LineString:srid=4326" ,
100
101
"pattName:String" ,
101
102
"shortName:String" ,
@@ -158,7 +159,9 @@ public GisExportJob(ExportType exportType, File file, Collection<String> feedIds
158
159
// exporting a shapefile. If there are future similar cases, we may need to
159
160
// refactor this into a more structured operation using Java objects or
160
161
// com.conveyal.gtfs.loader.Feed
161
- String patternsSql = Table .PATTERNS .generateSelectSql (version .namespace , Requirement .EDITOR );
162
+ // Note: we use generateSelectAllSql because we encountered an issue with some feeds (perhaps legacy)
163
+ // not containing the column patterns#direction_id. See https://github.com/ibi-group/datatools-server/issues/203
164
+ String patternsSql = Table .PATTERNS .generateSelectAllSql (version .namespace );
162
165
PreparedStatement statement = connection .prepareStatement (patternsSql );
163
166
ResultSet resultSet = statement .executeQuery ();
164
167
// we loop over trip patterns. Note that this will yield several lines for routes that have
0 commit comments