[Mapserver-users] Distance Calculation

Ed McNierney ed at topozone.com
Wed Mar 3 15:24:13 EST 2004


This is a multi-part message in MIME format.

------_=_NextPart_001_01C4015D.7E88C239
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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.
=20
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!
=20
    - 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=20


  _____ =20

From: Map Guy [mailto:mappington at yahoo.com]=20
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:
=20
Point 1 (Lon,Lat): -87.6552,41.9148
Point 2 (Lon,Lat): -87.8081,41.8884
=20
Cartesian Distance between Point 1 and 2 in miles: 11.2
Great Circle (assuming sphere) Distance between Point 1 and 2: 8.1=20
=20
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!
	=20
	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.
	=20
	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.
	=20
	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.
	=20
	If you can provide a bit more detail on what you're trying to do
we can offer more advice.
	=20
	    - 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=20


  _____ =20

	From: Map Guy [mailto:mappington at yahoo.com]=20
	Sent: Wednesday, March 03, 2004 2:01 PM
	To: Ed McNierney
	Subject: RE: [Mapserver-users] Distance Calculation
=09
=09
	Thank you for your quick response.
	=20
	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?
	=20
	Again, point me elsewhere if I am pushing in the wrong
direction.
	=20
	Thank you,
	=20
	Map Guy
=09
	Ed McNierney <ed at topozone.com> wrote:

		Dear Map Guy -
		=20
		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.
		=20
		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.
		=20
		You need to choose a projected coordinate system in
order to do reasonable distance measurements.
		=20
		    - Ed
		=20
		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=20


  _____ =20

		From: Map Guy [mailto:mappington at yahoo.com]=20
		Sent: Wednesday, March 03, 2004 12:21 PM
		To: mapserver-users at lists.gis.umn.edu
		Subject: [Mapserver-users] Distance Calculation
	=09
	=09
		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.=20
		=20
		2 questions:
		=20
		1. Should we be seeing this much difference in
distances?
		=20
		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?
		=20
		Thanks in advance.
		=20
		P.S. Point me somewhere else if this is the wrong place
to ask these questions.

	=09
  _____ =20

		Do you Yahoo!?
		Yahoo! Search - Find what you're looking for faster.
<http://search.yahoo.com/?fr=3Dad-mailsig-home> =20

=09
  _____ =20

	Do you Yahoo!?
	Yahoo! Search - Find what you're looking for faster.
<http://search.yahoo.com/?fr=3Dad-mailsig-home> =20

  _____ =20

Do you Yahoo!?
Yahoo! Search - Find what you're looking for faster.
<http://search.yahoo.com/?fr=3Dad-mailsig-home>=20

