In the following code sample, why does point2/s2 change its values after being projected, but point4/s4 does not?
How do I get point4's coordinates to change?
The transformation property is null for both projTrans1 and projTrans3.
Thanks!
QueuedTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Run</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">string</SPAN> wkt1 <SPAN class="operator token">=</SPAN> <SPAN class="string token">"GEOGCS[\"GCS_WGS_1984\", DATUM[\"D_WGS_1984\", SPHEROID[\"WGS_1984\", 6378137.0, 298.257223563]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"Grad\", 0.01570796326794897]]"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> wkt2 <SPAN class="operator token">=</SPAN> <SPAN class="string token">"GEOGCS[\"GCS_WGS_1984\", DATUM[\"D_WGS_1984\", SPHEROID[\"WGS_1984\", 6378137.0, 298.257223563]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"Degree\", 0.0174532925199433]]"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> wkt3 <SPAN class="operator token">=</SPAN> <SPAN class="string token">"GEOGCS[\"GCS_WGS_1984\", DATUM[\"D_WGS_1984\", SPHEROID[\"WGS_1984\", 6378137.0, 298.257223563]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"Degree\", 0.0174532925199433]],"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"VERTCS[\"WGS_1984\", DATUM[\"D_WGS_1984\", SPHEROID[\"WGS_1984\", 6378137.0, 298.257223563]], PARAMETER[\"Vertical_Shift\", 0.0], PARAMETER[\"Direction\", 1.0], UNIT[\"Yard\", 0.9144]]"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> wkt4 <SPAN class="operator token">=</SPAN> <SPAN class="string token">"GEOGCS[\"GCS_WGS_1984\", DATUM[\"D_WGS_1984\", SPHEROID[\"WGS_1984\", 6378137.0, 298.257223563]], PRIMEM[\"Greenwich\", 0.0], UNIT[\"Degree\", 0.0174532925199433]],"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"VERTCS[\"WGS_1984\", DATUM[\"D_WGS_1984\", SPHEROID[\"WGS_1984\", 6378137.0, 298.257223563]], PARAMETER[\"Vertical_Shift\", 0.0], PARAMETER[\"Direction\", 1.0], UNIT[\"Meter\", 1.0]]"</SPAN><SPAN class="punctuation token">;</SPAN>
SpatialReference pSR1 <SPAN class="operator token">=</SPAN> SpatialReferenceBuilder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateSpatialReference</SPAN><SPAN class="punctuation token">(</SPAN>wkt1<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
SpatialReference pSR2 <SPAN class="operator token">=</SPAN> SpatialReferenceBuilder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateSpatialReference</SPAN><SPAN class="punctuation token">(</SPAN>wkt2<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
SpatialReference pSR3 <SPAN class="operator token">=</SPAN> SpatialReferenceBuilder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateSpatialReference</SPAN><SPAN class="punctuation token">(</SPAN>wkt3<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
SpatialReference pSR4 <SPAN class="operator token">=</SPAN> SpatialReferenceBuilder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateSpatialReference</SPAN><SPAN class="punctuation token">(</SPAN>wkt4<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MapPoint point1 <SPAN class="operator token">=</SPAN> MapPointBuilder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateMapPoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">10</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">20</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">300</SPAN><SPAN class="punctuation token">,</SPAN> pSR1<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MapPoint point3 <SPAN class="operator token">=</SPAN> MapPointBuilder<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateMapPoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">10</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">20</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">300</SPAN><SPAN class="punctuation token">,</SPAN> pSR3<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ProjectionTransformation projTrans1 <SPAN class="operator token">=</SPAN> ProjectionTransformation<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Create</SPAN><SPAN class="punctuation token">(</SPAN>pSR1<SPAN class="punctuation token">,</SPAN> pSR2<SPAN class="punctuation token">,</SPAN> point1<SPAN class="punctuation token">.</SPAN>Extent<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ProjectionTransformation projTrans3 <SPAN class="operator token">=</SPAN> ProjectionTransformation<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateWithVertical</SPAN><SPAN class="punctuation token">(</SPAN>pSR3<SPAN class="punctuation token">,</SPAN> pSR4<SPAN class="punctuation token">,</SPAN> point3<SPAN class="punctuation token">.</SPAN>Extent<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MapPoint point2 <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>MapPoint<SPAN class="punctuation token">)</SPAN>GeometryEngine<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ProjectEx</SPAN><SPAN class="punctuation token">(</SPAN>point1<SPAN class="punctuation token">,</SPAN> projTrans1<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MapPoint point4 <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>MapPoint<SPAN class="punctuation token">)</SPAN>GeometryEngine<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ProjectEx</SPAN><SPAN class="punctuation token">(</SPAN>point3<SPAN class="punctuation token">,</SPAN> projTrans3<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> s2 <SPAN class="operator token">=</SPAN> $<SPAN class="string token">"X: {point2.X} Y: {point2.Y} Z: {point2.Z} M: {point2.M}"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> s4 <SPAN class="operator token">=</SPAN> $<SPAN class="string token">"X: {point4.X} Y: {point4.Y} Z: {point4.Z} M: {point4.M}"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// s2 = "X: 9 Y: 18 Z: 300 M: NaN"</SPAN>
<SPAN class="comment token">// s4 = "X: 10 Y: 20 Z: 300 M: NaN"</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>