@@ -172,19 +172,19 @@ public GeoJson<? extends Iterable<?>> convert(Map<String, Object> source) {
172
172
String type = GeoConverters .getGeoJsonType (source );
173
173
174
174
switch (type ) {
175
- case GeoJsonPoint . TYPE :
175
+ case "point" :
176
176
return MapToGeoJsonPointConverter .INSTANCE .convert (source );
177
- case GeoJsonMultiPoint . TYPE :
177
+ case "multipoint" :
178
178
return MapToGeoJsonMultiPointConverter .INSTANCE .convert (source );
179
- case GeoJsonLineString . TYPE :
179
+ case "linestring" :
180
180
return MapToGeoJsonLineStringConverter .INSTANCE .convert (source );
181
- case GeoJsonMultiLineString . TYPE :
181
+ case "multilinestring" :
182
182
return MapToGeoJsonMultiLineStringConverter .INSTANCE .convert (source );
183
- case GeoJsonPolygon . TYPE :
183
+ case "polygon" :
184
184
return MapToGeoJsonPolygonConverter .INSTANCE .convert (source );
185
- case GeoJsonMultiPolygon . TYPE :
185
+ case "multipolygon" :
186
186
return MapToGeoJsonMultiPolygonConverter .INSTANCE .convert (source );
187
- case GeoJsonGeometryCollection . TYPE :
187
+ case "geometrycollection" :
188
188
return MapToGeoJsonGeometryCollectionConverter .INSTANCE .convert (source );
189
189
default :
190
190
throw new IllegalArgumentException ("unknown GeoJson type " + type );
@@ -217,7 +217,7 @@ public enum MapToGeoJsonPointConverter implements Converter<Map<String, Object>,
217
217
public GeoJsonPoint convert (Map <String , Object > source ) {
218
218
219
219
String type = GeoConverters .getGeoJsonType (source );
220
- Assert .isTrue (type .equals (GeoJsonPoint .TYPE ), "does not contain a type 'Point'" );
220
+ Assert .isTrue (type .equalsIgnoreCase (GeoJsonPoint .TYPE ), "does not contain a type 'Point'" );
221
221
222
222
Object coordinates = source .get ("coordinates" );
223
223
Assert .notNull (coordinates , "Document to convert does not contain coordinates" );
@@ -255,7 +255,7 @@ public enum MapToGeoJsonMultiPointConverter implements Converter<Map<String, Obj
255
255
public GeoJsonMultiPoint convert (Map <String , Object > source ) {
256
256
257
257
String type = GeoConverters .getGeoJsonType (source );
258
- Assert .isTrue (type .equals (GeoJsonMultiPoint .TYPE ), "does not contain a type 'MultiPoint'" );
258
+ Assert .isTrue (type .equalsIgnoreCase (GeoJsonMultiPoint .TYPE ), "does not contain a type 'MultiPoint'" );
259
259
Object coordinates = source .get ("coordinates" );
260
260
Assert .notNull (coordinates , "Document to convert does not contain coordinates" );
261
261
Assert .isTrue (coordinates instanceof List , "coordinates must be a List" );
@@ -290,7 +290,7 @@ public enum MapToGeoJsonLineStringConverter implements Converter<Map<String, Obj
290
290
public GeoJsonLineString convert (Map <String , Object > source ) {
291
291
292
292
String type = GeoConverters .getGeoJsonType (source );
293
- Assert .isTrue (type .equals (GeoJsonLineString .TYPE ), "does not contain a type 'LineString'" );
293
+ Assert .isTrue (type .equalsIgnoreCase (GeoJsonLineString .TYPE ), "does not contain a type 'LineString'" );
294
294
Object coordinates = source .get ("coordinates" );
295
295
Assert .notNull (coordinates , "Document to convert does not contain coordinates" );
296
296
Assert .isTrue (coordinates instanceof List , "coordinates must be a List" );
@@ -322,7 +322,7 @@ public enum MapToGeoJsonMultiLineStringConverter implements Converter<Map<String
322
322
public GeoJsonMultiLineString convert (Map <String , Object > source ) {
323
323
324
324
String type = GeoConverters .getGeoJsonType (source );
325
- Assert .isTrue (type .equals (GeoJsonMultiLineString .TYPE ), "does not contain a type 'MultiLineString'" );
325
+ Assert .isTrue (type .equalsIgnoreCase (GeoJsonMultiLineString .TYPE ), "does not contain a type 'MultiLineString'" );
326
326
List <GeoJsonLineString > lines = geoJsonLineStringsFromMap (source );
327
327
return GeoJsonMultiLineString .of (lines );
328
328
}
@@ -350,7 +350,7 @@ public enum MapToGeoJsonPolygonConverter implements Converter<Map<String, Object
350
350
public GeoJsonPolygon convert (Map <String , Object > source ) {
351
351
352
352
String type = GeoConverters .getGeoJsonType (source );
353
- Assert .isTrue (type .equals (GeoJsonPolygon .TYPE ), "does not contain a type 'Polygon'" );
353
+ Assert .isTrue (type .equalsIgnoreCase (GeoJsonPolygon .TYPE ), "does not contain a type 'Polygon'" );
354
354
List <GeoJsonLineString > lines = geoJsonLineStringsFromMap (source );
355
355
Assert .isTrue (lines .size () > 0 , "no linestrings defined in polygon" );
356
356
GeoJsonPolygon geoJsonPolygon = GeoJsonPolygon .of (lines .get (0 ));
@@ -394,7 +394,7 @@ public enum MapToGeoJsonMultiPolygonConverter implements Converter<Map<String, O
394
394
public GeoJsonMultiPolygon convert (Map <String , Object > source ) {
395
395
396
396
String type = GeoConverters .getGeoJsonType (source );
397
- Assert .isTrue (type .equals (GeoJsonMultiPolygon .TYPE ), "does not contain a type 'MultiPolygon'" );
397
+ Assert .isTrue (type .equalsIgnoreCase (GeoJsonMultiPolygon .TYPE ), "does not contain a type 'MultiPolygon'" );
398
398
Object coordinates = source .get ("coordinates" );
399
399
Assert .notNull (coordinates , "Document to convert does not contain coordinates" );
400
400
Assert .isTrue (coordinates instanceof List , "coordinates must be a List" );
@@ -441,7 +441,8 @@ public enum MapToGeoJsonGeometryCollectionConverter
441
441
public GeoJsonGeometryCollection convert (Map <String , Object > source ) {
442
442
443
443
String type = GeoConverters .getGeoJsonType (source );
444
- Assert .isTrue (type .equals (GeoJsonGeometryCollection .TYPE ), "does not contain a type 'GeometryCollection'" );
444
+ Assert .isTrue (type .equalsIgnoreCase (GeoJsonGeometryCollection .TYPE ),
445
+ "does not contain a type 'GeometryCollection'" );
445
446
Object geometries = source .get ("geometries" );
446
447
Assert .notNull (geometries , "Document to convert does not contain geometries" );
447
448
Assert .isTrue (geometries instanceof List , "geometries must be a List" );
@@ -461,7 +462,7 @@ private static String getGeoJsonType(Map<String, Object> source) {
461
462
Assert .notNull (type , "Document to convert does not contain a type" );
462
463
Assert .isTrue (type instanceof String , "type must be a String" );
463
464
464
- return type .toString ();
465
+ return type .toString (). toLowerCase () ;
465
466
}
466
467
467
468
private static List <Double > toCoordinates (Point point ) {
0 commit comments