ThinkGeo.com    |     Documentation    |     Premium Support

Scalebar unit

Hi,


How to set the scale bar unit to nautical miles? I set the scalebar unitfamily to UnitSystem.Metric, it displays the scale in KM. I want to give the user an option list like :m, km, nm etc, so the user can choose what unit is used on the scalrbar. Is this possible?


Thanks


Rose



Rose, 
  
 we are going to look inti this.  I think Otis possible for us to offer you a user defined unti.  You would tell us how many meters fit into your defined unit.  I will get back with you soon.  Please bump this post to keep it alive. 
  
 David

Posted By David on 10-07-2009 02:01 PM 

Rose, 



we are going to look inti this. I think Otis possible for us to offer you a user defined unti. You would tell us how many meters fit into your defined unit. I will get back with you soon. Please bump this post to keep it alive. 



David 



David:

 


Thanks very much for your quick response!


I think 1000 meters is okay to fit into our defined unit. The options we like to provide to the client are: m, mi,km,nmi.


Another question related to this, also has something to do with the coordinate system. In my application, I used World Mercator projection and the map unit is set to meter. The scalebar is supposed to work in this environment. But it gives different distances between two cities compared with the real map scale which is also in World Mercator projection.


In my application I have a ruler tool which measurs the distance between two points. here is how I did, once I get the two points coordinate in meters , I converted them to decimal degrees, then calculated the distance using the fomular in the following link, it gives me the same distance as the real map.


movable-type.co.uk/scripts/latlong.html


How can I modify the scale numbers on the scalebar to match above conversion?


Thanks in advance!


Rose



Rose, 
  
   I wanted to update you on this post.  We have been looking into the Haversine method and identifying the places it would need to be changed. While this change is relatively small it impacts many things and we have lots of test cases that will need to be updated.  We are looking into if we can change this before the next refresh on the 21st.  I personally would like to and think we can do it.  Currently we are using the spherical law of cosines which is not as good as Haversine so that is where you see the differences I think.  In our testing is can be off around 1 in 10 or more depending on the scale and location. 
  
   On the other front dealing with the nautical miles and scale bars we have a different approach from what I thought.  The scale bar and scale line that we have now would need quite a bit of re-work to get nautical miles in as our distance unit doesn’t support it.  Not that it is not possible but I am not sure the expect of the work at first glance.  What we are going to do instead is to create a new scale line that is very flexible and offer it and all of its code on the code.thinkgeo.com site.  In this way you get the code and can do whatever you want with it and it might inspire others as well.  I have someone working on it now and I hope to get it posted tomorrow or Friday. 
  
 David

Posted By David on 10-14-2009 09:57 AM 

Rose, 



I wanted to update you on this post. We have been looking into the Haversine method and identifying the places it would need to be changed. While this change is relatively small it impacts many things and we have lots of test cases that will need to be updated. We are looking into if we can change this before the next refresh on the 21st. I personally would like to and think we can do it. Currently we are using the spherical law of cosines which is not as good as Haversine so that is where you see the differences I think. In our testing is can be off around 1 in 10 or more depending on the scale and location. 


David:


Thanks for your update!


I am very happy that you are going to use Haversine method. I noticed the distance difference back in version 2.0, and raised  questions about it, see the link below:

 


gis.thinkgeo.com/Support/Dis…fault.aspx


 


I did not get a proper answer from that post. So in my program I had to do some conversions when draw circles, draw line segment, measure line distance etc. This might slow down the program a bit, but at lease I got the same distance as the real map.


Please update me when you’ve done this change, so I can remove the part which does conversions and make my code neater.


Thanks


Rose



Rose, 
  
   No problem, we will see what we can do.  Back in 2.x we didn’t do as much with the forums and in hindsight it was a bad idea.  The forums now are much better and while they are not perfect, as many can attest too, they are pretty good I think and we are trying to make them better and better. 
  
 Please bump this post so it stays current. 
  
 David

Thanks David,


Looking forward to hearing from you on this update!


Rose


 



Rose, 
  
   I thought I posted this but maybe not.  We have a scalebar project at the code.thinkgeo.com that hsows you how to build a scalebar in nautical miles or any other unit.  All the code is there, check it out.  We are still working on the Haversine but it is going well so far. 
  
 David

Posted By David on 10-14-2009 09:57 AM 

Rose, 



I wanted to update you on this post. We have been looking into the Haversine method and identifying the places it would need to be changed. While this change is relatively small it impacts many things and we have lots of test cases that will need to be updated. We are looking into if we can change this before the next refresh on the 21st. I personally would like to and think we can do it. Currently we are using the spherical law of cosines which is not as good as Haversine so that is where you see the differences I think. In our testing is can be off around 1 in 10 or more depending on the scale and location. 



David 





 


David:


Have you implemented the Haversine method? If so, in which version? I am using 3.0.453.


Thanks


Rose



Rose, 
  
   It is in there now, I must have forgotten to update this thread.  Sorry for that.  Technically it was released in the Services edition as the fucntion is in the Map Suite Core assembly.  It is in version 3.0.453, so in the one you are now using. 
  
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/17/aft/4907/afv/topic/Default.aspx 
  
 Map Suite Services Edition 3.1.273 
  
 Release date: 10/22/2009 
  
     * Added Haversine formula to calculate distance. 
  
 That corresponds to the Desktop release on the same day… 
  
 Map Suite Desktop Edition 3.0.453 Release Candidate 2 
  
 Release date: 10/22/2009 
  
 David

Thanks David!


Rose



Rose, 
  
   No problem, sorry for not getting back on this thread.  We need some internal tool to track these threads that need updating. 
  
 David

Rose, 
  
   Do the distances look better now? 
  
 David