[mapserver-users] How to Optimize Particular Raster Lookup
Bob Basques
Bob.Basques at ci.stpaul.mn.us
Wed Aug 12 08:04:17 PDT 2009
Blake,
Probably not the answer you're looking for, but we cheated a little and gridded our surface data into nice orderly points, this allows for much quicker response times, and nice orderly averaging between any two (or four) points in the grid. We're only using a 50k x 35k grid (on the smallish side) but it runs very quickly. It ended up being our own custom service in the end, but I've contemplated putting it out opensource, but it's only used for a single layer (dataset) here, and it seemed like a better idea to combine it with some other similar query tools at some point instead.
We use it to feed AutoCAD (autoLISP and LandXML), X3D clients, and probably WFS in the future.
It only spits out a GRID right now, but adding in support for dynamic line following and point queries are in the plans. It's all templated output very similar to MapServer templating.
Here is a 128x128 grid as AutoLSIP output (about 1.11sec according to FF Firebug in our network) :
http://gis.ci.stpaul.mn.us/gis/mirage/cgi-bin/mirage.pl?output=lisp&mapsize=128+128&mapext=566000+152500+566700+153200 ( http://gis.ci.stpaul.mn.us/gis/mirage/cgi-bin/mirage.pl?output=lisp&mapsize=128+128&mapext=566000+152500+566700+153200 )
I can't remember if this is available outside the firewall, so here is an example of the result:
(defun elevationgrid (/)
(setq URLRequest "output=lisp&mapsize=128+128&mapext=566000+152500+566700+153200")
(setq ViewPoints (list
'("VIEWPOINT" "ORIENTATION" "POSITION")
'("Top View" "1 0 0 -1.5708" "32768 6553.6 32768")
'("Oblique View" "1 0 0 -.7854" "128 150 128")
) ;; LIST
) ;;VIEWPOINTS
(setq ElevationGrid (list
'("creaseAngle" "solid" "xDimension" "zDimension" "xSpacing" "ySpacing")
'("3.14159" "false" "128" "128" "5.46875" "5.46875")
'( -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 -99
159.5 161.6 161.6 161.6 161.6 161.6 161.6 163.7 163.7 163.7 165.9 165.9 165.9 168 168 170.1 170.1 172.3 172.3 174.4 174.4 176.5 176.5 178.7 180.8 185.1 185.1 187.2 191.2 193.6 193.6 197.6 200 202.1 204.1 206.1 206.1 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 206.1 206.1 206.1 204.1 202.1 202.1 200 200 200 202.1 202.1 202.1 202.1 204.1 204.1 204.1 204.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 206.1 204.1 204.1 204.1 204.1 202.1 202.1 202.1 202.1 202.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 202.1 200 197.6 195.7 193.6 191.2 191.2 191.2 191.2 191.2 191.2 191.2 191.2 193.6 193.6 193.6 193.6 195.7 195.7 195.7 197.6
159.5 161. . . . . . . . .
<stuff deleted>
. . . . . . . . .100 100 102 102 102 102 100 102 102 102 102 102 102 102 102 102 102 104.2 106.3 106.3 108.4 108.4 110.6 112.7 112.7 114.8 114.8 117 117 119.1 119.1 121.2 123.4 125.5 125.5 125.5 127.6 129.5 129.5 131.9 131.9 134 135.9 135.9 140.4 140.4 142.4 144.4 144.4 144.4 144.4 144.4 146.8 146.8 148.8 148.8 148.8 153.1 150.9 150.9 153.1 155.2 157.3 161.6 163.7 168 170.1 172.3 176.5 176.5 178.7 182.9 185.1 189.3 191.2 193.6 200 202.1 202.1 202.1 202.1 202.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 206.1 206.1 206.1 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5
102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 102 104.2 104.2 104.2 106.3 106.3 108.4 110.6 110.6 112.7 112.7 114.8 117 117 119.1 119.1 121.2 123.4 123.4 125.5 127.6 127.6 127.6 129.5 131.9 134 134 135.9 138 138 140.4 142.4 144.4 144.4 144.4 144.4 144.4 146.8 148.8 150.9 153.1 150.9 148.8 148.8 150.9 150.9 153.1 159.5 161.6 163.7 165.9 168 172.3 174.4 176.5 180.8 182.9 187.2 189.3 191.2 195.7 195.7 195.7 197.6 197.6 202.1 202.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 204.1 206.1 206.1 206.1 206.1 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 208.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5 210.5
)
) ;; List
) ;; Elevationgrid
) ;; Defun
>>> Blake Crosby <me at blakecrosby.com> wrote:
Hello! Wondering if a few of you can provide some insight here:
Problem: Given a linestring, return the elevation data along that
linestring from CDED data (ASCII DEM).
I'm using Mapserver 5.4.2
I'm using PHP Mapscript and queryByPoint to get values from my DEMs.
However, the performance seems really slow. Essentially here is how I
have things set up:
Fetch Linestring from postgis, and select N points from the string every
Y distance (ie, get the points every 1 km).
Loop through each point and do a queryByPoint() to get the value from
Mapserver.
I've tried using a tilecache, yo no avail. It still takes over 60
seconds to query approx 200 points.
I would like to use the 50k CDED dems, however the performance is even
worse. So i'm using the 250k ones, approx 4,280 files.
Any tips on improving performance?
Blake
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090812/5c20c144/attachment.htm>
More information about the MapServer-users
mailing list