Geometry Service

396
1
Jump to solution
05-24-2021 11:32 AM
EricHermoso
New Contributor

I am using GeometryService version 4.0 to convert state plane coordinates to geodetic position. But I am receiving timeout exceeded error.  I have 400 points that I want to convert to geodetic position but I was only able to get about 50 points converted. When I use ESRI geometry projection service version 4.7 it works. Since we are currently using the version 4.0 is there a way to convert all 400 points without timing out.

 

Code Sample:

require(["esri/geometry/projection", "esri/geometry/SpatialReference","esri/geometry/Multipoint","esri/tasks/GeometryService","esri/tasks/support/ProjectParameters","esri/geometry/Point"], function(ProjectParametersSample, SpatialReferenceSample,MultipointSample,GeometryServiceSample,TaskSupportProjectParameters,SinglePointService) {

var outSpatialReference = new SpatialReferenceSample({
wkid: 4326
});
var count = 0
//var geometryService = new GeometryServiceSample("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); // https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServe
sdfs.forEach(function(point){
// console.log(point[0])
// console.log(point[1])
var geometryService = new GeometryServiceSample("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
var inpoint = new SinglePointService(point[0],point[1],new SpatialReferenceSample({wkid:2230}))
var params = new TaskSupportProjectParameters({
geometries: [inpoint],
outSpatialReference: outSpatialReference,
});

var geometryServiceProject = geometryService.project(params).then(function(resultL){
console.log(count += 1)


})
})
});

0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor

@EricHermoso it's difficult to say since version 4.0 has been retired. We are currently on version 4.19, and we recommend using the latest version for production applications as much as possible.

https://support.esri.com/en/products/developers/web-apis/arcgis-api-for-javascript#product-support

 

View solution in original post

1 Reply
Noah-Sager
Esri Regular Contributor

@EricHermoso it's difficult to say since version 4.0 has been retired. We are currently on version 4.19, and we recommend using the latest version for production applications as much as possible.

https://support.esri.com/en/products/developers/web-apis/arcgis-api-for-javascript#product-support