Armin- I have done research on this topic all morning and I want to make sure I understand you correctly.
1. Because of projections, the "estimated coordinates" (measure.js, line 72/73) are not accurate. 2. The only accurate latitude/longitude coordinate is the upper right corner, determined by mapserver. Please verify my assumptions. I found a very good forumula for distance calculation called the Haversine formula. If I can correctly determine the latitude/longitude coordinates, I can use this to determine accurate distance. My team and I are very interested in calculating area as well, so the problem of determining accurate latitude and longitude coordinates is critical. I will be doing more research and will let you know what I find. If I can determine a method to accomplish this, I will start on an implementation into pmapper. Mike On 10/11/05, Armin Burger <[EMAIL PROTECTED]> wrote: > Mike, > the problem is that the measurements are just done using Javascript based on > extent values of the current map. For calculating distances and area of data > in geographic projection system one had to convert them into an appropriate > rectangular system. This could be a Lambert Azimuthal Equal Area (the demo > map file uses the European ETRS LAEA projection). > > So I see the the following issues how to deal with: > > You have to find or specify a projection system that can be used, could be > LAEA (small scale) or a UTM for bigger scale. Then you need to convert from > the coordinates for the measure points from lat/lon to the projected > coordinates, and then you get the correct measurements. > > The conversion could be done using an existing conversion formula you could > implement in Javascript. This might often not be available. So one could try > to get that values via PHP Mapscript (using re-projection). The problem with > eg using the XMLHttp request is that it is asynchronous, in this case you > needed probably a synchronous connection (I think Sarissa has also support > for synchronous requests). Or somehow involve the PostGIS functions. > > I typically go a simple way and do not provide measure functions if the data > presentation is in lat/lon. If I want to have measurement function I use a > projected SRS. But if you are interested finding a solution you're welcome. > > Armin > > > > > --- Urspr?ngliche Nachricht --- > > Von: Mike Hostetler <[EMAIL PROTECTED]> > > An: [EMAIL PROTECTED] > > Betreff: [Pmapper-users] Measure Tool > > Datum: Tue, 11 Oct 2005 07:30:18 -0600 > > > > Hello- > > > > I have been working on the measure tool and have fixed some of the > > problems with variables not working. As soon as I am done with this > > task, I will be submitting the code back to Armin. > > > > In working with the measure tool, I have come across several more > > issues. One is the units the measurement is in. After looking at the > > code, I believe the units are degrees of latitude or longitude. When > > I looked into converting this to meters, I found that you must take > > into account the curvature of the earth. There are formulas to do > > this, which I may stick into the program. When using the PostGIS > > backend, it supports a distance calculation as well. > > > > When it comes to area, I am still working on this. I will email this > > list and let them know of my progress. > > > > Thanks, > > > > -- > > Mike Hostetler > > [EMAIL PROTECTED] > > http://www.amountaintop.com > > -- > 10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail > +++ GMX - die erste Adresse f?r Mail, Message, More +++ > -- Mike Hostetler [EMAIL PROTECTED] http://www.amountaintop.com From [EMAIL PROTECTED] Tue Oct 11 20:30:25 2005 From: [EMAIL PROTECTED] (Armin Burger) Date: Tue Oct 11 20:31:29 2005 Subject: [Pmapper-users] Measure Tool In-Reply-To: <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> Mike Hostetler wrote: > Armin- > > I have done research on this topic all morning and I want to make sure > I understand you correctly. > > 1. Because of projections, the "estimated coordinates" (measure.js, > line 72/73) are not accurate. the coordinates are correct, but if they are in degrees instead of meters, also the distance values are in degrees. And a distance of "0.237 degree" will not give you the desired information, I guess. The same thing of course for the area (square-degrees ?!) > 2. The only accurate latitude/longitude coordinate is the upper right > corner, determined by mapserver. No again, all coodinates are correct. But for measurements you need to have the coordinates in the same system as you want the measurements to have. > > Please verify my assumptions. > > I found a very good forumula for distance calculation called the > Haversine formula. If I can correctly determine the > latitude/longitude coordinates, I can use this to determine accurate > distance. > > My team and I are very interested in calculating area as well, so the > problem of determining accurate latitude and longitude coordinates is > critical. I will be doing more research and will let you know what I > find. If I can determine a method to accomplish this, I will start on > an implementation into pmapper. > > Mike But a simple question: is there a reason why you do not want to use a rectangular projection system like UTM and you want to stay in lat/lon? Lat/lon is for me typically used for global views. Armin > > On 10/11/05, Armin Burger <[EMAIL PROTECTED]> wrote: > >>Mike, >>the problem is that the measurements are just done using Javascript based on >>extent values of the current map. For calculating distances and area of data >>in geographic projection system one had to convert them into an appropriate >>rectangular system. This could be a Lambert Azimuthal Equal Area (the demo >>map file uses the European ETRS LAEA projection). >> >>So I see the the following issues how to deal with: >> >>You have to find or specify a projection system that can be used, could be >>LAEA (small scale) or a UTM for bigger scale. Then you need to convert from >>the coordinates for the measure points from lat/lon to the projected >>coordinates, and then you get the correct measurements. >> >>The conversion could be done using an existing conversion formula you could >>implement in Javascript. This might often not be available. So one could try >>to get that values via PHP Mapscript (using re-projection). The problem with >>eg using the XMLHttp request is that it is asynchronous, in this case you >>needed probably a synchronous connection (I think Sarissa has also support >>for synchronous requests). Or somehow involve the PostGIS functions. >> >>I typically go a simple way and do not provide measure functions if the data >>presentation is in lat/lon. If I want to have measurement function I use a >>projected SRS. But if you are interested finding a solution you're welcome. >> >>Armin >> >> >> >> >>>--- Urspr?ngliche Nachricht --- >>>Von: Mike Hostetler <[EMAIL PROTECTED]> >>>An: [EMAIL PROTECTED] >>>Betreff: [Pmapper-users] Measure Tool >>>Datum: Tue, 11 Oct 2005 07:30:18 -0600 >>> >>>Hello- >>> >>>I have been working on the measure tool and have fixed some of the >>>problems with variables not working. As soon as I am done with this >>>task, I will be submitting the code back to Armin. >>> >>>In working with the measure tool, I have come across several more >>>issues. One is the units the measurement is in. After looking at the >>>code, I believe the units are degrees of latitude or longitude. When >>>I looked into converting this to meters, I found that you must take >>>into account the curvature of the earth. There are formulas to do >>>this, which I may stick into the program. When using the PostGIS >>>backend, it supports a distance calculation as well. >>> >>>When it comes to area, I am still working on this. I will email this >>>list and let them know of my progress. >>> >>>Thanks, >>> >>>-- >>>Mike Hostetler >>>[EMAIL PROTECTED] >>>http://www.amountaintop.com >> >>-- >>10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail >>+++ GMX - die erste Adresse f?r Mail, Message, More +++ >> > > > > -- > Mike Hostetler > [EMAIL PROTECTED] > http://www.amountaintop.com
