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 From [EMAIL PROTECTED] Tue Oct 11 15:47:42 2005 From: [EMAIL PROTECTED] (Armin Burger) Date: Tue Oct 11 15:48:15 2005 Subject: [Pmapper-users] Measure Tool References: <[EMAIL PROTECTED]> Message-ID: <[EMAIL PROTECTED]> 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 +++
