How is scale computed?

kenboss kenboss at dilbert.dnr.state.mn.us
Tue Nov 14 12:19:44 EST 2000


There may be an easier way to accomplish what you're after.  If there is an 
attribute in your shapefile that can be used to determine priority for display, 
then you can use the sortshp utility from your mapserver distribution to 
physically sort the shapefile on that attribute.  Use the output from that 
process as the DATA element in your layer, and set MAXFEATURES for the layer to 
an appropriate number.  The number of shapes drawn for that layer will then not 
be allowed to exceed the MAXFEATURES setting, while the sorting ensures that 
only the most important shapes are drawn when the users are zoomed out at 
smaller scales.

Hope this helps.  Otherwise, Steve did recently submit a post concerning scale 
calculation.  It's at 
http://mapserver.gis.umn.edu/majordom_lists/archives/mapserver-users/html/0010/m
sg00138.html

Ken Boss


> X-Authentication-Warning: green.edi.uk.mids.org: ksibson owned process doing 
-bs
> Date: Tue, 14 Nov 2000 16:37:04 +0000 (GMT)
> From: Keith Sibson <ksibson at matrix.net>
> X-Sender: ksibson at green
> To: mapserver-users at lists.gis.umn.edu
> Subject: How is scale computed?
> MIME-Version: 1.0
> 
> 
> Hi,
> 
> I can't find anything in the archives about this so here goes...
> 
> I'm using map server to display a very large amount of data points, so
> what I'm doing is to automatically generate shapefiles across several
> layers. The top level layers are heavily clustered and the lowest layer
> not clustered at all. Since these layers show the same data, their
> display is mutually exclusive. In this way, I intend only 50-100 points to
> be visible at any one time. This can be done by setting an appropriate
> MINSCALE and MAXSCALE for each of them in the map file.
> 
> The problem is that I need to automatically determine MINSCALE and
> MAXSCALE. 
> 
> If I know the initial map extent and the zoom factor per level of detail,
> how do I go about computing the scales at which the layer divisions occur.
> Assuming that the layer division will be at the mid point between zoom
> levels.
> 
> I'm using DD as my shapefile metric, and I understand that scale is
> affected by this. However, I'm willing to tolerate even a rough
> approximation here.
> 
> Thanks for your help,
> 
> Keith.
> 
> 




More information about the mapserver-users mailing list