Good morning,
我已经在这工作了,无法看到m to figure out what's going on. I have a latitude/longitude in decimal degrees that I am trying to add to a feature service from a plugin that I am writing in the Pro SDK. The resultant point that is created is dropped in the incorrect location (see attachments). In the Java Runtime, I would just use CoordinateFormatter.fromLatitudeLongitude.
What did I miss?
Thanks,
Tim
Solved!Go to Solution.
Gary is correct, you have to change your shape's projection to match the projection of your layer:
var mapPointProjected = GeometryEngine.Instance.Project(newMapPoint, testLayer.GetSpatialReference());
then use mapPointProjected as the shape value in your attr dictionary.
I would suggest anytime that a feature is put in the wrong location, to check the coordinate system. I have seen many times when working with X, Y data initially the data being rendered in odd locations. Just about every time the issue is the coordinate system is not correct.
Gary is correct, you have to change your shape's projection to match the projection of your layer:
var mapPointProjected = GeometryEngine.Instance.Project(newMapPoint, testLayer.GetSpatialReference());
then use mapPointProjected as the shape value in your attr dictionary.
谢谢!解决我的问题,我认为specifying the SpatialReference in the CreateMapPoint was good enough.