------_=_NextPart_001_01C4015D.7E88C239
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D336382120-03032004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>I don't know what a "Cartesian" distance in =
miles means=20
when your units are in degrees and the conversion between degrees and =
miles=20
depends on the length and the orientation of the =
line.</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D336382120-03032004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D336382120-03032004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>As I said, if you can provide more detail we =
can offer more=20
advice.&nbsp; For example, if all your distances are at a "small scale", =
that's=20
more detail (you didn't say that before).&nbsp; That helps define the =
problem=20
better and helps us suggest solutions.&nbsp; Please describe the problem =
you're=20
trying to solve and we'll help!</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D336382120-03032004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN =
class=3D336382120-03032004>&nbsp;&nbsp;&nbsp; <FONT=20
face=3DArial color=3D#0000ff size=3D2>- Ed</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D336382120-03032004>
<P><FONT size=3D2>Ed McNierney<BR>President and Chief =
Mapmaker<BR>TopoZone.com /=20
Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North =
Chelmsford,=20
MA&nbsp; 01863<BR>ed at topozone.com<BR>(978) 251-4242 =
</FONT></P></SPAN></DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> Map Guy =
[mailto:mappington at yahoo.com]=20
<BR><B>Sent:</B> Wednesday, March 03, 2004 3:15 PM<BR><B>To:</B> Ed=20
McNierney<BR><B>Cc:</B> =
mapserver-users at lists.gis.umn.edu<BR><B>Subject:</B> RE:=20
[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=20
be so different at such a small scale. Would you tell me if these =
results seem=20
right:</DIV>
<DIV>&nbsp;</DIV>
<DIV>Point 1 (Lon,Lat): <FONT size=3D2>-87.6552,41.9148</FONT></DIV>
<DIV>Point 2 (Lon,Lat): <FONT size=3D2>-87.8081,<FONT=20
size=3D2>41.8884</FONT></FONT></DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>Thanks again.<BR><BR><B><I>Ed McNierney =
&lt;ed at topozone.com&gt;</I></B>=20
wrote:</DIV>
<BLOCKQUOTE class=3Dreplbq=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px =
solid">
  <META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004>First, please ALWAYS reply to the entire =
list.&nbsp;=20
  That way everyone benefits from the conversation, and the first person =
to=20
  answer your question doesn't have to make a lifetime commitment to =
further=20
  questions!</SPAN></FONT></DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004>Yes, of course you can choose one =
projection for your=20
  entire set of data.&nbsp; Or you could switch based on what you're=20
  mapping.&nbsp; The reason there are so many map projections is because =
each=20
  has different properties, and therefore does some things well and =
other things=20
  less well.&nbsp; The classic Mercator projection is excellent if you =
are=20
  navigating with a compass; it is very poor if you're trying to =
persuade=20
  someone that Brazil is several times larger than=20
Greenland.</SPAN></FONT></DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004>You also need to have a feel for what level =
of=20
  accuracy you need for your measurements.&nbsp; The UTM family of =
projections=20
  is popular in part because it allows fairly accurate distance =
measurements,=20
  does not distort shapes badly, and is easy to use.&nbsp; However, you =
need 10=20
  different UTM zones to cover the lower 48 states.&nbsp; If you need =
even more=20
  accuracy a custom Transverse Mercator projection&nbsp;centered on the=20
  longitude of your central point would be better.</SPAN></FONT></DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004>Mapping large areas in a single map is =
harder to do=20
  in an appealing way than mapping small areas, because spatial =
distortion=20
  becomes more obvious.</SPAN></FONT></DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004>If you can provide a bit more detail on =
what you're=20
  trying to do we can offer more advice.</SPAN></FONT></DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004>&nbsp;&nbsp;&nbsp; - Ed</SPAN></FONT></DIV>
  <DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
  class=3D577011319-03032004>
  <P><FONT size=3D2>Ed McNierney<BR>President and Chief =
Mapmaker<BR>TopoZone.com /=20
  Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North =
Chelmsford,=20
  MA&nbsp; 01863<BR>ed at topozone.com<BR>(978) 251-4242=20
  </FONT></P></SPAN></FONT></DIV><BR>
  <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
  <HR tabIndex=3D-1>
  <FONT face=3DTahoma size=3D2><B>From:</B> Map Guy =
[mailto:mappington at yahoo.com]=20
  <BR><B>Sent:</B> Wednesday, March 03, 2004 2:01 PM<BR><B>To:</B> Ed=20
  McNierney<BR><B>Subject:</B> RE: [Mapserver-users] Distance=20
  Calculation<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV>Thank you for your quick response.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Is it possible to choose one projection for my entire set of data =
which=20
  includes the whole United States (TIGER data). Or, do I somehow have =
to switch=20
  based on what I am mapping? If the latter is true, then do you have a=20
  suggestion on how I would do that?</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Again, point me elsewhere if I am pushing in the wrong =
direction.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Thank you,</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Map Guy<BR><BR><B><I>Ed McNierney &lt;ed at topozone.com&gt;</I></B> =

  wrote:</DIV>
  <BLOCKQUOTE class=3Dreplbq=20
  style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px =
solid">
    <META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2>Dear Map Guy -</FONT></SPAN></DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2>If you draw an 8-mile ring on a "geographic =
projection"=20
    map it will not be a circle.&nbsp; If you create a map with a =
20-mile extent=20
    it will not be a square.</FONT></SPAN></DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2>Maps using "geographic projection" are =
useless for=20
    making distance measurements; you simply cannot do them in any kind =
of=20
    sensible way.&nbsp; The width of the top edge (east-west) of your =
"20 mile"=20
    image is DIFFERENT than the width of the bottom edge.&nbsp; In fact, =
each=20
    row of pixels running across the image has a different width in=20
    miles/feet/meters because they're all different distances from the=20
    Equator.&nbsp; That's why the set of all points 8 miles from a given =
point=20
    is not a circle or ring; it's not even an =
ellipse.</FONT></SPAN></DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2>You need to choose a projected coordinate =
system in=20
    order to do reasonable distance measurements.</FONT></SPAN></DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN =
class=3D606261418-03032004>&nbsp;&nbsp;&nbsp;=20
    <FONT face=3DArial color=3D#0000ff size=3D2>- Ed</FONT></SPAN></DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004><FONT =
face=3DArial=20
    color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=3Dltr align=3Dleft><SPAN class=3D606261418-03032004>
    <P><FONT size=3D2>Ed McNierney<BR>President and Chief =
Mapmaker<BR>TopoZone.com=20
    / Maps a la carte, Inc.<BR>73 Princeton Street, Suite 305<BR>North=20
    Chelmsford, MA&nbsp; 01863<BR>ed at topozone.com<BR>(978) 251-4242=20
    </FONT></P></SPAN></DIV><BR>
    <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr =
align=3Dleft>
    <HR tabIndex=3D-1>
    <FONT face=3DTahoma size=3D2><B>From:</B> Map Guy =
[mailto:mappington at yahoo.com]=20
    <BR><B>Sent:</B> Wednesday, March 03, 2004 12:21 PM<BR><B>To:</B>=20
    mapserver-users at lists.gis.umn.edu<BR><B>Subject:</B> =
[Mapserver-users]=20
    Distance Calculation<BR></FONT><BR></DIV>
    <DIV></DIV>
    <DIV>We use TIGER data for our mapping data source. We use a =
geographic=20
    projection (lat/lon). When we draw an 8 mile ring on a map with a 20 =
mile=20
    extent, and we plot a point and calculate&nbsp;the distance from the =

    center&nbsp;using Great Circle we get 7.5 miles. Using a Cartesian=20
    calculation we get 8.2 miles. </DIV>
    <DIV>&nbsp;</DIV>
    <DIV>2 questions:</DIV>
    <DIV>&nbsp;</DIV>
    <DIV>1. Should we be seeing this much difference in distances?</DIV>
    <DIV>&nbsp;</DIV>
    <DIV>2. What is the correct way to draw a ring on a map using a =
geographic=20
    projection (lat/lon) and display distances between points using =
Great Circle=20
    without the distance placing the point incorrectly inside or outside =
the=20
    ring?</DIV>
    <DIV>&nbsp;</DIV>
    <DIV>Thanks in advance.</DIV>
    <DIV>&nbsp;</DIV>
    <DIV>P.S. Point me somewhere else if this is the wrong place to ask =
these=20
    questions.</DIV>
    <P>
    <HR SIZE=3D1>
    Do you Yahoo!?<BR>Yahoo! Search - <A=20
    href=3D"http://search.yahoo.com/?fr=3Dad-mailsig-home">Find what =
you&#8217;re looking=20
    for faster.</A> </BLOCKQUOTE>
  <P>
  <HR SIZE=3D1>
  Do you Yahoo!?<BR>Yahoo! Search - <A=20
  href=3D"http://search.yahoo.com/?fr=3Dad-mailsig-home">Find what =
you&#8217;re looking=20
  for faster.</A> </BLOCKQUOTE>
<P>
<HR SIZE=3D1>
Do you Yahoo!?<BR>Yahoo! Search - <A=20
href=3D"http://search.yahoo.com/?fr=3Dad-mailsig-home">Find what =
you&#8217;re looking for=20
faster.</A></BODY></HTML>

------_=_NextPart_001_01C4015D.7E88C239--



More information about the mapserver-users mailing list