[mapserver-users] Display performance

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Fri Sep 3 05:31:50 EDT 2010


Hi,
 
I guess that classification has a big effect in your case.  I have been reading that string comparisons are faster than logical ones.  How about to have a try by classifying your shapefile and writing the classes directly to a new attribute field? 
 
This is my scale dependent group, simplified and spiced with some  typos, I fear.  
 
LAYER
     GROUP "Parcels"  
     NAME "all_parcels"
     TYPE POLYGON
     STATUS ON
     DATA "parcels_2008"
     UNITS METERS
     MAXSCALEDENOM 100000
     CLASS
     NAME "parcel_class"
     STYLE
       OUTLINECOLOR 250 0 180
       WIDTH 2
     END  
     END
     METADATA
       "ows_include_items" "AREA, PERIMETER"
       "wms_title"    "all_parcels"
       "wms_srs" "EPSG:2393 EPSG:3067 EPSG:4326 EPSG:900913"
     END
     PROJECTION
       "init=epsg:2393" 
     END
   END 
LAYER
     GROUP "Parcels"  
     NAME "ten_percent"
     TYPE POLYGON
     STATUS ON
     DATA "parcels_2008_0"
     UNITS METERS
      MAXSCALEDENOM 1000000
     MINSCALEDENOM 100000
     CLASS
     NAME "parcel_class"
     STYLE
       OUTLINECOLOR 250 0 180
       WIDTH 2
     END  
     END
     METADATA
       "ows_include_items" "AREA, PERIMETER"
       "wms_title"    "ten_percent"
       "wms_srs" "EPSG:2393 EPSG:3067 EPSG:4326 EPSG:900913"
     END
     PROJECTION
       "init=epsg:2393" 
     END
   END 
LAYER
     GROUP "Parcels"  
     NAME "one_percent"
     TYPE POLYGON
     STATUS ON
     DATA "parcels_2008_00"
     UNITS METERS
     MINSCALEDENOM 1000000
     CLASS
     NAME "parcel_class"
     STYLE
      # COLOR  240 240 0
       OUTLINECOLOR 250 0 180
       WIDTH 2
     END  
     END
     METADATA
       "ows_include_items" "AREA, PERIMETER"
       "wms_title"    "one_percent"
       "wms_srs" "EPSG:2393 EPSG:3067 EPSG:4326 EPSG:900913"
     END
     PROJECTION
       "init=epsg:2393" 
     END
   END 
LAYER
 
-Jukka-



________________________________

	Lähettäjä: Chris Jackson [mailto:webturtles at gmail.com] 
	Lähetetty: 3. syyskuuta 2010 12:13
	Vastaanottaja: Rahkonen Jukka
	Kopio: mapserver-users at lists.osgeo.org
	Aihe: Re: [mapserver-users] Display performance
	
	
	Hi Jukka
	
	Thanks for the response and the great investigative work!
	My log entry for drawing the layer is - [Fri Sep 03 10:01:25 2010].658000 msDrawMap(): Layer 1 (meanspringpeakflow), 24.500s. :o(
	
	I do wonder if my Mapfile layer definition is just v.poor (admittedly no expert!) so have taken an excerpt of the layer defintion (there are about 15 classes in all) - views anyone, should I be loading it a different way?
	
	Also Jukka, could I get a sample of your scale dependent WMS GROUP layer map code - as it sounds like a great idea maybe for this but also some v.hi-res model grids I am thinking about.
	
	Thanks again, much appreciated!
	Chris
	
	LAYER
	  NAME "meanspringpeakflow"
	  TYPE polygon 
	  DEBUG 5 
	  DATA "Tide"
	  TEMPLATE void
	  PROJECTION
	   "+proj=utm +zone=31 +ellps=GRS80 +units=m +no_defs"  
	  END
	  METADATA 
	    "DESCRIPTION" "Mean Spring Peak Flow"
	    "RESULT_FIELDS" "ID,DISTANCE,DEPTH,MEAN_SP_PC"
	    "RESULT_HEADERS" "ID,Minimum Distance (m),Average Depth (m),Mean Spring Peak Flow (m/s)"
	    "ows_title"      "meanspringpeakflow"
	    "RESULT_HYPERLINK" "ID|| Load graphing tool"
	  END  # Metadata 
	        CLASS
	            NAME '> 4.00 (m/s) '
	            EXPRESSION ([MEAN_SP_PC] >= 4 AND [MEAN_SP_PC] < 4.5) 
	            STYLE
	                COLOR 135 99 64
	            END #end style
	        END # end class
	        CLASS
	            NAME '3.51 - 4.00'
	            EXPRESSION ([MEAN_SP_PC] >= 3.5 AND [MEAN_SP_PC] < 4) 
	            STYLE
	
	                COLOR 158 126 63
	            END #end style
	        END # end class
	etc etc
	
	
	
	On 3 September 2010 09:04, Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi> wrote:
	

		Hi,
		 
		I took some numbers to compare with.
		 
		Material and methods
		 
		Polygon layer, rather simple polygons with few vertises, Feature Count: 117383
		DEBUG 5 in mapfile
		WMS client asks for the whole layer
		Mapserver 5.2.1 (CGI) on not so fast Windows computer
		
		Results
		First request: rendering time taken from the log file are between 3.5 and 4.5 seconds
		Following request, BBOX is changing but all the polygons are drawn though:  rendering times 1.5 - 2.5 seconds
		 
		Conclusions and discussion
		At first one might think that my server is faster.  But this test is not controlled at all because we are not using the same shapefiles and we can't say so. What we can say that a couple of hundred of thousand polygons can be drawn faster.  
		 
		However, it does not really make sense to render an image this way if it should be fast.  If the screen has 1000 by 1000 pixels it makes a million pixels together.  For 200000 polygons it makes 5 pixels per polygon.  You can simplify your polygon geometries pretty much before anybody can see the differense.  If the polygons are spread evenly nobody can even see the difference if there are 20000 or 200000 polygons on the screen.
		 
		We have one polygon layer with about million polygons and for that I made two simplified layers which contain only 1 percent and 10 percent of all the polygons.  Those and the original shapefile are put into the same scale dependent WMS GROUP layer. This group is pretty fast at any scale.  The 1 percent layer is perhaps a bit too sparse but I have been too lazy to have a try with 2 or 5 percent samples.
		 
		-Jukka Rahkonen-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100903/da070fe9/attachment-0001.html


More information about the mapserver-users mailing list