[Mapserver-users] Enhancement for tiling files in multiple coordinate systems
Ed McNierney
ed at topozone.com
Fri Apr 25 12:52:23 PDT 2003
This is a multi-part message in MIME format.
------_=_NextPart_001_01C30B64.30CC32DD
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Brent -
=20
It's easy to do what you need to do with MapServer without scripting. =
The scripting issue is, I think, actually a slightly different one. You =
would like users to be able to select a point anywhere in the US and =
view a map in UTM projection. The easiest way to do this is to have the =
map specified in latitude and longitude, and then you calculate the UTM =
zone and coordinates from those values. As the user scrolls around you =
make the appropriate adjustments.
=20
Yes, you need some scripting to do that. But that's code's easily =
available and easily implemented in VBScript, JavaScript, PHP, etc. If =
you want, you can even do it in JavaScript on the client and leave =
MapServer blissfully ignorant of the problem!
=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
-----Original Message-----
From: Brent Fraser [mailto:bfraser at geoanalytic.com]
Sent: Friday, April 25, 2003 3:32 PM
To: Ed McNierney; mapserver-users; Paul Ramsey
Subject: Re: [Mapserver-users] Enhancement for tiling files in multiple =
coordinate systems
Ed, Paul, (and others),
=20
Thanks for the excellent suggestions! Using the C preprocessor (or a =
similar menchanism) to automatically include the 10 to 20 layer =
definitions would solve my current problem, and I'll have to look into =
that. I think automatically generating map files has merit too and =
potentially offers lots of functionality above and beyond solving my =
problem.=20
=20
Ed, you hit the nail on the head with your maintenance comment. We've =
got several Mapserver sites set up internally and we build sites for our =
customers too. I like to minimize the amount of scripting for each site =
by using the native features of Mapserver whenever possible to reduce =
maintenance issues (hmmm, maybe I just write buggy scripts?).
=20
=20
In this particular case, I'd rather look to enhancing Mapserver =
since I don't think it stresses the scope of Mapserver, and I doubt if =
it would require a lot of internal Mapserver code. The other benefit is =
that others can make use of the functionality "out of the box" without =
having to do any scripting.
=20
On the other hand, maybe this problem is just too specialized and =
better left to scripting. I don't want to add code (and complexity) to =
Mapserver if it's not solving a important problem.
=20
Thanks again,
Brent
=20
----- Original Message -----=20
From: Ed McNierney <mailto:ed at topozone.com> =20
To: Brent Fraser <mailto:bfraser at geoanalytic.com> ; mapserver-users =
<mailto:mapserver-users at lists.gis.umn.edu> =20
Sent: Friday, April 25, 2003 12:12 PM
Subject: RE: [Mapserver-users] Enhancement for tiling files in multiple =
coordinate systems
Brent -
=20
Here are some thoughts:
=20
You seem to be moving the problem around more than actually eliminating =
it. If the tileindex files are in a different coordinate system, then =
you either need a tool to generate reprojected tile indexes or you need =
to reproject the native-projection tileindex file after you make it. =
Then you have to splice together the separate index files. Or create a =
new tool that does the indexing, reprojection, and splicing all in one.
=20
Maintaining multiple layers like yours can be made much easier by =
automating the mapfile generation process. As I've mentioned here =
before, we use the C preprocessor to generate the layers for all 27 UTM =
zones needed for complete USGS DRG coverage. I've only got one set of =
zone definitions, and let the computer crank them all out.
=20
We've thought about tileindexes in different coordinate systems before, =
too. I don't think there's much of a reason to NOT do it, but if the =
real issue is "how do I most easily maintain this setup?", the C =
preprocessor route works quite well.
=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
-----Original Message-----
From: Brent Fraser [mailto:bfraser at geoanalytic.com]
Sent: Friday, April 25, 2003 1:50 PM
To: mapserver-users
Subject: [Mapserver-users] Enhancement for tiling files in multiple =
coordinate systems
Mapserver users,
=20
=20
I've got about 4 gb of U.S. topos (1:250k scale DRGs) . My goal is to =
serve up the DRGs as one layer and have Mapserver reproject them on the =
fly when necessary to the UTM zone used for viewing (I'll be using =
scripting to determine which UTM zone to use for the user's current =
extent every time they pan or zoom). Usually no reprojection will be =
required except when the user's extent is at the edge of a UTM zone. My =
plan is to use the TILEINDEX feature to reference the raster data. =
Currently Mapserver requires the TILEINDEX shapefile to be in the same =
coordinate system as the data it references.
=20
One option, given the current capabilities of Mapserver, is to have =
one layer for each UTM zone. In the U.S. that would mean about 10 layer =
definitions, not too bad but I may eventually have some other data =
covering 16 zones (or all 60!). Too many layer definitions would be a =
maintenance problem I'd like to avoid.
=20
Another option would be to pre-condition the raster data by =
reprojecting it to geographic coordinates. This would allow one =
tileindex file and therefore one layer definition. But the result is =
that the raster data would always be re-projected on the fly by =
Mapserver (since the display projection would be UTM) and performance =
would suffer.
=20
A solution might be enhance Mapserver to allow the tileindex shapefile =
to be in geographic coords while using the "PROJECTION AUTO" feature to =
determine the coordinate system of the data file. That would require =
two projection definitions in one layer: one for the tileindex =
(proj=3Dlatlong) and one for the data (AUTO) requiring either a change =
to structure of the map file or the addition of keywords. How about =
replacing TILEINDEX and TILEITEM with a TILE object containing INDEX, =
ITEM, and PROJECTION? Any other ideas?
=20
Thanks!
Brent Fraser
=20
GeoAnalytic Inc.
Tel:(403) 213-2700
bfraser at geoanalytic.com
www.geoanalytic.com
------_=_NextPart_001_01C30B64.30CC32DD
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial color=3D#0000ff =
size=3D2>Brent=20
-</FONT></SPAN></DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial color=3D#0000ff =
size=3D2>It's=20
easy to do what you need to do with MapServer without scripting. =
The=20
scripting issue is, I think, actually a slightly different one. =
You would=20
like users to be able to select a point anywhere in the US and view a =
map in UTM=20
projection. The easiest way to do this is to have the map =
specified in=20
latitude and longitude, and then you calculate the UTM zone and =
coordinates from=20
those values. As the user scrolls around you make the appropriate=20
adjustments.</FONT></SPAN></DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial color=3D#0000ff =
size=3D2>Yes,=20
you need some scripting to do that. But that's code's easily =
available and=20
easily implemented in VBScript, JavaScript, PHP, etc. If you want, =
you can=20
even do it in JavaScript on the client and leave MapServer blissfully =
ignorant=20
of the problem!</FONT></SPAN></DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D921334919-25042003> <FONT =
face=3DArial=20
color=3D#0000ff size=3D2>- Ed</FONT></SPAN></DIV>
<DIV><SPAN class=3D921334919-25042003>
<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 01863<BR>ed at topozone.com<BR>(978) 251-4242 =
</FONT></P></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> Brent Fraser=20
[mailto:bfraser at geoanalytic.com]<BR><B>Sent:</B> Friday, April 25, =
2003 3:32=20
PM<BR><B>To:</B> Ed McNierney; mapserver-users; Paul =
Ramsey<BR><B>Subject:</B>=20
Re: [Mapserver-users] Enhancement for tiling files in multiple =
coordinate=20
systems<BR><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Ed, Paul, (and others),</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> Thanks for the excellent=20
suggestions! Using the C preprocessor (or a similar menchanism) =
to=20
automatically include the 10 to 20 layer definitions would solve my =
current=20
problem, and I'll have to look into that. </FONT><FONT face=3DArial =
size=3D2>I=20
think automatically generating map files has merit too and potentially =
offers=20
lots of functionality above and beyond solving my =
problem. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> Ed, you hit the nail on =
the head with=20
your maintenance comment. We've got several Mapserver sites set =
up=20
internally and we build sites for our customers too. I like to =
minimize=20
the amount of scripting for each site by using the native features of=20
Mapserver whenever possible to reduce maintenance issues (hmmm, =
maybe I=20
just write buggy scripts?).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> In this particular =
case, I</FONT><FONT face=3DArial size=3D2>'d rather look to =
enhancing=20
Mapserver since I don't think it stresses the scope of Mapserver, and =
I doubt=20
if it would require a lot of internal Mapserver code. The other =
benefit=20
is that others can make use of the functionality "out of the box" =
without=20
having to do any scripting.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> On the other hand, =
maybe this=20
problem is just too specialized and better left to scripting. I =
don't=20
want to add code (and complexity) to Mapserver if it's not =
solving a=20
important problem.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks again,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Brent</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A title=3Ded at topozone.com href=3D"mailto:ed at topozone.com">Ed =
McNierney</A>=20
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dbfraser at geoanalytic.com=20
href=3D"mailto:bfraser at geoanalytic.com">Brent Fraser</A> ; <A=20
title=3Dmapserver-users at lists.gis.umn.edu=20
=
href=3D"mailto:mapserver-users at lists.gis.umn.edu">mapserver-users</A> =
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, April 25, 2003 =
12:12=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> RE: =
[Mapserver-users]=20
Enhancement for tiling files in multiple coordinate systems</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Brent -</FONT></SPAN></DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Here are some thoughts:</FONT></SPAN></DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>You seem to be moving the problem around more than actually =
eliminating it. If the tileindex files are in a different =
coordinate=20
system, then you either need a tool to generate reprojected tile =
indexes or=20
you need to reproject the native-projection tileindex file after you =
make=20
it. Then you have to splice together the separate index =
files. =20
Or create a new tool that does the indexing, reprojection, and =
splicing all=20
in one.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Maintaining multiple layers like yours can be made much =
easier by=20
automating the mapfile generation process. As I've mentioned =
here=20
before, we use the C preprocessor to generate the layers for all 27 =
UTM=20
zones needed for complete USGS DRG coverage. I've only got one =
set of=20
zone definitions, and let the computer crank them all=20
out.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>We've thought about tileindexes in different coordinate =
systems=20
before, too. I don't think there's much of a reason to NOT do =
it, but=20
if the real issue is "how do I most easily maintain this setup?", =
the C=20
preprocessor route works quite well.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500025817-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500025817-25042003> <FONT =
face=3DArial=20
color=3D#0000ff size=3D2>- Ed</FONT></SPAN></DIV>
<DIV><SPAN class=3D500025817-25042003>
<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 01863<BR>ed at topozone.com<BR>(978) 251-4242=20
</FONT></P></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> Brent Fraser=20
[mailto:bfraser at geoanalytic.com]<BR><B>Sent:</B> Friday, April 25, =
2003=20
1:50 PM<BR><B>To:</B> mapserver-users<BR><B>Subject:</B> =
[Mapserver-users]=20
Enhancement for tiling files in multiple coordinate=20
systems<BR><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Mapserver users,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> I've got about 4 gb of =
U.S. topos=20
(1:250k scale DRGs) . My goal is to serve up the DRGs =
as one=20
layer and have Mapserver reproject them on the fly when necessary =
to the=20
UTM zone used for viewing (I'll be using scripting to determine =
which UTM=20
zone to use for the user's current extent every time they pan or=20
zoom). Usually no reprojection will be required except when =
the=20
user's extent is at the edge of a UTM zone. My plan is to =
use the=20
TILEINDEX feature to reference the raster data. Currently =
Mapserver=20
requires the TILEINDEX shapefile to be in the same coordinate =
system as=20
the data it references.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> One option, given the =
current=20
capabilities of Mapserver, is to have one layer for each UTM =
zone. =20
In the U.S. that would mean about 10 layer definitions, not too =
bad but I=20
may eventually have some other data covering 16 zones (or all =
60!). =20
Too many layer definitions would be a maintenance problem I'd like =
to=20
avoid.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> Another option =
would be to=20
pre-condition the raster data by reprojecting it to geographic=20
coordinates. This would allow one tileindex file and =
therefore one=20
layer definition. But the result is that the raster data =
would=20
always be re-projected on the fly by Mapserver (since the display=20
projection would be UTM) and performance would =
suffer.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> A solution might be =
enhance Mapserver=20
to allow the tileindex shapefile to be in geographic coords while =
using=20
the "PROJECTION AUTO" feature to determine the coordinate system =
of the=20
data file. That would require two projection definitions in =
one=20
layer: one for the tileindex (proj=3Dlatlong) and one for the data =
(AUTO)=20
requiring either a change to structure of the map file =
or the=20
addition of keywords. How about replacing TILEINDEX and =
TILEITEM=20
with a TILE object containing INDEX, ITEM, and =
PROJECTION? Any=20
other ideas?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Brent Fraser</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>GeoAnalytic Inc.<BR>Tel:(403) =
213-2700<BR><A=20
=
href=3D"mailto:bfraser at geoanalytic.com">bfraser at geoanalytic.com</A><BR><A=
=20
=
href=3D"http://www.geoanalytic.com">www.geoanalytic.com</A></FONT></DIV><=
/BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C30B64.30CC32DD--
More information about the MapServer-users
mailing list