How use AGSGPS  not in WGS84 MapServer?

615
4
04-11-2012 12:23 AM
ZhaoMingJin
New Contributor II
My MapServer is not WGS84,how use AGSGPS?
0 Kudos
4 Replies
NimeshJarecha
Esri Regular Contributor
Could you please elaborate your question?

1. Do you have base layer which is not in WGS84? But you want to use AGSGPS?
2. Do you expect AGSGPS points in WGS84 or base layer's spatial reference?

Regards,
Nimesh
0 Kudos
ZhaoMingJin
New Contributor II
Could you please elaborate your question?

1. Do you have base layer which is not in WGS84? But you want to use AGSGPS?
2. Do you expect AGSGPS points in WGS84 or base layer's spatial reference?

Regards,
Nimesh


1.Yes,My base layer is not in WGS84,and I want use AGSGPS.

2.Yes,but the AGSGPS is only use in  spatial reference WGS84.

ps: My English is not very good
0 Kudos
NimeshJarecha
Esri Regular Contributor
If you read current point of the GSP from self.mapView.gps.currentPoint then it'll be in map's spatial reference (base layer's spatial reference).

Let me know if this is what you wanted.

Regards,
Nimesh
0 Kudos
by Anonymous User
Not applicable
My MapServer is not WGS84,how use AGSGPS?


The AGSGPS will return WGS84 as you probably figure it out as is a GPS coordinate from Apple's SDK. If you are using another coordinate system layer, you'll have to reproject the results of AGSGPS to your layer.

This is a sample using AGSGPS to a WebMercator

AGSSpatialReference *referenceGPS = [[AGSSpatialReference alloc] initWithWKID:4326];
    //Grab the location point
    AGSPoint *gpsPoint = [[AGSPoint alloc] initWithX:newLocation.coordinate.longitude y:newLocation.coordinate.latitude spatialReference:referenceGPS];
   
    //Reproject to the new layer   
    AGSPoint *webMercatorPoint = (AGSPoint*) [[AGSGeometryEngine defaultGeometryEngine] projectGeometry:(AGSGeometry*)gpsPoint                                                                  toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]];

Now you can add the webMercatorPoint to your graphics layer or feature layer.

Hope this helps
Cheers
Al
0 Kudos