Source:
private static JSONObject getFeatureTypeFields(OskariLayer layer) throws ServiceException { final JSONObject response = WFSDescribeFeatureHelper.getWFSFeaturePropertyTypes(layer, String.valueOf(layer.getId())); final Set<String> geometryPropertyTypes = new HashSet<>( Arrays.asList( "GeometryPropertyType", "PointPropertyType", "LinePropertyType", "PolygonPropertyType", "MultiPointPropertyType", "MultiLinePropertyType", "MultiPolygonPropertyType" ) ); final Set<String> stringTypes = new HashSet<>(Arrays.asList("string", "date", "time")); final Set<String> numericTypes = new HashSet<>(Arrays.asList("decimal", "int", "integer", "float", "double")); final Set<String> booleanTypes = new HashSet<>(Arrays.asList("boolean")); try { final JSONObject propertyTypes = response.getJSONObject("propertyTypes"); final Iterator<?> attributeNames = propertyTypes.keys(); final JSONObject attributes = new JSONObject(); final JSONObject result = new JSONObject(); while (attributeNames.hasNext()) { String attributeName = (String) attributeNames.next(); String attributeType = propertyTypes.getString(attributeName); attributeType = attributeType.split(":")[1]; if (geometryPropertyTypes.contains(attributeType)) { result.put(GEOMETRY_FIELD_KEY, attributeName); } else if (stringTypes.contains(attributeType)) { attributes.put(attributeName, STRING); } else if (numericTypes.contains(attributeType)) { attributes.put(attributeName, NUMBER); } else if (booleanTypes.contains(attributeType)) { attributes.put(attributeName, BOOLEAN); } else { attributes.put(attributeName, UNKNOWN); } } result.put(ATTRIBUTES_KEY, attributes); return result; } catch (JSONException ex) { throw new ServiceException("Couldn't parse the result", ex); } }

Target:
private static JSONObject getFeatureTypeFields(OskariLayer layer) throws ServiceException { final JSONObject response = WFSDescribeFeatureHelper.getWFSFeaturePropertyTypes(layer, String.valueOf(layer.getId())); final Set<String> geometryPropertyTypes = new HashSet<>( Arrays.asList( "GeometryPropertyType", "PointPropertyType", "LinePropertyType", "PolygonPropertyType", "MultiPointPropertyType", "MultiLinePropertyType", "MultiPolygonPropertyType" ) ); final Set<String> stringTypes = new HashSet<>(Arrays.asList("string", "date", "time")); final Set<String> numericTypes = new HashSet<>(Arrays.asList("decimal", "int", "integer", "float", "double")); final Set<String> booleanTypes = new HashSet<>(Arrays.asList("boolean")); try { final JSONObject propertyTypes = response.getJSONObject("propertyTypes"); final Iterator<?> attributeNames = propertyTypes.keys(); final JSONObject attributes = new JSONObject(); final JSONObject result = new JSONObject(); while (attributeNames.hasNext()) { String attributeName = (String) attributeNames.next(); String attributeType = propertyTypes.getString(attributeName); attributeType = attributeType.contains(":") ? attributeType.split(":")[1] : attributeType; if (geometryPropertyTypes.contains(attributeType)) { result.put(GEOMETRY_FIELD_KEY, attributeName); } else if (stringTypes.contains(attributeType)) { attributes.put(attributeName, STRING); } else if (numericTypes.contains(attributeType)) { attributes.put(attributeName, NUMBER); } else if (booleanTypes.contains(attributeType)) { attributes.put(attributeName, BOOLEAN); } else { attributes.put(attributeName, UNKNOWN); } } result.put(ATTRIBUTES_KEY, attributes); return result; } catch (JSONException ex) { throw new ServiceException("Couldn't parse feature property types response", ex); } }