[Mapserver-users] Distance Calculation
Map Guy
mappington at yahoo.com
Wed Mar 3 12:29:15 PST 2004
--0-175570635-1078345755=:85870
Content-Type: text/plain; charset=us-ascii
We are trying to map underlying layers like streets, parks, cities, etc. taken from TIGER for the United States. Then on top of this we are drawing a ring usually less than 20 miles with the center being the center of the map. Then we are mapping points given to us with lat/lon. In the legend we put the distance of the point from the center of the map. It is this distance which when done with Great Circle calc raised the red flag because the distance would put the point outside the circle when it was being drawn inside the circle. If we used Cartesian distance, then the distance would be off.
So, based on your answers, we MUST project our data in order for our distance shown in the legend to be accurate and also match what we draw on the map, right?
Thanks and let me know if you need more detail to provide suggestions.
Ed McNierney <ed at topozone.com> wrote:I don't know what a "Cartesian" distance in miles means when your units are in degrees and the conversion between degrees and miles depends on the length and the orientation of the line.
As I said, if you can provide more detail we can offer more advice. For example, if all your distances are at a "small scale", that's more detail (you didn't say that before). That helps define the problem better and helps us suggest solutions. Please describe the problem you're trying to solve and we'll help!
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
ed at topozone.com
(978) 251-4242
---------------------------------
From: Map Guy [mailto:mappington at yahoo.com]
Sent: Wednesday, March 03, 2004 3:15 PM
To: Ed McNierney
Cc: mapserver-users at lists.gis.umn.edu
Subject: RE: [Mapserver-users] Distance Calculation
I know it is a very simple question, but I didn't think the results would be so different at such a small scale. Would you tell me if these results seem right:
Point 1 (Lon,Lat): -87.6552,41.9148
Point 2 (Lon,Lat): -87.8081,41.8884
Cartesian Distance between Point 1 and 2 in miles: 11.2
Great Circle (assuming sphere) Distance between Point 1 and 2: 8.1
Thanks again.
Ed McNierney <ed at topozone.com> wrote:
First, please ALWAYS reply to the entire list. That way everyone benefits from the conversation, and the first person to answer your question doesn't have to make a lifetime commitment to further questions!
Yes, of course you can choose one projection for your entire set of data. Or you could switch based on what you're mapping. The reason there are so many map projections is because each has different properties, and therefore does some things well and other things less well. The classic Mercator projection is excellent if you are navigating with a compass; it is very poor if you're trying to persuade someone that Brazil is several times larger than Greenland.
You also need to have a feel for what level of accuracy you need for your measurements. The UTM family of projections is popular in part because it allows fairly accurate distance measurements, does not distort shapes badly, and is easy to use. However, you need 10 different UTM zones to cover the lower 48 states. If you need even more accuracy a custom Transverse Mercator projection centered on the longitude of your central point would be better.
Mapping large areas in a single map is harder to do in an appealing way than mapping small areas, because spatial distortion becomes more obvious.
If you can provide a bit more detail on what you're trying to do we can offer more advice.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
ed at topozone.com
(978) 251-4242
---------------------------------
From: Map Guy [mailto:mappington at yahoo.com]
Sent: Wednesday, March 03, 2004 2:01 PM
To: Ed McNierney
Subject: RE: [Mapserver-users] Distance Calculation
Thank you for your quick response.
Is it possible to choose one projection for my entire set of data which includes the whole United States (TIGER data). Or, do I somehow have to switch based on what I am mapping? If the latter is true, then do you have a suggestion on how I would do that?
Again, point me elsewhere if I am pushing in the wrong direction.
Thank you,
Map Guy
Ed McNierney <ed at topozone.com> wrote:
Dear Map Guy -
If you draw an 8-mile ring on a "geographic projection" map it will not be a circle. If you create a map with a 20-mile extent it will not be a square.
Maps using "geographic projection" are useless for making distance measurements; you simply cannot do them in any kind of sensible way. The width of the top edge (east-west) of your "20 mile" image is DIFFERENT than the width of the bottom edge. In fact, each row of pixels running across the image has a different width in miles/feet/meters because they're all different distances from the Equator. That's why the set of all points 8 miles from a given point is not a circle or ring; it's not even an ellipse.
You need to choose a projected coordinate system in order to do reasonable distance measurements.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
ed at topozone.com
(978) 251-4242
---------------------------------
From: Map Guy [mailto:mappington at yahoo.com]
Sent: Wednesday, March 03, 2004 12:21 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Distance Calculation
We use TIGER data for our mapping data source. We use a geographic projection (lat/lon). When we draw an 8 mile ring on a map with a 20 mile extent, and we plot a point and calculate the distance from the center using Great Circle we get 7.5 miles. Using a Cartesian calculation we get 8.2 miles.
2 questions:
1. Should we be seeing this much difference in distances?
2. What is the correct way to draw a ring on a map using a geographic projection (lat/lon) and display distances between points using Great Circle without the distance placing the point incorrectly inside or outside the ring?
Thanks in advance.
P.S. Point me somewhere else if this is the wrong place to ask these questions.
---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster.
---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster.
---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster.
---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster.
--0-175570635-1078345755=:85870
Content-Type: text/html; charset=us-ascii
<DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN class=577011319-03032004>We are trying to map underlying layers like streets, parks, cities, etc. taken from TIGER for the United States. Then on top of this we are drawing a ring usually less than 20 miles with the center being the center of the map. Then we are mapping points given to us with lat/lon. In the legend we put the distance of the point from the center of the map. It is this distance which when done with Great Circle calc raised the red flag because the distance would put the point outside the circle when it was being drawn inside the circle. If we used Cartesian distance, then the distance would be off. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN class=577011319-03032004></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN class=577011319-03032004>So, based on your answers, we MUST project our data in order for our distance shown in the legend to be accurate and also match what we draw on the map, right?</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN class=577011319-03032004></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN class=577011319-03032004>Thanks and let me know if you need more detail to provide suggestions.</SPAN></FONT></DIV><BR><BR><B><I>Ed McNierney <ed at topozone.com></I></B> wrote:
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=336382120-03032004><FONT face=Arial color=#0000ff size=2>I don't know what a "Cartesian" distance in miles means when your units are in degrees and the conversion between degrees and miles depends on the length and the orientation of the line.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=336382120-03032004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=336382120-03032004><FONT face=Arial color=#0000ff size=2>As I said, if you can provide more detail we can offer more advice. For example, if all your distances are at a "small scale", that's more detail (you didn't say that before). That helps define the problem better and helps us suggest solutions. Please describe the problem you're trying to solve and we'll help!</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=336382120-03032004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=336382120-03032004> <FONT face=Arial color=#0000ff size=2>- Ed</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=336382120-03032004>
<P><FONT size=2>Ed McNierney<BR>President and Chief Mapmaker<BR>TopoZone.com / Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North Chelmsford, MA 01863<BR>ed at topozone.com<BR>(978) 251-4242 </FONT></P></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Map Guy [mailto:mappington at yahoo.com] <BR><B>Sent:</B> Wednesday, March 03, 2004 3:15 PM<BR><B>To:</B> Ed McNierney<BR><B>Cc:</B> mapserver-users at lists.gis.umn.edu<BR><B>Subject:</B> RE: [Mapserver-users] Distance Calculation<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>I know it is a very simple question, but I didn't think the results would be so different at such a small scale. Would you tell me if these results seem right:</DIV>
<DIV> </DIV>
<DIV>Point 1 (Lon,Lat): <FONT size=2>-87.6552,41.9148</FONT></DIV>
<DIV>Point 2 (Lon,Lat): <FONT size=2>-87.8081,<FONT size=2>41.8884</FONT></FONT></DIV>
<DIV> </DIV>
<DIV>Cartesian Distance between Point 1 and 2 in miles: 11.2</DIV>
<DIV>Great Circle (assuming sphere) Distance between Point 1 and 2: 8.1 </DIV>
<DIV> </DIV>
<DIV>Thanks again.<BR><BR><B><I>Ed McNierney <ed at topozone.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004>First, please ALWAYS reply to the entire list. That way everyone benefits from the conversation, and the first person to answer your question doesn't have to make a lifetime commitment to further questions!</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004>Yes, of course you can choose one projection for your entire set of data. Or you could switch based on what you're mapping. The reason there are so many map projections is because each has different properties, and therefore does some things well and other things less well. The classic Mercator projection is excellent if you are navigating with a compass; it is very poor if you're trying to persuade someone that Brazil is several times larger than Greenland.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004>You also need to have a feel for what level of accuracy you need for your measurements. The UTM family of projections is popular in part because it allows fairly accurate distance measurements, does not distort shapes badly, and is easy to use. However, you need 10 different UTM zones to cover the lower 48 states. If you need even more accuracy a custom Transverse Mercator projection centered on the longitude of your central point would be better.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004>Mapping large areas in a single map is harder to do in an appealing way than mapping small areas, because spatial distortion becomes more obvious.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004>If you can provide a bit more detail on what you're trying to do we can offer more advice.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004> - Ed</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN class=577011319-03032004>
<P><FONT size=2>Ed McNierney<BR>President and Chief Mapmaker<BR>TopoZone.com / Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North Chelmsford, MA 01863<BR>ed at topozone.com<BR>(978) 251-4242 </FONT></P></SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Map Guy [mailto:mappington at yahoo.com] <BR><B>Sent:</B> Wednesday, March 03, 2004 2:01 PM<BR><B>To:</B> Ed McNierney<BR><B>Subject:</B> RE: [Mapserver-users] Distance Calculation<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Thank you for your quick response.</DIV>
<DIV> </DIV>
<DIV>Is it possible to choose one projection for my entire set of data which includes the whole United States (TIGER data). Or, do I somehow have to switch based on what I am mapping? If the latter is true, then do you have a suggestion on how I would do that?</DIV>
<DIV> </DIV>
<DIV>Again, point me elsewhere if I am pushing in the wrong direction.</DIV>
<DIV> </DIV>
<DIV>Thank you,</DIV>
<DIV> </DIV>
<DIV>Map Guy<BR><BR><B><I>Ed McNierney <ed at topozone.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2>Dear Map Guy -</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2>If you draw an 8-mile ring on a "geographic projection" map it will not be a circle. If you create a map with a 20-mile extent it will not be a square.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2>Maps using "geographic projection" are useless for making distance measurements; you simply cannot do them in any kind of sensible way. The width of the top edge (east-west) of your "20 mile" image is DIFFERENT than the width of the bottom edge. In fact, each row of pixels running across the image has a different width in miles/feet/meters because they're all different distances from the Equator. That's why the set of all points 8 miles from a given point is not a circle or ring; it's not even an ellipse.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2>You need to choose a projected coordinate system in order to do reasonable distance measurements.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004> <FONT face=Arial color=#0000ff size=2>- Ed</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=606261418-03032004>
<P><FONT size=2>Ed McNierney<BR>President and Chief Mapmaker<BR>TopoZone.com / Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North Chelmsford, MA 01863<BR>ed at topozone.com<BR>(978) 251-4242 </FONT></P></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Map Guy [mailto:mappington at yahoo.com] <BR><B>Sent:</B> Wednesday, March 03, 2004 12:21 PM<BR><B>To:</B> mapserver-users at lists.gis.umn.edu<BR><B>Subject:</B> [Mapserver-users] Distance Calculation<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>We use TIGER data for our mapping data source. We use a geographic projection (lat/lon). When we draw an 8 mile ring on a map with a 20 mile extent, and we plot a point and calculate the distance from the center using Great Circle we get 7.5 miles. Using a Cartesian calculation we get 8.2 miles. </DIV>
<DIV> </DIV>
<DIV>2 questions:</DIV>
<DIV> </DIV>
<DIV>1. Should we be seeing this much difference in distances?</DIV>
<DIV> </DIV>
<DIV>2. What is the correct way to draw a ring on a map using a geographic projection (lat/lon) and display distances between points using Great Circle without the distance placing the point incorrectly inside or outside the ring?</DIV>
<DIV> </DIV>
<DIV>Thanks in advance.</DIV>
<DIV> </DIV>
<DIV>P.S. Point me somewhere else if this is the wrong place to ask these questions.</DIV>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Yahoo! Search - <A href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what youre looking for faster.</A> </BLOCKQUOTE>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Yahoo! Search - <A href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what youre looking for faster.</A> </BLOCKQUOTE>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Yahoo! Search - <A href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what youre looking for faster.</A> </BLOCKQUOTE></DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
Yahoo! Search - <a href="http://search.yahoo.com/?fr=ad-mailsig-home">Find what youre looking for faster.</a>
--0-175570635-1078345755=:85870--
More information about the MapServer-users
mailing list