j.buchtaesri-de-esridist

GeometryEngine.Project() Arguments

Discussion created by j.buchtaesri-de-esridist Employee on Jul 13, 2017
Latest reply on Jul 19, 2017 by mnielsen-esristaff

What do you think about this API method?

public static Geometry GeometryEngine.Project(Geometry geometry, SpatialReference spatialReference)

In my opinion, this method is to generic and involves to many casts when it's used, e.g.

var mapPoint = new MapPoint(...)
var projectedPoint = (MapPoint)GeometryEngine.Project(mapPoint, anySpatialReference);

If we had a finite list of supported overloads, like:

public static MapPoint GeometryEngine.Project(MapPoint mapPoint, SpatialReference sr) {}
public static LineSegment GeometryEngine.Project(LineSegment lineSegment, SpatialReference sr) {}
public static Polygon GeometryEngine.Project(Polygon polygon, SpatialReference sr) {}
...

...use of the API would be easier and more clear.

 

What do you think about this?

Outcomes