Converting GPS coordinate to mobile cache  Spatial Ref

711
2
09-12-2012 04:51 PM
KetanPatel
New Contributor
Hi,

I have a simple form with 2 textboxes in which I am showing GPS locatin in DD.
that thing works fine but, when I try to convert that GPS location to mobile cache spatialreference system the GPS is not connecting at all.. and getting time out error.

here is my working code,

txtLat.Text = mGpsConn.Latitude.ToString();
txtLong.Text = mGpsConn.Longitude.ToString();

here is the code for converting the GPS coordinate

Coordinate coordinate = new Coordinate();
coordinate = mobileCache1.SpatialReference.FromGps(mGpsConn.Longitude,mGpsConn.Latitude);

txtLat.Text = coordinate.Y
txtLong.Text = coordinate.X

Regards,
0 Kudos
2 Replies
IndraBisen
New Contributor III
Hi,

try with changing FromGPS to FromWGS84() as following code because by default GPS returns data in WGS84 datum.


Coordinate coordinate = new Coordinate();
coordinate = mobileCache1.SpatialReference.FromWgs84(mGpsConn.Longitude,mGpsConn.Latitude);

txtLat.Text = coordinate.Y
txtLong.Text = coordinate.X



regards

Indra Bisen
0 Kudos
KetanPatel
New Contributor
Hi Indra,

I did try that but still same thing.. GPS connection is getting time out error.
any alternative to do this thing.

Regards,
0 Kudos