diff --git a/Assets/_Functionalities/Wms/Scripts/WMSImportAdapter.cs b/Assets/_Functionalities/Wms/Scripts/WMSImportAdapter.cs index 6ad1edfe..33a3052f 100644 --- a/Assets/_Functionalities/Wms/Scripts/WMSImportAdapter.cs +++ b/Assets/_Functionalities/Wms/Scripts/WMSImportAdapter.cs @@ -85,16 +85,9 @@ public void Execute(LocalFile localFile) if (sourceUrl.ToLower().Contains("version=")) { wmsVersion = sourceUrl.ToLower().Split("version=")[1].Split("&")[0]; - string[] numbers = wmsVersion.Split('.'); - int major = int.Parse(numbers[0]); - int minor = int.Parse(numbers[1]); - int revision = int.Parse(numbers[2]); - int targetMajor = 1; - int targetMinor = 3; - int targetRevision = 0; - bool isHigherOrEqualVersion = (major > targetMajor) || - (major == targetMajor && minor >= targetMinor) || - (major == targetMajor && minor == targetMinor && revision >= targetRevision); + Version version = Version.Parse(wmsVersion); + wmsVersion = version.ToString(); + bool isHigherOrEqualVersion = version >= Version.Parse(defaultFallbackVersion); coordinateSystemType = isHigherOrEqualVersion ? "CRS" : "SRS"; coordinateSystemReference = defaultCoordinateSystemReference; }