[Mapserver-users] Enhancement for tiling files in multiple coordinate systems
Brent Fraser
bfraser at geoanalytic.com
Fri Apr 25 13:33:55 PDT 2003
This is a multi-part message in MIME format.
------=_NextPart_000_01EC_01C30B37.B3732340
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Ed,
Yep, that's true. I'm ok with scripting that part (I'll likely do it =
in VBScript on the server). The part I was trying to avoid was creating =
map files on the fly or doing the C preprocessor thing to account for =
the fact that my source raster files are spread across 10 UTM zones.
I don't mind doing my suggested enhancement to Mapserver, but it's =
going to break every existing map file currently using TILEINDEX if I =
remove that keyword and introduce the TILE object. I guess I could just =
add the TILE object instead and keep the TILEINDEX around for backwards =
compatibility. Having two similar methods of doing one thing tends to =
make confusing documentation. Or maybe I could just add a =
TILEINDEXPROJECTION object (yuck!).
I'm a typical user: I want it all, I want it for free, and I want it =
yesterday!
Brent
----- Original Message -----=20
From: Ed McNierney=20
To: Brent Fraser ; mapserver-users ; Paul Ramsey=20
Sent: Friday, April 25, 2003 1:52 PM
Subject: RE: [Mapserver-users] Enhancement for tiling files in =
multiple coordinate systems
Brent -
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.
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!
- 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),
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
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?).
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.
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.
Thanks again,
Brent
----- Original Message -----=20
From: Ed McNierney=20
To: Brent Fraser ; mapserver-users=20
Sent: Friday, April 25, 2003 12:12 PM
Subject: RE: [Mapserver-users] Enhancement for tiling files in =
multiple coordinate systems
Brent -
Here are some thoughts:
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.
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.
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.
- 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,
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.
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.
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.
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?
Thanks!
Brent Fraser
GeoAnalytic Inc.
Tel:(403) 213-2700
bfraser at geoanalytic.com
www.geoanalytic.com
------=_NextPart_000_01EC_01C30B37.B3732340
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=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> Yep, that's true. I'm ok =
with=20
scripting that part (I'll likely do it in VBScript on the server). The =
part I=20
was trying to avoid was creating map files on the fly or doing the C=20
preprocessor thing to account for the fact that my source raster files =
are=20
spread across 10 UTM zones.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> I don't mind doing my =
suggested=20
enhancement to Mapserver, but it's going to break every existing map =
file=20
currently using TILEINDEX if I remove that keyword and introduce the =
TILE=20
object. I guess I could just add the TILE object instead and =
keep=20
the TILEINDEX around for backwards compatibility. Having two =
similar=20
methods of doing one thing tends to make confusing documentation. =
Or maybe=20
I could just add a TILEINDEXPROJECTION object (yuck!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2> I'm a typical user: =
I want it=20
all, I want it for free, and I want it yesterday!</FONT></DIV>
<DIV> </DIV>
<DIV>Brent</DIV></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> </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> =
; <A=20
title=3Dpramsey at refractions.net =
href=3D"mailto:pramsey at refractions.net">Paul=20
Ramsey</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, April 25, 2003 =
1:52=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=3D921334919-25042003><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Brent -</FONT></SPAN></DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial =
color=3D#0000ff=20
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=20
would like users to be able to select a point anywhere in the US and =
view a=20
map in UTM projection. The easiest way to do this is to have the =
map=20
specified in latitude and longitude, and then you calculate the UTM =
zone and=20
coordinates from those values. As the user scrolls around you =
make the=20
appropriate adjustments.</FONT></SPAN></DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial =
color=3D#0000ff=20
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=20
and easily implemented in VBScript, JavaScript, PHP, etc. If you =
want,=20
you can even do it in JavaScript on the client and leave MapServer =
blissfully=20
ignorant of the problem!</FONT></SPAN></DIV>
<DIV><SPAN class=3D921334919-25042003><FONT face=3DArial =
color=3D#0000ff=20
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=20
Ramsey<BR><B>Subject:</B> Re: [Mapserver-users] Enhancement for =
tiling files=20
in multiple coordinate 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=20
offers lots of functionality above and beyond solving my=20
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=20
with your maintenance comment. We've got several Mapserver =
sites set=20
up internally and we build sites for our customers too. I like =
to=20
minimize the amount of scripting for each site by using the native =
features=20
of Mapserver whenever possible to reduce maintenance issues (hmmm,=20
maybe I 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=20
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=20
doubt if it would require a lot of internal Mapserver code. =
The other=20
benefit is that others can make use of the functionality "out of the =
box"=20
without 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=20
this problem is just too specialized and better left to =
scripting. I=20
don't want to add code (and complexity) to Mapserver if it's not=20
solving a 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=20
eliminating it. If the tileindex files are in a different =
coordinate=20
system, then you either need a tool to generate reprojected tile =
indexes=20
or you need to reproject the native-projection tileindex file =
after you=20
make it. Then you have to splice together the separate index =
files. Or create a new tool that does the indexing, =
reprojection,=20
and splicing all 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=20
of 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,=20
but if the real issue is "how do I most easily maintain this =
setup?", the=20
C 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=20
Mapmaker<BR>TopoZone.com / Maps a la carte, Inc.<BR>73 Princeton =
Street,=20
Suite 305<BR>North Chelmsford, MA =
01863<BR>ed at topozone.com<BR>(978)=20
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 =
[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>=20
[Mapserver-users] 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=20
UTM 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=20
I may eventually have some other data covering 16 zones (or all=20
60!). Too many layer definitions would be a maintenance =
problem=20
I'd like to avoid.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> Another =
option would be=20
to 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=20
Mapserver to allow the tileindex shapefile to be in geographic =
coords=20
while using the "PROJECTION AUTO" feature to determine the =
coordinate=20
system of the data file. That would require two projection =
definitions in one layer: one for the tileindex (proj=3Dlatlong) =
and one=20
for the data (AUTO) requiring either a change to structure =
of=20
the map file or the addition of keywords. How about =
replacing=20
TILEINDEX and TILEITEM with a TILE object containing INDEX, =
ITEM,=20
and PROJECTION? Any 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)=20
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></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_01EC_01C30B37.B3732340--
More information about the MapServer-users
mailing list