Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamically finding crs nodes from xml if matching with preferred crs. if not but has nodes then take first available node from xml. if none apply take our first preferred crs #416

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

bozmir
Copy link
Contributor

@bozmir bozmir commented Feb 17, 2025

No description provided.

…. if not but has nodes then take first available node from xml. if none apply take our first preferred crs
@@ -105,6 +105,18 @@ protected string GetInnerTextForNode(XmlNode layerNode, string nodeName, bool se
}
}

//protected XmlNodeList GetNodesByName(XmlNode layerNode, string nodeName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overbodige code?

}
if (string.IsNullOrEmpty(spatialReference))
{
spatialReference = crsNodes[0].InnerText;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dit geeft niet de eerste ondersteunde CRS terug maar de eerste in de set crsNodes, zie AC 3. Dit kan een ongeldige situatie opleveren

string spatialReference = null;
var spatialReferenceType = MapFilters.SpatialReferenceTypeFromVersion(new Version(mapTemplate.version));
XmlNodeList crsNodes = GetNodesByName(mapNode, spatialReferenceType);
if (crsNodes.Count > 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Als je dit in een methode plaatst dan kan dat leesbaarder en kan je het gebruik van GOTO vermijden omdat je op die plek een return kan doen. Tevens kan het nesting niveau omlaag door het gebruik van early return


@mvriel mvriel merged commit 70cf1a9 into main Feb 18, 2025
4 checks passed
@mvriel mvriel deleted the feature/wms-crs-voorkeur-coordinatenstelsels branch February 18, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants