Decimal degree units
Stephen Lime
steve.lime at dnr.state.mn.us
Thu Aug 26 11:30:39 PDT 1999
Spatial indexing and/or tiling may help perfomance. MapServer supports
a ArcInfo Librarian type of a tiling scheme. Tiles are actually directories
with standardly names shapefiles in each directory. An index of tiles is
maintained as a shapefile and is searched first with resulting tiles processed
in turn. Works fine for drawing, but tiled query is not yet supported.
MapServer also supports simple grid based spatial indexing. There is a utility
called shpindex in the main distribution that will create an index for a given
shapefile. The algorithm uses a user defined grid (equally spaced) and assigns
shapes to one or more grid cells. These cells are then searched to identify
candidate shapes for query or rendering. A lot of work could be done to make
this process more efficient, but even as it is implemented now there are significant
performance gains to be had.
Yet another performance boost can come through the use of nested, multiresolution
versions of the same data. Displayed at different scales this can dramatically improve
performance. For example, you can use the ArcView avenue script (genfeat.ave)
that uses Peuckers feature thinning algorithm to create thinned versions of particularly
dense datasets. Then you can trigger different versions at different scales saving
the real dense data for times when you're zoomed way in.
Thanks for the equations. I'll have a look and implement in 3.4 (which is coming
along nicely).
Steve
Stephen Lime
Internet Applications Analyst
MIS Bureau - MN DNR
(651) 297-2937
steve.lime at dnr.state.mn.us
>>> Banister Trevor <TBanister at SpaceImaging.com> 08/26 12:58 PM >>>
I'll try the PROJ.4 support, but I'm guessing that the performance hit will
kill me. Some of my maps have thousands of shapes on several layers.
I can live with some error at the edges of the map since that's true for
Geographic space in general, the further towards the poles you go the more
error in the map.
Here's some formulas that should do the trick.
(courtesy of Gene Dial, our GIS guru)
DX = Re * (Lon1 - Lon2) * PI / 180
DY = Re * (Lat1 - Lat2) * (PI / 180) * Cos( Lat)
Converting the other way:
180 * DX / (PI * Re) = (Lon1 - Lon2)
180 * DY / (PI * Re * cos(lat)) = (Lat1 - Lat2)
Re = radius of earth =
6,370,997 meters (average) * 254 inches/meter =
1,618,233,238 inches
Lat = (Lat1+Lat2)/2
PI/180 factors convert Lat and Lon from degrees to radians
DX = EW distance
DY = NS distance
Trevor
-----Original Message-----
From: Stephen Lime [mailto:steve.lime at dnr.state.mn.us]
Sent: Thursday, August 26, 1999 10:27 AM
To: mapserver-users at lists.gis.umn.edu; TBanister at SpaceImaging.com
Subject: Re: Decimal degree units
I'd love to see it supported, but have been unable to figure out an easy
way to account for changing measures as you move around. There is
no one conversion from DD to inches. It would be easy to figure an
average x cellsize value for a map, then one could figure out the dd to
inches
conversion factor and with that you could calculate a scale. Scales are
rough to begin with as they are monitor dependent. MapServer uses a
pixels/inch value of 72 to generate scales.
To add DD support only 3 things have to change.
- add MS_DD to ms_units enumeration in map.h
- change the lexer to recognize a DD keyword in mapfiles (edit mapfile.h,
mapfile.c and maplexer.l)
I could do that easily. Rebuilding the lexer requires flex.
- edit msCalculateScale function in mapscale.c to deal with the nuances of
DD
Anyone got ideas/code to figure out DD to inches relationship depending on
where
you are in the world?
The other workaround is to project your data on-the-fly using the Proj.4
library. A bit slower
as every coordinate is projected but it does work.
Steve
Stephen Lime
Internet Applications Analyst
MIS Bureau - MN DNR
(651) 297-2937
steve.lime at dnr.state.mn.us
>>> Banister Trevor <TBanister at SpaceImaging.com> 08/26 11:07 AM >>>
Is anyone using decimal degree units?
It looks like they aren't supported from the looks of map.h
enum ms_units {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS};
I've gotten the shape files to work ok, but I have to fake a unit type which
throws off the legend and absolute zoom factor.
Any work arrounds? or should I start coding DD support?
Thanks.
Trevor
More information about the MapServer-users
mailing list