Different spatial reference issue with Geoprocessing in leaflet

1489
4
Jump to solution
08-15-2017 01:25 AM
Labels (1)
A_S_
by
New Contributor II

Hi, I’m building a web map with ArcGIS Server, Leaflet and Esri-Leaflet.

Now I’m trying to add a standard geoprocess out of the ArcToolbox (Select Layer by Attribute) but I’m having a problem with the output spatial reference system.

 

All my data on the Server is in ETRS_1989 and for the web map its transformed into EPSG 4326. Starting my geoprocess replays me data in ERTS_1989, so I changed in ArcMap the “Output Coordinates” in Environment Settings before publishing the service, but that didn’t change anything, services still replays in ERTS_1989.

 

The only way to change that behaviour is using the ArcGIS Server Manager via my browser, guide through Home > services > SelectLayerByAttribute (GPServer) > Select Layer By Attribute > subitmitJob to: Options – Output Spatial Reference and write down 4326 there. This allows me to get back data in 4326 for all future tasks, but only for that one layer I was asking for, all other layers still replay with ETRS_1989.

 

So is there a way how I can handle that problem? Because I don’t want to change the output spatial reference for each layer by hand using the browser server manager.

Do I have to do something more as described above before publishing that service or is there a way to change output coordinate system with leaflet? I saw that there is a method in ArcGIS Java Script API but I didn’t see something similar in Esri-Leaflet.

 

Thanks for your help in advance. Let me know, if you need more information to help me.

0 Kudos
1 Solution

Accepted Solutions
A_S_
by
New Contributor II

Thank's for your help, but I have the solution. Damn!! Didn't know that there is a simple way by using: gpTask.setParam('env:outSR', 4326);

View solution in original post

4 Replies
JohnGravois
Frequent Contributor

can you publish a simplified public GP service (perhaps with dummy data) and share some steps to get it to return data in both coordinate systems please? that would really speed up troubleshooting.

0 Kudos
A_S_
by
New Contributor II

Thank you for your fast answer. I'm not a server admin and after requesting to publish a public GP service I'm not allowed to do this. Would it be helpful to load some screens of GP creation? Maybe I forget only a button or something else. Anyway, if you have tips or ideas for trouble shooting this would be also helpful for me.

0 Kudos
A_S_
by
New Contributor II

Thank's for your help, but I have the solution. Damn!! Didn't know that there is a simple way by using: gpTask.setParam('env:outSR', 4326);

JohnGravois
Frequent Contributor

glad to hear it! thanks for taking the time to share.

0 Kudos