Geoprocessing Area of Interest polygon is in the wrong coordinate system.

559
7
08-19-2013 09:29 AM
RobertMetzger
New Contributor
Hello,

I have a geoprocessing service that can do an Extract Data Task based off the "Clip and Ship" example. It works when run inside ArcMap, however, when running it from the service "Submit Job" web page, no features are returned unless the "Area of Interest" input field is entered using coordinates in meters (I got these coordinates from ArcMap). When drawing a similar polygon on my map using the javascript API, the coordinates for the polygon are much larger and I'm not sure what unit they are in. How do I convert them to meters to send to the geoprocessing service?

Thanks!
0 Kudos
7 Replies
SachinKanaujia
Occasional Contributor III
Hi,
I am not sure if I understood your question completely on the "drawing a similar polygon on my map using the javascript API". What is the spatial reference you are using? What data are you referencing in your clip and ship?
0 Kudos
RobertMetzger
New Contributor

What is the spatial reference you are using? What data are you referencing in your clip and ship?


The spatial reference in the .mxd is NAD 83. Pennsylvania polyconic with Datum NAD 83.


I am not sure if I understood your question completely on the "drawing a similar polygon on my map using the javascript API".


I have a web page that displays a map using the ESRI Javascript API. When I draw a polygon on the map, the rings have large coordinates.
Ex:  [-8549506.990583437, 4958634.316992373]

When I draw a similar polygon in ArcMap, the coordinates are much smaller.
Ex: [52989.647, -15185.816]
0 Kudos
MelitaKennedy
Esri Notable Contributor
Any chance you can post some sample coordinates from ArcMap (plus the data frame's coordinate system) and what you get in the Javascript app? My guess is either a feet vs meters issue and you're using state plane, or more likely, the web app is ending up in "web Mercator" aka EPSG:3857 / Esri:102100.

Melita
0 Kudos
RobertMetzger
New Contributor
Any chance you can post some sample coordinates from ArcMap (plus the data frame's coordinate system) and what you get in the Javascript app? My guess is either a feet vs meters issue and you're using state plane, or more likely, the web app is ending up in "web Mercator" aka EPSG:3857 / Esri:102100.

Melita


Here is the coordinate system information from ArcMap:

Pennsylvania Polyconic
Projection: Polyconic
Central_Meridian: -77.750000
Latitude_Of_Origin: 40.925000
Linear Unit: Meter

NAD 83
Datum: NAD 83



Here is the polygon information.

From ArcMap: [[102893.542, -40718.736], [184385.372, -117977.224], [26693.39, -106864.701], [102893.542, -40718.736]]

From Javascript: [[-8519849.423608808, 4946710.14057987], [-8415589.317027876, 4843061.530225221], [-8621357.797171494, 4861406.417013655], [-8519849.423608808, 4946710.14057987]]

The map's spatial reference in the javascript app is wkid 102100.
0 Kudos
SachinKanaujia
Occasional Contributor III
You are using different CRS in ArcMap and a different CRS in your Javascript same application. You can try changing the data frame properties in your ArcMap to use the same (Web mercator i.e. 102100)

When adding data ArcMap might ask you for the transformation. Choose the appropriate transformation or else go with default) and you should see the same coordinates then


Here is the coordinate system information from ArcMap:

Pennsylvania Polyconic
Projection: Polyconic
Central_Meridian: -77.750000
Latitude_Of_Origin: 40.925000
Linear Unit: Meter

NAD 83
Datum: NAD 83



Here is the polygon information.

From ArcMap: [[102893.542, -40718.736], [184385.372, -117977.224], [26693.39, -106864.701], [102893.542, -40718.736]]

From Javascript: [[-8519849.423608808, 4946710.14057987], [-8415589.317027876, 4843061.530225221], [-8621357.797171494, 4861406.417013655], [-8519849.423608808, 4946710.14057987]]

The map's spatial reference in the javascript app is wkid 102100.
0 Kudos
RobertMetzger
New Contributor
You are using different CRS in ArcMap and a different CRS in your Javascript same application. You can try changing the data frame properties in your ArcMap to use the same (Web mercator i.e. 102100)


In my javascript app I am also doing a FeatureLayer.selectFeatures and setting the query's geometry to a polygon drawn using the same tool I use to draw the polygon that is sent to the geoprocessing service. The selectFeatures works even though the coordinate system in ArcMap is different than the javascript app. Why does it work for the query but not the geoprocessing service?

Are the "Output Spatial Reference" and "Process Spatial Reference" environment options (for the geoprocessing service) supposed to fix my coordinate system issue?
0 Kudos
RobertMetzger
New Contributor
I switched the coordinate system of the MXD to WGS 1984 Web Mercator (Auxiliary Sphere). I then re-added the Extract Data Task and published the Geoprocessing service using the new MXD. The Geoprocessing service is still not working.
0 Kudos