Skip to content

Commit 42c9b56

Browse files
committed
find geometry type by name
1 parent 31ac300 commit 42c9b56

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main/java/mil/nga/sf/GeometryType.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,23 @@ public static GeometryType fromName(String name) {
133133
return valueOf(name.toUpperCase(Locale.US));
134134
}
135135

136+
/**
137+
* Find the Geometry Type from the name if it exists, ignoring case
138+
*
139+
* @param name
140+
* name
141+
* @return geometry type or null
142+
* @since 2.0.2
143+
*/
144+
public static GeometryType findName(String name) {
145+
GeometryType type = null;
146+
for (GeometryType geometryType : GeometryType.values()) {
147+
if (geometryType.name().equalsIgnoreCase(name)) {
148+
type = geometryType;
149+
break;
150+
}
151+
}
152+
return type;
153+
}
154+
136155
}

0 commit comments

Comments
 (0)