Converting Point From A Projected Coordinate System to A Geographic Coordinate System

1480
8
Jump to solution
01-24-2019 01:43 AM
bobongubza
New Contributor II

I have successfully used the "esri/tasks/support/ProjectParameters" and "esri/tasks/GeometryService"

Classes to project a point from a Geographic Coordinate System (wkid: 4326 and wkid: 4148) to a Projected Coordinate System (wkid: 102482 and also wkid: 102100). The results are correct.


However, when I try to convert the point from the Projected Coordinate system to the Geographic Coordinate System, the results are horrendously incorrect. I was hoping someone can explain to me how to fix this issue I'm currently struggling with.

I am using arcgis javascript 4.10

0 Kudos
1 Solution

Accepted Solutions
MelitaKennedy
Esri Notable Contributor

If the lat-lon coordinates are coming out completely wrong, and not just off a few hundred meters, I suspect that it's to due with the south-orientated transverse Mercator. For instance, if you have Lo coordinates, using a negative scale factor in the projected CRS definition will flip them into the east-north system that ArcGIS supports from Lo's southing-westing. You might try negating the input x,y coordinates, then using Lo with a positive scale factor when unprojecting them.

Melita

View solution in original post

8 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Do you mean reversing the process on the projected file doesn't work?

0 Kudos
bobongubza
New Contributor II

Yes and I cannot figure out why. I am at a point of manually coding the transformation between the coordinate system.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Bobo,

  Going from 4326 to 102100 is very easy using the webMercatorUtils class geographicToWebMercator method

webMercatorUtils | API Reference | ArcGIS API for JavaScript 4.10 

Do you have to use a transformation in ArcMap to convert wkid 102482 to wkid 4326? If so then you need to add that transformation wkid to the ProjectParameters.

0 Kudos
bobongubza
New Contributor II

I am using solely on arcgis javascript. The website that I am designing has to allow people to enter coordinates in Gauss Conform (Transverse Mercator south oriented) coordinate system and convert them to GCS haartebeesthoek 94.

So my parameters are as follows:

projectParameter = new ProjectParameters()

projectParameter.geometries =  new Point({x: value, y: value, new spatialReference({wkid:102482}))

projectParameter.outSpatialReference = new SpatialReference({"wkid": 4148})

honestly I don't what this two parameters, projectParameter.transformation  and projectParameter.transformforward assist with, with regards to the projection.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Bobo,

   So you have no experience working with projecting coordinates for your location in ArcGIS Desktop? Do you have a co-worker that does? The issue is you likely need a transformation applied and I can not guide you there as I am not familiar with your location and projections and transformations need for your location.

Maybe a projections expert like Melita Kennedy‌ can weight in about that transformation is needed.

0 Kudos
bobongubza
New Contributor II

With ArcGIS Desktop I constantly do transformations due to the fact that I sometimes deal with survey data which uses a coordinate system that is local to South Africa, thus converting it to geographic coordinates of WGS84 is often done.

But no worries I studied coordinate system transformation and it was focused on the coordinate systems I want to transform so I'll look through my past lecture notes and just write an algorithm that will do the transformations.

Thanks Robert

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

There is no need to go through that effort All you need to do is know the wkid of the transform you use when you do this in desktop and add that to the projection parameters transformation property.

0 Kudos
MelitaKennedy
Esri Notable Contributor

If the lat-lon coordinates are coming out completely wrong, and not just off a few hundred meters, I suspect that it's to due with the south-orientated transverse Mercator. For instance, if you have Lo coordinates, using a negative scale factor in the projected CRS definition will flip them into the east-north system that ArcGIS supports from Lo's southing-westing. You might try negating the input x,y coordinates, then using Lo with a positive scale factor when unprojecting them.

Melita