Select to view content in your preferred language

Reproject point error

839
1
Jump to solution
10-01-2013 08:21 AM
GianfrancoOliva
Emerging Contributor
Hello,

I'm trying to reproject a point WGS84  UTM ZONE 17 to Web Mercator as follows:

var point     = new esri.geometry.Point([este,norte],new esri.SpatialReference({ wkid:zona_utm }));  var params_proj = new esri.tasks.ProjectParameters(); params_proj.geometries = [point]; params_proj.outSR = new esri.SpatialReference({ wkid: 102100}); params_proj.transformation = { wkid: null };              geometryService.project(params_proj, function(out_point) {                          console.log(out_point); });

Query String Parameters:
[HTML]
f:json
outSR:102100
inSR:32717
geometries:{"geometryType":"esriGeometryPoint","geometries":[{"x":"724892.5906","y":"9152681.3875","spatialReference":{"wkid":"32717"}}]}
transformation:{"wkid":null}
callback:dojo.io.script.jsonp_dojoIoScript4._jsonpCallback
[/HTML]

The Error:

[HTML]
dojo.io.script.jsonp_dojoIoScript4._jsonpCallback({"error":{"code":400,"message":"Unable to complete Project operation.","details":["The specified geometry is not in the correct format."]}});
[/HTML]

Please ask your help.
thanks
0 Kudos
1 Solution

Accepted Solutions
BenFousek
Deactivated User
WKID is an number and not a string. Whatever the zona_utm variable is, it's a string. You can see this in the request parameters.

Bad request
{"wkid":"32717"}

Good request
{"wkid":32717}


parseInt() to get an number.
var wkid = parseInt(zona_utm);  var point = new esri.geometry.Point([este,norte],new esri.SpatialReference({ wkid: wkid }));

View solution in original post

0 Kudos
1 Reply
BenFousek
Deactivated User
WKID is an number and not a string. Whatever the zona_utm variable is, it's a string. You can see this in the request parameters.

Bad request
{"wkid":"32717"}

Good request
{"wkid":32717}


parseInt() to get an number.
var wkid = parseInt(zona_utm);  var point = new esri.geometry.Point([este,norte],new esri.SpatialReference({ wkid: wkid }));
0 Kudos