@@ -271,11 +271,16 @@ class SpatialObjectsService {
271
271
} else if (" kml" == geomtype) {
272
272
String wktString = l. get(0 ). geometry. toText()
273
273
String wkttype = " POLYGON"
274
- if (wktString. contains (" MULTIPOLYGON" )) {
274
+ if (wktString. startsWith (" MULTIPOLYGON" )) {
275
275
wkttype = " MULTIPOLYGON"
276
- } else if (wktString. contains (" GEOMETRYCOLLECTION" )) {
276
+ } else if (wktString. startsWith (" GEOMETRYCOLLECTION" )) {
277
277
wkttype = " GEOMETRYCOLLECTION"
278
+ } else if (wktString. startsWith(" MULTIPOINT" )) {
279
+ wkttype = " MULTIPOINT"
280
+ } else if (wktString. startsWith(" POINT" )) {
281
+ wkttype = " POINT"
278
282
}
283
+
279
284
final SimpleFeatureType TYPE = SpatialConversionUtils . createFeatureType(wkttype)
280
285
SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder (TYPE )
281
286
featureBuilder. add(l. get(0 ). geometry)
@@ -296,10 +301,14 @@ class SpatialObjectsService {
296
301
297
302
String wktString = l. get(0 ). geometry. toText()
298
303
String wkttype = " POLYGON"
299
- if (wktString. contains (" MULTIPOLYGON" )) {
304
+ if (wktString. startsWith (" MULTIPOLYGON" )) {
300
305
wkttype = " MULTIPOLYGON"
301
- } else if (wktString. contains (" GEOMETRYCOLLECTION" )) {
306
+ } else if (wktString. startsWith (" GEOMETRYCOLLECTION" )) {
302
307
wkttype = " GEOMETRYCOLLECTION"
308
+ } else if (wktString. startsWith(" MULTIPOINT" )) {
309
+ wkttype = " MULTIPOINT"
310
+ } else if (wktString. startsWith(" POINT" )) {
311
+ wkttype = " POINT"
303
312
}
304
313
final SimpleFeatureType TYPE = SpatialConversionUtils . createFeatureType(wkttype)
305
314
SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder (TYPE )
0 commit comments