Select to view content in your preferred language

MapPoint new spatial reference for Coordinates

3060
8
Jump to solution
04-30-2013 10:01 PM
JoeHewitt
Regular Contributor
Hi,

I am trying to display a set of false eastings and false northings alongside my already displayed coordinates which are in degrees.

I had hoped by creating a new MapPoint in my mousemoveHandler inside my coordinates widget

var eastnorth:MapPoint = map.toMapFromStage(event.stageX, event.stageY);


And then setting a new spatial reference

 eastnorth.spatialReference = new SpatialReference(28351);


it would update this change and instead of displaying in degrees change it into False eastings which is the correct output unit for spatial reference 28351, however it accepts the change to the spatial reference but almost like the spatial reference value has nothing to do with the coordinates the MapPoint will display as it stays in degrees.

Can anyone offer any help?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JoeHewitt
Regular Contributor
Also if you are good at geometry then you can do the reprojection calculations clientside by writing all the geometry code yourself to do the conversion from what ever WKID you map is in to your desired coordinates. I personally am not a math genious so can not guide you in any of this, but it may be what the people at the site you posted did.


This was unfortunately the path I had to follow. Took me a while and fortunately I was able to follow an excel sheet with the projection calculation in it, so it just required me to track the long path of excel cells with each stage of the calculation and then write this into my code. Those transformation equations are truely something else....



Thanks for your help everyone.

View solution in original post

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
Joe,

   A Map Point does not get reprojected on the client just because you set a different spatial reference. You will have to send the map point to a geometry service to have it re-projected if you are not asking for the point in WebMercator (WebMercator to Geographic and geographic to WebMercator are the only client side supported re-projections).

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos
AnthonyGiles
Honored Contributor
Joe,

My guess is that the response time from sending the request to the server would not be quick enough to dynamically show the reprojected values on mouse move

Regards

Anthony
0 Kudos
JoeHewitt
Regular Contributor
Thanks guys,

not what I was hoping to hear.

If you take a look at this example here https://sarig.pir.sa.gov.au/Map

You can see at the bottom left of the screen there are two different types of coordinates being displayed. DMS which would be done by geographicToDMS. But there is the false eastings and false northings being displayed dynamically on mouse over without any geometry being displayed.  These false eastings and northings also updating into the correct local coordinate zone as you move the mouse.


So there must be some way to define coordinates from multiple spatial references with a mouse move event.

I'm presuming a solution could be to create my own transformation function with the projection paramaters so I can project my degrees into the false eastings/northings. But this would be annoying as flex already knows these coordinate systems so should be able to do the work for me.
0 Kudos
RhettZufelt
MVP Notable Contributor
Joe,

Just so that you are clear, if your map is in your wkid, then the coordinates diplayed by the coordinate widget will be in your map wkid system.

I'm guessing that you are using ESRI or Bing basemaps so your wkid is being set to web mercator?

If you don't need the ESRI basemaps and have basemaps of your own, set it to use them and you will get the coordinates that you want.   You could still load ESRI basemaps if needed, but only as dynamic, which slows them down quite a bit.

In case this helps,

R_
0 Kudos
JoeHewitt
Regular Contributor
Hi rhett,

Would it be possible to have a basemap that is made up of different tiles with different wkids, so on mouseover im displaying the coordinates of that local coordinate system?
0 Kudos
RhettZufelt
MVP Notable Contributor
Joe,

"Tiles" are pre-rendered in the spatial reference of the service and can't be on the fly projected, so if using tiled services, they all need to be in the same wkid.

whatever wkid the map is in is what the coordinate tool displays on mouse over.

I have all the base civil layers for my area, and imagery for several years that I have created my own basemaps with. I also download the NAIP imagery, convert to my SR and publish as a service.  This way, "most" of my basemaps are all in my State Plane coordinate system, and thus, that is the real time coordinates displayed by coordinate widget.
I do on occasion have the need to load someone elses service as one of my basemap options that is in a different wkid.   I have to load it as type="dynamic", otherwise the "tiles" are in the wrong location.  This makes it load slower than it would tiled, but it works.

Seems I remeber a thread about programatically changing wkid on basemap switch in order to use different tiled basemaps in the same FV app, but even then, the coordinates displayed would be of the "current" wkid.

Other than that, the only way I know to "cheat" is to set your SR in ArcMap to your local, load the service that you need (that is in different wkid) and save map, then right click in ArcCatalog and publish to service (not supported as msd).  Then, if you load that service into your FV, it will see it as your local SR, but will be slower to load.  However, if you are running AGS 10.1, you don't have this option, version 10 is that last one that lets you publish service as mxd.

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Also if you are good at geometry then you can do the reprojection calculations clientside by writing all the geometry code yourself to do the conversion from what ever WKID you map is in to your desired coordinates. I personally am not a math genious so can not guide you in any of this, but it may be what the people at the site you posted did.
0 Kudos
JoeHewitt
Regular Contributor
Also if you are good at geometry then you can do the reprojection calculations clientside by writing all the geometry code yourself to do the conversion from what ever WKID you map is in to your desired coordinates. I personally am not a math genious so can not guide you in any of this, but it may be what the people at the site you posted did.


This was unfortunately the path I had to follow. Took me a while and fortunately I was able to follow an excel sheet with the projection calculation in it, so it just required me to track the long path of excel cells with each stage of the calculation and then write this into my code. Those transformation equations are truely something else....



Thanks for your help everyone.
0 Kudos