Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter
Oh Andreas, blind me. Copied it into the POSTGIS layer but not the LINE Layer. Sorry for that. It works now as described, panning and zooming is ok. Btw, where to send the bugreport ? Thanks and sorry for the additional noise. Regards Heiko Am 19.12.2013 10:01, schrieb Eichner, Andreas - SID-NLKM: Narf. Send before attaching the images. So here it goes again, sorry. Have you set the PROCESSING directive at the grid layer? With the patch applied, adding PROCESSING "FORCE_FULL_EXTENT=YES" at the GRID layer fixed it for me, ie: LAYER TYPE LINE STATUS DEFAULT EXTENT -180 -90 180 90 NAME "GRID" OPACITY 50 # the following line enables the hack: PROCESSING "FORCE_FULL_EXTENT=YES" I used the BBOXes from your examples below to generate the attached images. The POSTGIS (i.e. POLYGON) and RASTER layers are fine in any zoom or pan level. The LINE layer is ok if the BBOX has not been paned to far of center (for the "ortho" projection) and if extremly zoomed in the poles are cut. It looks like that POLYGON and LINE Layers are treated a little bit differently. If you like here is the test site with the patch included. Zoomed in, plus poles cut out in LINE layer: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-250,- 250,250,250&FORMAT=IMAGE/PNG&FROMDAT=2006-08- 06%2000:00&HOEHE=- 1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map &PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0816&STYLES=&TI ME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08- 07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 Half a LINE layer missing when BBOX to far off center: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,- 650,250,250&FORMAT=IMAGE/PNG&FROMDAT=2006-08- 06%2000:00&HOEHE=- 1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map &PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0816&STYLES=&TI ME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08- 07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 -- --- Dipl.-Ing. Heiko Schröter Institute of Environmental Physics (IUP) phone: ++49-(0)421-218-62092 Institute of Remote Sensing (IFE) fax: ++49-(0)421-218-62070 University of Bremen (FB1) P.O. Box 330440 email: schro...@iup.physik.uni-bremen.de Otto-Hahn-Allee 1 28359 Bremen Germany --- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter
Hello Andreas, thanks for the patch. The POSTGIS (i.e. POLYGON) and RASTER layers are fine in any zoom or pan level. The LINE layer is ok if the BBOX has not been paned to far of center (for the "ortho" projection) and if extremly zoomed in the poles are cut. It looks like that POLYGON and LINE Layers are treated a little bit differently. If you like here is the test site with the patch included. Zoomed in, plus poles cut out in LINE layer: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-250,-250,250,250&FORMAT=IMAGE/PNG&FROMDAT=2006-08-06%2000:00&HOEHE=-1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map&PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0816&STYLES=&TIME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08-07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 Half a LINE layer missing when BBOX to far off center: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,-650,250,250&FORMAT=IMAGE/PNG&FROMDAT=2006-08-06%2000:00&HOEHE=-1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map&PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0816&STYLES=&TIME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08-07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 Regards Heiko Am 18.12.2013 16:25, schrieb Eichner, Andreas - SID-NLKM: Hello Heiko, the problem is the way mapserver builds the source extent. A quick fix might be introducing a processing directive to force mapserver using the layer's full extent: diff --git a/mapdraw.c b/mapdraw.c index 992838d..7f2179e 100644 --- a/mapdraw.c +++ b/mapdraw.c @@ -948,6 +948,9 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image) if(layer->transform == MS_TRUE) { searchrect = map->extent; #ifdef USE_PROJ +if (msLayerGetProcessingKey(layer, "FORCE_FULL_EXTENT")) + searchrect = layer->extent; +else if((map->projection.numargs > 0) && (layer->projection.numargs > 0)) msProjectRect(&map->projection, &layer->projection, &searchrect); /* project the searchrect to source coords */ #endif With this small patch you can rebuild mapserver and use PROCESSING "FORCE_FULL_EXTENT=YES" In a vector layer . As said, this should be considered a quick fix. A bug should be reported on this as other parts in the code path seem to deal more nicely in such situations. HTH -Ursprüngliche Nachricht- Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de] Gesendet: Mittwoch, 18. Dezember 2013 12:19 An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and - wo EXTRA_SOURCE parameter I've omitted the postgis stuff in the mapfile, because of access restrictions. In the EPSG file i have placed this dummy epsg code for reprojection: <0815> +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84 +units=m +no_defs <> MAP NAME WELT OUTPUTFORMAT NAME "aggpng24" DRIVER AGG/PNG MIMETYPE "image/png" IMAGEMODE RGB EXTENSION "png" END STATUS ON SHAPEPATH "/your/shape/path/" TRANSPARENT ON MAXSIZE 1 # Requesting polar plot with a dummy "EPSG:0815" in epsg file # <0815> +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84 +units=m +no_defs <> PROJECTION "init=epsg:4326" END WEB IMAGEPATH "/var/www/localhost/htdocs/tmpimages/" IMAGEURL "/tmpimages/" METADATA "ows_srs" "EPSG:4326 EPSG:0815 EPSG:0816 EPSG:3857 EPSG:900913" "wms_enable_request" "*" END END LAYER EXTENT -180 -90 180 90 NAME "KARTE1" TYPE RASTER STATUS OFF OPACITY 100 DATA "YourMap.png" METADATA "wms_title" "karte layer" END PROJECTION "init=epsg:4326" END CLASS NAME "karte_class" OUTLINECOLOR 0 0 0 COLOR 180 180 180 SYMBOL 0 END END # Layer LAYER TYPE LINE STATUS OFF EXTENT -180 -90 180 90 NAME "GRID" OPACITY 50 METADATA "wms_title" "grid layer" END PROJECTION "init=epsg:4326" END CLASS NAME "Graticule" STYL
Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter
I've omitted the postgis stuff in the mapfile, because of access restrictions. In the EPSG file i have placed this dummy epsg code for reprojection: <0815> +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84 +units=m +no_defs <> MAP NAME WELT OUTPUTFORMAT NAME "aggpng24" DRIVER AGG/PNG MIMETYPE "image/png" IMAGEMODE RGB EXTENSION "png" END STATUS ON SHAPEPATH "/your/shape/path/" TRANSPARENT ON MAXSIZE 1 # Requesting polar plot with a dummy "EPSG:0815" in epsg file # <0815> +proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84 +units=m +no_defs <> PROJECTION "init=epsg:4326" END WEB IMAGEPATH "/var/www/localhost/htdocs/tmpimages/" IMAGEURL "/tmpimages/" METADATA "ows_srs" "EPSG:4326 EPSG:0815 EPSG:0816 EPSG:3857 EPSG:900913" "wms_enable_request" "*" END END LAYER EXTENT -180 -90 180 90 NAME "KARTE1" TYPE RASTER STATUS OFF OPACITY 100 DATA "YourMap.png" METADATA "wms_title" "karte layer" END PROJECTION "init=epsg:4326" END CLASS NAME "karte_class" OUTLINECOLOR 0 0 0 COLOR 180 180 180 SYMBOL 0 END END # Layer LAYER TYPE LINE STATUS OFF EXTENT -180 -90 180 90 NAME "GRID" OPACITY 50 METADATA "wms_title" "grid layer" END PROJECTION "init=epsg:4326" END CLASS NAME "Graticule" STYLE COLOR 180 90 0 MAXWIDTH 2 MINWIDTH 2 END END GRID LABELFORMAT "DD" MAXARCS 1 MININTERVAL 15 MAXINTERVAL 60 MAXSUBDIVIDE 360 END END # Layer END # Ende Map Am 18.12.2013 11:27, schrieb Eichner, Andreas - SID-NLKM: Can you provide a simple test case, probably a MAP file with inline data? I've created some simple test data but I am unable to reproduce the problem. -Ursprüngliche Nachricht- Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de] Gesendet: Dienstag, 17. Dezember 2013 21:01 An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org; Heiko Schröter Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and - wo EXTRA_SOURCE parameter Seems not to work. Failure can be reproduced by changing BBOX params. I've setup a test site with three layers so you may have a look. Blue Marble = RASTER Grid = LINE Coloured Rect = POSTGIS Warping ok from epsg4326->ortho: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,- 650,650,650&FORMAT=IMAGE/PNG&FROMDAT=2006-08- 06%2000:00&HOEHE=- 1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map &PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0815&STYLES=&TI ME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08- 07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 Warping distorted: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-450,- 450,450,450&FORMAT=IMAGE/PNG&FROMDAT=2006-08- 06%2000:00&HOEHE=- 1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map &PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0815&STYLES=&TI ME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08- 07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 Am 17.12.2013 17:57, schrieb Eichner, Andreas - SID-NLKM: Can you try if PROCESSING "POLYLINE_NO_CLIP=YES" helps on TYPE LINE layers? -Ursprüngliche Nachricht- Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de] Gesendet: Dienstag, 17. Dezember 2013 16:46 An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and - wo EXTRA_SOURCE parameter Thanks for the hint, but sorry no, does not change rewarping behaviour of POLYGON or LINE Layers. Distortion and missing parts do remain. The odd thing: The projection of all layers is ok if the BBOX equals or is greater than max extension of the map. i.e. BBOX=-650,-650,650,650 [proj=ortho units=m] By "zooming" in i.e. reducing the BBOX the RASTER layer rewarps ok, POLYGON and LINE layers do not. Am 17.12.2013 16:11, schrieb Eichner, Andreas - SID-NLKM: Looks like that causes the same effect as setting PROCESSING "LOAD_WHOLE_IMAGE=YES" -Ursprüngliche Nachr
Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter
Seems not to work. Failure can be reproduced by changing BBOX params. I've setup a test site with three layers so you may have a look. Blue Marble = RASTER Grid = LINE Coloured Rect = POSTGIS Warping ok from epsg4326->ortho: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-650,-650,650,650&FORMAT=IMAGE/PNG&FROMDAT=2006-08-06%2000:00&HOEHE=-1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map&PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0815&STYLES=&TIME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08-07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 Warping distorted: http://www.iup.uni-bremen.de/warehouse/cgi-bin/laura?BBOX=-450,-450,450,450&FORMAT=IMAGE/PNG&FROMDAT=2006-08-06%2000:00&HOEHE=-1&LAYERS=KARTE1,WILLI,GRID&MAP=/var/www/localhost/mapserver/laura.map&PRODUKT=stro3_21&REQUEST=GETMAP&SERVICE=WMS&SRS=EPSG:0815&STYLES=&TIME=2006-10-06%2000:00/2006-10-08%2023:59&TODAT=2006-08-07%2023:59&TRANSPARENT=FALSE&VERSION=1.1.1&WIDTH=600&HEIGHT=600 Am 17.12.2013 17:57, schrieb Eichner, Andreas - SID-NLKM: Can you try if PROCESSING "POLYLINE_NO_CLIP=YES" helps on TYPE LINE layers? -Ursprüngliche Nachricht- Von: Heiko Schröter [mailto:schro...@iup.physik.uni-bremen.de] Gesendet: Dienstag, 17. Dezember 2013 16:46 An: Eichner, Andreas - SID-NLKM; mapserver-users@lists.osgeo.org Betreff: Re: [mapserver-users] Rewarping/Reprojection with GDAL and - wo EXTRA_SOURCE parameter Thanks for the hint, but sorry no, does not change rewarping behaviour of POLYGON or LINE Layers. Distortion and missing parts do remain. The odd thing: The projection of all layers is ok if the BBOX equals or is greater than max extension of the map. i.e. BBOX=-650,-650,650,650 [proj=ortho units=m] By "zooming" in i.e. reducing the BBOX the RASTER layer rewarps ok, POLYGON and LINE layers do not. Am 17.12.2013 16:11, schrieb Eichner, Andreas - SID-NLKM: Looks like that causes the same effect as setting PROCESSING "LOAD_WHOLE_IMAGE=YES" -Ursprüngliche Nachricht- Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver- users- boun...@lists.osgeo.org] Im Auftrag von Heiko Schröter Gesendet: Dienstag, 17. Dezember 2013 14:09 An: mapserver-users@lists.osgeo.org Betreff: [mapserver-users] Rewarping/Reprojection with GDAL and - wo EXTRA_SOURCE parameter To make use of it in mapserver a hint has been given in an old mailing thread (sorry, lost the source) to adjust the following code snippet in resample.c: Version: mapserver-6.4.0 resample.c /* --- --- -- */ /* Project desired extents out by 2 pixels, and then strip to */ /* available data. */ /* -- -- */ memcpy( &sOrigSrcExtent, &sSrcExtent, sizeof(sSrcExtent) ); sSrcExtent.minx = floor(sSrcExtent.minx-1.0); sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0); sSrcExtent.miny = floor(sSrcExtent.miny-1.0); sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0); Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER image correctly. -- - -- Dipl.-Ing. Heiko Schröter Institute of Environmental Physics (IUP) phone: ++49-(0)421-218- 62092 Institute of Remote Sensing (IFE) fax: ++49-(0)421-218- 62070 University of Bremen (FB1) P.O. Box 330440 email: schro...@iup.physik.uni- bremen.de Otto-Hahn-Allee 1 28359 Bremen Germany - -- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter
Thanks for the hint, but sorry no, does not change rewarping behaviour of POLYGON or LINE Layers. Distortion and missing parts do remain. The odd thing: The projection of all layers is ok if the BBOX equals or is greater than max extension of the map. i.e. BBOX=-650,-650,650,650 [proj=ortho units=m] By "zooming" in i.e. reducing the BBOX the RASTER layer rewarps ok, POLYGON and LINE layers do not. Am 17.12.2013 16:11, schrieb Eichner, Andreas - SID-NLKM: Looks like that causes the same effect as setting PROCESSING "LOAD_WHOLE_IMAGE=YES" -Ursprüngliche Nachricht- Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users- boun...@lists.osgeo.org] Im Auftrag von Heiko Schröter Gesendet: Dienstag, 17. Dezember 2013 14:09 An: mapserver-users@lists.osgeo.org Betreff: [mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter To make use of it in mapserver a hint has been given in an old mailing thread (sorry, lost the source) to adjust the following code snippet in resample.c: Version: mapserver-6.4.0 resample.c /* -- -- */ /* Project desired extents out by 2 pixels, and then strip to */ /* available data. */ /* */ memcpy( &sOrigSrcExtent, &sSrcExtent, sizeof(sSrcExtent) ); sSrcExtent.minx = floor(sSrcExtent.minx-1.0); sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0); sSrcExtent.miny = floor(sSrcExtent.miny-1.0); sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0); Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER image correctly. -- ------- Dipl.-Ing. Heiko Schröter Institute of Environmental Physics (IUP) phone: ++49-(0)421-218-62092 Institute of Remote Sensing (IFE) fax: ++49-(0)421-218-62070 University of Bremen (FB1) P.O. Box 330440 email: schro...@iup.physik.uni-bremen.de Otto-Hahn-Allee 1 28359 Bremen Germany --- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Rewarping/Reprojection with GDAL and -wo EXTRA_SOURCE parameter
Hello all, we need to rewarp epsg:4326 to polar i.e. "+proj=ortho +over +lon_0=0 +lat_0=90 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for satellite data projection. The problem is that not enough data are read from the source raster image and the map is "cutout" at the poles. gdalwarp can be passed a switch i.e. "-wo EXTRA_SOURCE=750", which gives the correct warped image on the commandline. To make use of it in mapserver a hint has been given in an old mailing thread (sorry, lost the source) to adjust the following code snippet in resample.c: Version: mapserver-6.4.0 resample.c /* */ /* Project desired extents out by 2 pixels, and then strip to */ /* available data. */ /* */ memcpy( &sOrigSrcExtent, &sSrcExtent, sizeof(sSrcExtent) ); sSrcExtent.minx = floor(sSrcExtent.minx-1.0); sSrcExtent.maxx = ceil (sSrcExtent.maxx+1.0); sSrcExtent.miny = floor(sSrcExtent.miny-1.0); sSrcExtent.maxy = ceil (sSrcExtent.maxy+1.0); Changing the -/+1.0 to -/+1250.0, for example, warps the RASTER image correctly. Unfortunatly using POSTGIS layer or LINE type layer (i.e. for a grid) the reprojection is distorted as before for the RASTER layer. Is there an option or a place in the sources where the POSTGIS or LINE data layers are handled so that a workaround as above for the RASTER Layer could be used ? I could imagine that it would be a good idea to have a parameter "EXTRA_SOURCE" in the mapfile if need be for polar plots. Thanks Heiko ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Retrieve function values from Postgres
Hello, is it possible for mapserver to question a function in a postgres geo database ? i.e. this query string inside postgres works: "select * from get_aerosol_data('gas_db', 25.5, '2005-3-2 00:00', '2006-3-5 00:00');" If it is possible how to translate this into mapserver mapfile syntax ? Thanks and Regards Heiko /mdraid/www/localhost/mapserver/mapserv -v MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WMS Client does not recognize "wms_extent"
Hello, mapserver seems not to take "wms_extent" into account when receiving raster images via WMS. According to the docs this tag should take precedence over all others. Case 1, SRC Projection = DST Projection : a) Images are displayed correctly when read via DATA statement. msResampleGDALToMap() called. b) Images are displayed incorrectly when read via WMS. wld_file does not matter. msDrawRasterLayerGDAL() called. Calling msResampleGDALToMap() instead fixes this. Case 2, SRC Projection != DST Projection a) Images are displayed correctly when read via DATA statement. msResampleGDALToMap() called. b) Images are displayed incorrectly when read via WMS. wld_file does matter. msResampleGDALToMap() called. "wms_extent" not recognized and does not take precedence. Bug(?) in msGetGDALGeoTransform(). Force Removing the wld_file in mapwmslayer.c in function msDrawWMSLayerLow() before msDrawLayer() is called, forces same proceeding as with images read via DATA statement and fixes it. Else something is broken in the processing logic of the WMS (client) handling or i'am doing something completely wrong (and stupid). Thanks and Regards Heiko /var/www/localhost/mapserver/mapserv -v MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE The image recieved via WMS is the same as the in the DATA statment. LAYER EXTENT -180 -90 180 90 NAME "GRID_TEST" OPACITY 60 STATUS ON DEBUG ON METADATA "wms_timeextent" "1970-01-01/2030-12-31" "wms_timeitem" "datum" #column in postgis table of type timestamp "wms_timedefault" "2007-12-10/2007-12-11" "wms_title" "grid_test" "wms_name" "grid_test" "wms_format" "image/png" "wms_server_version" "1.1.1" "wms_srs" "EPSG:4326" "wms_extent" "-180 -90 180 90" END PROJECTION "init=epsg:4326" END CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"; CONNECTIONTYPE WMS # DATA "/var/www/localhost/htdocs/grafik/wackelkontakt.png" TYPE RASTER END # Layer LAYER EXTENT -180 -90 180 90 NAME "GRID_TEST1" OPACITY 60 STATUS ON DEBUG ON METADATA "wms_timeextent" "1970-01-01/2030-12-31" "wms_timeitem" "datum" #column in postgis table of type timestamp "wms_timedefault" "2007-12-10/2007-12-11" "wms_title" "grid_test1" "wms_name" "grid_test1" "wms_format" "image/png" "wms_server_version" "1.1.1" "wms_srs" "EPSG:4326" "wms_extent" "-180 -90 180 90" END PROJECTION "init=epsg:4326" END # CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"; # CONNECTIONTYPE WMS DATA "/var/www/localhost/htdocs/grafik/wackelkontakt.png" TYPE RASTER END # Layer ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Scaling and Postioning problems with Mapserver as WMS client (was: Dynamically generated Raster images in mapfile)
Hello, images are not scaled and positioned correctly when mapserver is working as WMS client. After some grok debugging the symptom bubbled up in mapraster.c. But to my best knwoledge i think the real issue is in mapwmslayer.c where the setup of the picture limits and/or the resampling logic for GDAL is broken (speaking very carefully here). So the workaround for me is to allways pass Raster images to msResampleGDALtoMap(). Then everything works just fine. Speed is not crucial in our case. A real fix would be better of course. Regards Heiko mapraster.c (line 1545) #ifdef USE_PROJ if( ((adfGeoTransform[2] != 0.0 || adfGeoTransform[4] != 0.0 || adfGeoTransform[5] > 0.0 || adfGeoTransform[1] < 0.0 ) && layer->transform ) || msProjectionsDiffer( &(map->projection), &(layer->projection) ) || CSLFetchNameValue( layer->processing, "RESAMPLE" ) != NULL ) { status = msResampleGDALToMap( map, layer, image, hDS ); } else #endif { if( adfGeoTransform[2] != 0.0 || adfGeoTransform[4] != 0.0 ) { if( layer->debug || map->debug ) msDebug( "Layer %s has rotational coefficients but we\n" "are unable to use them, projections support\n" "needs to be built in.", layer->name ); } /* msDebug("HD Killroy in mapraster.c, Force resample -> msResampleGDALToMap even if logic tells no need to.\n"); */ /* HD: 12.4.2010: Force Resample. If we come from WMS Client msDrawRasterLayer does not work properly ... */ /* For testing we force msResampleGDALToMap even if it is slower. We don't mind */ status = msResampleGDALToMap( map, layer, image, hDS ); /* status = msDrawRasterLayerGDAL(map, layer, image, hDS ); */ /* msDrawRasterLayer is allways called, WMS or DATA source doesn't matter. */ /* So real "bug(?)" seems to be the setup of the picture limits behind the scene. In this case in mapwmslayer.c around line 1345*/ /* --> if (!msProjectionsDiffer(&(map->projection), &(lp->projection))) <-- But we need to resample, */ /* otherwise picture won't fit. */ } ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Dynamically generated Raster images in mapfile
Am Donnerstag 08 April 2010 14:56:33 schrieb Jörg Thomsen: Any ideas why images via DATA are positioned differently to images recieved via WMS client ? Pointer to source code locations also welcome ... Heiko thanks a lot for the suggestions. I will give the WMS suggestion a first try. > But a WMS is doing what you are asking for: > > create Raster images on the fly > so perhaps you could use your script as WMS and call it with > CONNECTIONTYPE WMS > CONNECTION "http://.../yourscript"; The problem i'am facing is that with a "hardcoded" DATA staement everything works fine. The image is scaled and positioned even without a *.tfw file. But getting the same image via the WMS connection the center of the received image is placed to the top left corner of the map. The whole image is there but resizing and proper positioning seems not to work. When panning the map the image is recentered to the top left corner. The "grid_test.pl" does nothing more but just copying the wackelkontakt.png from the file to STDOUT. Warping and Reshaping works with DATA and WMS sources. What do i have to do additionally to get the WMS raster positioned and scaled properly ? Are there any return params needed from the WMS Server so that the WMS client does the display properly ? Thanks and Regards Heiko /var/www/localhost/mapserver/mapserv -v MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE The Layer definition: LAYER EXTENT -180 -90 180 90 NAME "GRID_TEST" OPACITY 60 STATUS ON METADATA "wms_timeextent" "1970-01-01/2030-12-31" "wms_timeitem" "datum" #column in postgis table of type timestamp "wms_timedefault" "2007-12-10/2007-12-11" "wms_title" "grid_test" "wms_name" "grid_test" "wms_format" "image/png" "wms_server_version" "1.1.1" "wms_srs" "EPSG:4326" "wms_extent" "-180 -90 180 90" END PROJECTION "init=epsg:4326" END # CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"; # CONNECTIONTYPE WMS DATA "/var/www/localhost/htdocs/grafik/wackelkontakt.png" TYPE RASTER END # Layer grid_test.pl #!/usr/bin/perl -w use strict; use DBI; use CGI; use File::Copy "copy"; $| = 1; my $q = new CGI; print $q->header(-type => 'image/png'); copy('/var/www/localhost/htdocs/grafik/wackelkontakt.png',\*STDOUT); exit; ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Dynamically generated Raster images in mapfile
Am Donnerstag 08 April 2010 14:56:33 schrieb Jörg Thomsen: thanks a lot for the suggestions. I will give the WMS suggestion a first try. > But a WMS is doing what you are asking for: > > create Raster images on the fly > so perhaps you could use your script as WMS and call it with > CONNECTIONTYPE WMS > CONNECTION "http://.../yourscript"; The problem i'am facing is that with a "hardcoded" DATA staement everything works fine. The image is scaled and positioned even without a *.tfw file. But getting the same image via the WMS connection the center of the received image is placed to the top left corner of the map. The whole image is there but resizing and proper positioning seems not to work. When panning the map the image is recentered to the top left corner. The "grid_test.pl" does nothing more but just copying the wackelkontakt.png from the file to STDOUT. Warping and Reshaping works with DATA and WMS sources. What do i have to do additionally to get the WMS raster positioned and scaled properly ? Are there any return params needed from the WMS Server so that the WMS client does the display properly ? Thanks and Regards Heiko /var/www/localhost/mapserver/mapserv -v MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE The Layer definition: LAYER EXTENT -180 -90 180 90 NAME "GRID_TEST" OPACITY 60 STATUS ON METADATA "wms_timeextent" "1970-01-01/2030-12-31" "wms_timeitem" "datum" #column in postgis table of type timestamp "wms_timedefault" "2007-12-10/2007-12-11" "wms_title" "grid_test" "wms_name" "grid_test" "wms_format" "image/png" "wms_server_version" "1.1.1" "wms_srs" "EPSG:4326" "wms_extent" "-180 -90 180 90" END PROJECTION "init=epsg:4326" END # CONNECTION "http://mailserv2/cgi-bin/grid_test.pl?"; # CONNECTIONTYPE WMS DATA "/var/www/localhost/htdocs/grafik/wackelkontakt.png" TYPE RASTER END # Layer grid_test.pl #!/usr/bin/perl -w use strict; use DBI; use CGI; use File::Copy "copy"; $| = 1; my $q = new CGI; print $q->header(-type => 'image/png'); copy('/var/www/localhost/htdocs/grafik/wackelkontakt.png',\*STDOUT); exit; ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Dynamically generated Raster images in mapfile
Hello, i need to create Raster images on the fly and place them on a map generated with Mapserver. The time needed for generating these images is not crucial. An external script is triggered to generate these images. 1) Is it possible to define in a mapfile a "data/image source" coming from a script ? or 2) Is it possible to rediret the output of the script as input to mapserver ? Stepping through the docs the only solution i can think of in the moment is to generate a temp.img (and temp.tlw)and pass that filename as variable to the DATA tag inside the mapfile. Any pointer to some more infos is highly appreciated. Preprocessing is not a solution since we have dozends of options for generating the images. Thanks and Regards Heiko ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS limit time interval to POSTGIS
> Hi there, > > There is no explicit support of a TIME parameter in wfs but I believe > It should be possible on a postgis layer to use the FilterEncoding to > limit the request: would something like this work for you: > > Filter=your_time_field2007-01-02your_time_field2007-01-03 > > > regards, Thanks very much for the suggestion. It does not work that easy (of course ;-) ) but you can filter using the following converting the date to UNIX epochs first and compare the integers. Unfortunatly the WFS part of MS 5.6.1 does not handle the type 'date' for comparison or calculus. This works: http://localhost/cgi-bin/mapserv.patched/?map=/var/www/localhost/mapserver/wfs6_include.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=BRO_V32_TIMED&FILTER=date_part('epoch',datum::timestamp without time zone)1191359000date_part('epoch',datum::timestamp without time zone)1191359640 Still quite ugly to mee. Is there a deeper reason for not having a time spec within WFS ? To me you usually have data points in space _and_ time. But i'am not a GEO man either (daily satellite based measurements we have). Thanks and Regards Heiko The LAYER definition is as follows. Funny enough one needs not to specify the FILTER at all ... ok, one learns something new every day: LAYER EXTENT -180 -90 180 90 CONNECTIONTYPE POSTGIS NAME "BRO_V32_TIMED" PROCESSING "CLOSE_CONNECTION=DEFER" OPACITY 60 STATUS ON DUMP TRUE METADATA "wfs_title" "bro_v32_timed" "wfs_maxfeatures" "10" "gml_featureid" "ID" ## REQUIRED "gml_include_items" "all" ## Optional (serves all attributes for layer) "gml_geometries" "rechteck" "gml_rechteck_type" "polygon" END PROJECTION "init=epsg:4326" END CONNECTION "user={BF961C25A57BA226} password={C9748CA35D48D049} dbname={6B40E65B12B92106} host=localhost" DATA "rechteck from bro_v32_timed using srid=-1 using unique datum" TYPE POLYGON SIZEUNITS meters CLASS NAME "bro_v32_timed_total_class" STYLE OUTLINECOLOR 0 0 0 COLOR [farbe] END END END # Layer ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMS TIME parameter slow
Hello, i have setup a test db with a 'timestamp' date field (-MM-DD HH:MM:SS). Tests have been done with various request patterns i.e. leaving out the HH:MM:SS part etc. This works just fine and you allways get fast INDEXED SCANS on this. Requests with an interval to seconds is possible and fast, even within millions of data sets. So to me it looks like that you don't need 'date_trunc' at all. But as said i'am not a db/sql guru. Just two observations: 1) Postgres default is to cast the request to '::timestamp without time zone' in Version 5.3: i.e. Index Scan using bro_v32_timed_y2003_datum on bro_v32_timed_y2003 bro_v32_timed (cost=0.00..8.28 rows=1 width=8) (actual time=0.012..0.012 rows=0 loops=1) Index Cond: ((datum > '2007-12-10 10:00:00'::timestamp without time zone) AND (datum < '2007-12-10 13:00:15'::timestamp without time zone)) So it might be an idea to cast the request explicitly and not to rely on POSTGRES defaults (or let the user specify a time zone). I have done no tests with time zones set. 2) The HH:MM:SS part if present (it can be left out) needs to be regexped because POSTGRES won't accept 'HH' or 'HH:' only. A minimum of HH:M is required. Just my 2ct. I have patched MS 5.6.1 with the above for our setup and it works just fine. Thanks for working this over in MS6. Regards Heiko > Sorry to jump late on this. > > The use of the date_trunc function for postgis layers (described > http://mapserver.org/ogc/wms_time.html) was from what I remember to > allow queries (on a timestamp field) > like time=2001-01-01 expecting to get back all values of the day > regardless of the time set. I have entered a bug on it > (http://trac.osgeo.org/mapserver/ticket/3382) to be able to review it > before the 6.0 release. > > regards, > > > Paul Ramsey wrote: > > Sorry, there's not much more I can offer, you've done a great job > > debugging, but at the end of the day the SQL being generated by the > > WMS Time module is not great. Make sure to run 'ANALYZE' on your > > database so the planner has the latest stats. > > > > P. > > > > On Thu, Mar 11, 2010 at 5:59 AM, Heiko Schröter > > wrote: > > > >> Am Donnerstag 11 März 2010 14:35:53 schrieben Sie: > >> > >> Paul, > >> > >> thanks for staying at it. These timings i get with the variation of the > >> theme. The second best is to cast 'datum::timestamp'. But still beeing > >> 32times slower than just a trivial compare on the index as in 1). The > >> slowest run is the brute force 'date_trunc' without cast 3). So to me this > >> is a bit voodo why postgres refuses to scan the indices in proper speed in > >> 2) and 3). > >> The maximum index scan i get with 'date_trunc' is a 'Bitmap Heap Scan' on > >> the index with scenario 2). > >> Of what i have found inside the docs/google is that even when casting > >> 'datum' inside postgres the request, here generated by MS, should or have > >> to be casted as well which is not (at least by now). > >> > >> Heiko > >> > >> > >> 1) The brute force compare: > >> sc_gis=# explain analyze select > >> "datum","farbe",encode(AsBinary(force_collection(force_2d("rechteck")),'NDR'),'hex') > >> as geom,"datum" from o_v20 where rechteck > >> && GeomFromText('POLYGON((-134.90506329114 > >> -78.2278481012662,-134.90506329114 78.2278481012663,134.90506329114 > >> 78.2278481012663,134.90506329114 -78.2278481012662,-134.90506329114 > >> -78.2278481012662))',-1) and (datum >= '2007-12-10' and datum <= > >> '2007-12-11'); > >> > >> Total runtime: 41.018 ms > >> (32 rows) > >> > >> Now Create Immutable Index on our play table: > >> CREATE INDEX o_v20_y2007_date_trunc ON o_v20_y2007 (date_trunc('day', > >> datum::timestamp without time zone)); > >> 2) > >> sc_gis=# CREATE INDEX o3_v20_y2007_date_trunc ON o3_v20_y2007 > >> (date_trunc('day', datum::timestamp without time zone)); > >> ERROR: relation "o3_v20_y2007_date_trunc" already exists > >> scia_gis=# explain analyze select > >> "datum","farbe",encode(AsBinary(force_collection(force_2d("rechteck")),'NDR'),'hex') > >> as geom,"datum" from o_v20 where rechteck > >> && Geo
[mapserver-users] WFS limit time interval to POSTGIS
Hello, by setting up a WFS server i need to limit the time interval for the requests to the postgis db (Millions of data points inside POSTGIS). The WMS part with time interval requests is working and i'am trying to make these data available through WFS as well. What i can find in the docs is a FILTER with a WFS Client connecting a WFS server. But this seems not to apply for DATE interval calculus. The only thing i get in the moment is the whole data set at once or the first NUMBER (here 10) of entries. Is it possible at all to limit the requested time interval to a WFS server ? i.e. something like TIME=2007-1-2/2007-1-3 Thanks and Regards Heiko LAYER EXTENT -180 -90 180 90 CONNECTIONTYPE POSTGIS NAME "TEST" PROCESSING "CLOSE_CONNECTION=DEFER" OPACITY 60 STATUS ON DUMP TRUE METADATA "wfs_title" "test" "wfs_maxfeatures" "10" "gml_featureid" "ID" ## REQUIRED "gml_include_items" "all" ## Optional (serves all attributes for layer) "gml_geometries" "rechteck" "gml_rechteck_type" "polygon" END PROJECTION "init=epsg:4326" END CONNECTION "user={BF961C25A57BA226} password={C9748CA35D48D049} dbname={6B40E65B12B92106} host=localhost" DATA "rechteck from test_data using srid=-1 using unique datum" TYPE POLYGON SIZEUNITS meters CLASS NAME "test_class" STYLE OUTLINECOLOR 0 0 0 COLOR [farbe] END END END # Layer ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMS TIME parameter slow
Am Donnerstag 11 März 2010 14:35:53 schrieben Sie: Paul, thanks for staying at it. These timings i get with the variation of the theme. The second best is to cast 'datum::timestamp'. But still beeing 32times slower than just a trivial compare on the index as in 1). The slowest run is the brute force 'date_trunc' without cast 3). So to me this is a bit voodo why postgres refuses to scan the indices in proper speed in 2) and 3). The maximum index scan i get with 'date_trunc' is a 'Bitmap Heap Scan' on the index with scenario 2). Of what i have found inside the docs/google is that even when casting 'datum' inside postgres the request, here generated by MS, should or have to be casted as well which is not (at least by now). Heiko 1) The brute force compare: sc_gis=# explain analyze select "datum","farbe",encode(AsBinary(force_collection(force_2d("rechteck")),'NDR'),'hex') as geom,"datum" from o_v20 where rechteck && GeomFromText('POLYGON((-134.90506329114 -78.2278481012662,-134.90506329114 78.2278481012663,134.90506329114 78.2278481012663,134.90506329114 -78.2278481012662,-134.90506329114 -78.2278481012662))',-1) and (datum >= '2007-12-10' and datum <= '2007-12-11'); Total runtime: 41.018 ms (32 rows) Now Create Immutable Index on our play table: CREATE INDEX o_v20_y2007_date_trunc ON o_v20_y2007 (date_trunc('day', datum::timestamp without time zone)); 2) sc_gis=# CREATE INDEX o3_v20_y2007_date_trunc ON o3_v20_y2007 (date_trunc('day', datum::timestamp without time zone)); ERROR: relation "o3_v20_y2007_date_trunc" already exists scia_gis=# explain analyze select "datum","farbe",encode(AsBinary(force_collection(force_2d("rechteck")),'NDR'),'hex') as geom,"datum" from o_v20 where rechteck && GeomFromText('POLYGON((-134.90506329114 -78.2278481012662,-134.90506329114 78.2278481012663,134.90506329114 78.2278481012663,134.90506329114 -78.2278481012662,-134.90506329114 -78.2278481012662))',-1) and ((date_trunc('day', datum::timestamp without time zone) >= '2007-12-10' AND date_trunc('day', datum::timestamp without time zone) <= '2007-12-11')); Total runtime: 1250.679 ms (26 rows) 3) sc_gis=# explain analyze select "datum","farbe",encode(AsBinary(force_collection(force_2d("rechteck")),'NDR'),'hex') as geom,"datum" from o_v20 where rechteck && GeomFromText('POLYGON((-134.90506329114 -78.2278481012662,-134.90506329114 78.2278481012663,134.90506329114 78.2278481012663,134.90506329114 -78.2278481012662,-134.90506329114 -78.2278481012662))',-1) and ((date_trunc('day', datum) >= '2007-12-10' AND date_trunc('day', datum) <= '2007-12-11')); Total runtime: 2329.380 ms (23 rows) > Good job getting this far on your own! Create a SQL wrapper function > on top of date_trunc which *is* marked as immutable and you'll be able > to build a functional index on it. > > P. > > On Thu, Mar 11, 2010 at 1:39 AM, Heiko Schröter > wrote: > > Am Mittwoch 10 März 2010 16:52:28 schrieb Heiko Schröter: > > > > Done what has been suggested. The 'date_trunc' function forces sequential > > scans instead of using the indexed scans. > > > > I've tried and failed: > > sc_gis=# CREATE INDEX o_v20_y2007_date_trunc ON o_v20_y2007 > > (date_trunc('day', datum at time zone 'GMT')); > > ERROR: functions in index expression must be marked IMMUTABLE > > > > Probably the MS list is not the right place to ask. > > But may be a kind soul has some pointers to more infos. > > I admit that db's are not my field of experience and i'am still learning. > > > > On the other hand it would be nice to have a hint about the indexing issue > > inside the MS docs when using the WMS Time extension. > > > > Heiko > > > > > > sc_gis=# explain analyze select > > "datum","farbe",encode(AsBinary(force_collection(force_2d("rechteck")),'NDR'),'hex') > > as geom,"datum" from o_v20 where rechteck > > && GeomFromText('POLYGON((-134.90506329114 > > -78.2278481012662,-134.90506329114 78.2278481012663,134.90506329114 > > 78.2278481012663,134.90506329114 -78.2278481012662,-134.90506329114 > >
Re: [mapserver-users] WMS TIME parameter slow
Am Mittwoch 10 März 2010 16:52:28 schrieb Heiko Schröter: Done what has been suggested. The 'date_trunc' function forces sequential scans instead of using the indexed scans. I've tried and failed: sc_gis=# CREATE INDEX o_v20_y2007_date_trunc ON o_v20_y2007 (date_trunc('day', datum at time zone 'GMT')); ERROR: functions in index expression must be marked IMMUTABLE Probably the MS list is not the right place to ask. But may be a kind soul has some pointers to more infos. I admit that db's are not my field of experience and i'am still learning. On the other hand it would be nice to have a hint about the indexing issue inside the MS docs when using the WMS Time extension. Heiko sc_gis=# explain analyze select "datum","farbe",encode(AsBinary(force_collection(force_2d("rechteck")),'NDR'),'hex') as geom,"datum" from o_v20 where rechteck && GeomFromText('POLYGON((-134.90506329114 -78.2278481012662,-134.90506329114 78.2278481012663,134.90506329114 78.2278481012663,134.90506329114 -78.2278481012662,-134.90506329114 -78.2278481012662))',-1) and (datum >= '2007-12-10' and datum <= '2007-12-30'); QUERY PLAN -- Result (cost=0.00..585.37 rows=4420 width=450) (actual time=0.083..35.821 rows=5322 loops=1) -> Append (cost=0.00..541.17 rows=4420 width=450) (actual time=0.067..13.852 rows=5322 loops=1) -> Seq Scan on o3_v20 (cost=0.00..16.65 rows=1 width=55) (actual time=0.001..0.001 rows=0 loops=1) Filter: ((rechteck && '0103000100050035884A47F6DC60C038D93310958E53C035884A47F6DC60C03FD93310958E534035884A47F6DC60403FD93310958E534035884A47F6DC604038D93310958E53C035884A47F6DC60C038D93310958E53C0'::geometry) AND (datum >= '2007-12-10'::date) AND (datum <= '2007-12-30'::date)) -> Index Scan using o3_v20_y2002_datum on o3_v20_y2002 o3_v20 (cost=0.00..8.28 rows=1 width=450) (actual time=0.012..0.012 rows=0 loops=1) Index Cond: ((datum >= '2007-12-10'::date) AND (datum <= '2007-12-30'::date)) Filter: (rechteck && '0103000100050035884A47F6DC60C038D93310958E53C035884A47F6DC60C03FD93310958E534035884A47F6DC60403FD93310958E534035884A47F6DC604038D93310958E53C035884A47F6DC60C038D93310958E53C0'::geometry) -> Index Scan using o3_v20_y2003_datum on o3_v20_y2003 o3_v20 (cost=0.00..8.28 rows=1 width=450) (actual time=0.006..0.006 rows=0 loops=1) Index Cond: ((datum >= '2007-12-10'::date) AND (datum <= '2007-12-30'::date)) Filter: (rechteck && '0103000100050035884A47F6DC60C038D93310958E53C035884A47F6DC60C03FD93310958E534035884A47F6DC60403FD93310958E534035884A47F6DC604038D93310958E53C035884A47F6DC60C038D93310958E53C0'::geometry) -> Index Scan using o3_v20_y2004_datum on o3_v20_y2004 o3_v20 (cost=0.00..8.28 rows=1 width=450) (actual time=0.005..0.005 rows=0 loops=1) Index Cond: ((datum >= '2007-12-10'::date) AND (datum <= '2007-12-30'::date)) Filter: (rechteck && '0103000100050035884A47F6DC60C038D93310958E53C035884A47F6DC60C03FD93310958E534035884A47F6DC60403FD93310958E534035884A47F6DC604038D93310958E53C035884A47F6DC60C038D93310958E53C0'::geometry) -> Index Scan using o3_v20_y2005_datum on o3_v20_y2005 o3_v20 (cost=0.00..8.28 rows=1 width=450) (actual time=0.005..0.005 rows=0 loops=1) Index Cond: ((datum >= '2007-12-10'::date) AND (datum <= '2007-12-30'::date)) Filter: (rechteck && '0103000100050035884A47F6DC60C038D93310958E53C035884A47F6DC60C03FD93310958E534035884A47F6DC60403FD93310958E534035884A47F6DC604038D93310958E53C035884A47F6DC60C038D93310958E53C0'::geometry) -> Index Scan using o3_v20_y2006_datum on o3_v20_y2006 o3_v20 (cost=0.00..8.28 rows=1 width=450) (actual time=0.005..0.005 rows=0 loops=1) Index Cond: ((datum >= '2007-12-10'::date) AND (datum <= '2007-12-30'::date)) Filter: (rechteck && '0103000100050035884A47F6DC60C038D93310958E53C
Re: [mapserver-users] WMS TIME parameter slow
Am Mittwoch 10 März 2010 16:42:02 schrieben Sie: Thanks for the hint. Hm, i thought 4000 out of 4.5 Millions datasets for the whole year in 5 sec would be not that bad The timing figure shall just show the huge difference between the two types of requests. I will follow your advice and test the db. And yes the db is indexed. Heiko > Firstly, 2 seconds is not fast, so you have another performance troll > beyond this one. > > Secondly, it's impossible to know what's going on inside the database > without seeing the actual SQL being generated. Turn on statement > loggging in PgSQL and extract the SQL that is being run against the > database. Then you can put that into PgAdmin or psql and get EXPLAIN > ANALYZE results which will tell you why there's a problem, hopefully. > > P. > > On Wed, Mar 10, 2010 at 7:22 AM, Heiko Schröter > wrote: > > Hello, > > > > using mapserv (5.6.1) with PostGIS (8.3) and accessing ten-thousands of geo > > locations in the PostGIS db results in very slow speed when using the WMS > > TIME parameter: > > (in this example the number is about 4000 datapoints for this day, timing > > measurements with DEBUG OFF). > > > > 1) Very fast using FILTER, approx. 5 seconds: > > > > CONNECTION "user={BF961C25A57BA226} password={C9748CA35D48D049} > > dbname={6B40E65B12B92106} host=localhost" > > DATA "geocoord from xyz_ref using unique datum" > > VALIDATION > > 'filter' "^datum >= '[0-9]{4}-[0-9]{2}-[0-9]{2}' and datum <= > > '[0-9]{4}-[0-9]{2}-[0-9]{2}'" > > END > > FILTER "datum >= '2007-12-10' and datum < '2007-12-11'" > > > > > > 2) Very slow using WMS TIME, approx 210 and more seconds: > > (Leaving the VALIDATION/FILTER on or leaving out 'using unique datum' > > doesn't change a thing) > > ... > > METADATA > > "wms_timeextent" "1970-01-01/2030-12-31" > > "wms_timeitem" "datum" > > "wms_timedefault" "2007-12-10/2007-12-11" > > "wms_title" "xyz_r" > > "wms_srs" "init=epsg:-1" > > END > > ... > > > > The MS ERRORFILE is very noisy spilling out all datapoints when running 2). > > This does not happen when running 1). > > Database is the same. No other changes have been made. > > > > Why is mapserver so slow when using the WMS TIME parameter ? > > > > It would be nice to stick to the "official" WMS configuration and not to > > introduce a "vendor specific" workaround. > > > > Thanks and Regards > > Heiko > > > > # > > ## > > > > /var/www/localhost/cgi-bin/mapserv -v > > MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP > > OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV > > SUPPORTS=WMS_SERVER SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER INPUT=EPPL7 > > INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE > > > > A complete Layer definition: > > > >LAYER > >EXTENT -180 -90 180 90 > >CONNECTIONTYPE POSTGIS > >NAME "SACURA_REF_R" > >PROCESSING "CLOSE_CONNECTION=DEFER" > >OPACITY 60 > >STATUS ON > >METADATA > > # "wms_timeextent" "1970-01-01/2030-12-31" > > # "wms_timeitem" "datum" > > # "wms_timedefault" "2007-12-10/2007-12-11" > >"wms_title" "xyz_ref_r" > >"wms_srs" "init=epsg:-1" > >END > >PROJECTION > >"init=epsg:4326" > >END > >CONNECTION "user={BF961C25A57BA226} > > password={C9748CA35D48D049} dbname={6B40E65B12B92106} host=localhost" > >DATA "geocoord from xyz_ref using unique datum" > >VALIDATION > >'filter' "^datum >= '[0-9]{4}-[0-9]{2}-[0-9]{2}' and > > datum <= '[0-9]{4}-[0-9]{2}-[0-9]{2}'" > >END > >FILTER "datum >= '2007-12-10' and datum < '2007-12-11'" > > > >TYPE POLYGON > >SIZEUNITS meters > >CLASS > >DEBUG OFF > >NAME "xyz_ref_class" > >STYLE > >OUTLINECOLOR 0 0 0 > >COLOR [rfarbe] > >END > >END > >END # Layer > > ___ > > mapserver-users mailing list > > mapserver-users@lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WMS TIME parameter slow
Hello, using mapserv (5.6.1) with PostGIS (8.3) and accessing ten-thousands of geo locations in the PostGIS db results in very slow speed when using the WMS TIME parameter: (in this example the number is about 4000 datapoints for this day, timing measurements with DEBUG OFF). 1) Very fast using FILTER, approx. 5 seconds: CONNECTION "user={BF961C25A57BA226} password={C9748CA35D48D049} dbname={6B40E65B12B92106} host=localhost" DATA "geocoord from xyz_ref using unique datum" VALIDATION 'filter' "^datum >= '[0-9]{4}-[0-9]{2}-[0-9]{2}' and datum <= '[0-9]{4}-[0-9]{2}-[0-9]{2}'" END FILTER "datum >= '2007-12-10' and datum < '2007-12-11'" 2) Very slow using WMS TIME, approx 210 and more seconds: (Leaving the VALIDATION/FILTER on or leaving out 'using unique datum' doesn't change a thing) ... METADATA "wms_timeextent" "1970-01-01/2030-12-31" "wms_timeitem" "datum" "wms_timedefault" "2007-12-10/2007-12-11" "wms_title" "xyz_r" "wms_srs" "init=epsg:-1" END ... The MS ERRORFILE is very noisy spilling out all datapoints when running 2). This does not happen when running 1). Database is the same. No other changes have been made. Why is mapserver so slow when using the WMS TIME parameter ? It would be nice to stick to the "official" WMS configuration and not to introduce a "vendor specific" workaround. Thanks and Regards Heiko # ## /var/www/localhost/cgi-bin/mapserv -v MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE A complete Layer definition: LAYER EXTENT -180 -90 180 90 CONNECTIONTYPE POSTGIS NAME "SACURA_REF_R" PROCESSING "CLOSE_CONNECTION=DEFER" OPACITY 60 STATUS ON METADATA # "wms_timeextent" "1970-01-01/2030-12-31" # "wms_timeitem" "datum" # "wms_timedefault" "2007-12-10/2007-12-11" "wms_title" "xyz_ref_r" "wms_srs" "init=epsg:-1" END PROJECTION "init=epsg:4326" END CONNECTION "user={BF961C25A57BA226} password={C9748CA35D48D049} dbname={6B40E65B12B92106} host=localhost" DATA "geocoord from xyz_ref using unique datum" VALIDATION 'filter' "^datum >= '[0-9]{4}-[0-9]{2}-[0-9]{2}' and datum <= '[0-9]{4}-[0-9]{2}-[0-9]{2}'" END FILTER "datum >= '2007-12-10' and datum < '2007-12-11'" TYPE POLYGON SIZEUNITS meters CLASS DEBUG OFF NAME "xyz_ref_class" STYLE OUTLINECOLOR 0 0 0 COLOR [rfarbe] END END END # Layer ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] MapServer CGI GdalWarp parameter passing
> MapServer does not use gdalwarp or it's underlying algorithm. these Frank, hm, probably i got the docs mixed up because of the 'geospatial raster formats' line at GDAL/OGR. Could a clear hint make it into the docs, please ? (Because i've been trying hard to get gdalwarp up and running in the first place. Blind me.) Thanks for your reply. Heiko From the docs: PROJ.4: Proj.4 provides on-the-fly projection support to MapServer. Users whose data are in different projection systems can use this library to reproject into a common projection. It is also required for WMS, WFS or WCS services. GDAL/OGR: The GDAL/OGR library allows MapServer to read a variety of geospatial raster formats (GDAL) and vector formats (OGR). It can be downloaded at http://www.gdal.org/. > two processing options can influence the MapServer source area selection > but there is no direct analog for SOURCE_EXTRA. There is some hardcoded > logic to grow the source area by two pixels, but this is sometimes far > from being enough. > > **LOAD_FULL_RES_IMAGE=YES/NO** > This option affects how image data is loaded for the resampler when > reprojecting or otherwise going through complex resampling (as opposed > to the fast default image decimation code path). This forces the source > image to be loaded at full resolution if turned on (default is NO). This > helps work around problems with default image resolution selection in > when radical warping is being done. It can result in very slow > processing > if the source image is large. > > **LOAD_WHOLE_IMAGE=YES/NO** > This option affects how image data is loaded for the resampler (as above). > This option, if turned on, will cause the whole source image to be loaded > and helps make up for problem identifying the area required, usually due > to radical image reprojection near a dateline or projection "horizon". > The default is NO. Turning this on can dramatically affect rendering > performance and memory requirements. > > Best regards, ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] MapServer CGI GdalWarp parameter passing
Hi, i need to pass parameters for Reprojection via mapservers CGI interface to gdalwarp. Gdalwarp needs the '-wo SOURCE_EXTRA=x' to do the reprojection properly. How can this Parameter beeing passed to gdalwarp ? Tried the PROCESSING='-wo SOURCE...' key, but probably got the syntax wrong or this is not the right keyword. Regards Heiko ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: VS: [mapserver-users] MapServer CGI GDAL Raster reprojection
Am Dienstag 13 Oktober 2009 12:30:32 schrieben Sie: Hello, the mapfile i've tested looks similar to your setup. I'am just trying to strip out everything which is not needed. But still it gets stuck in the EPSG:4326 projection. From strace i can see that libgdal is touched but the search fails for '/usr/lib/gdal16plugins' (if that is important). Regards Heiko Call: /usr/lib/cgi-bin/mapserv -nh 'QUERY_STRING=MAP=/home/schroete/sciadaten/raster_test/raster.map&LAYERS=Bild&SRS=epsg:3575&mode=map' > out.png Mapfile: MAP PROJECTION # Does not make any diff here "init=epsg:3575" END WEB METADATA "wms_title" "Raster Test" "wms_onlineresource" "http://kahlo1/cgi-bin/mapserv?map=/home/schroete/sciadaten/raster_test/raster.map&"; "wms_srs" "epsg:3575 epsg:4326" END END LAYER NAME "Bild" DATA "/home/schroete/sciadaten/raster_test/wmap_work.png" TYPE RASTER STATUS ON # PROJECTION # Comment or not won't change a thing # "init=epsg:3575" #END END END > Hi > > The projection of your Bild layer is > PROJECTION > "proj=ortho" > END > > I am not familiar with ortho projection, but are you sure that this is > enough? In your gdalwarp example you are using also "lat_0=90". > There is no difference in reprojecting raster or vector data. This is a > working example of one orthophoto layer: > METADATA >"wms_title""orthophotos 92-96" >"wms_srs" "EPSG:2393 EPSG:3067 EPSG:4326 EPSG:900913" > END > PROJECTION >"init=epsg:2393" > END > > -Jukka- > > > Heiko Schröter wrote: > > > > > > Am Dienstag 13 Oktober 2009 11:50:13 schrieben Sie: > > > > Hello, > > > > sorry, no that doesn't work. I have tried with epsg:3575 > > (wich is somewhat polar and recognized by GDALWARP) but that > > fails as well. > > Does anyone has a working example for reprojecting raster > > images via gdallib ? > > > > > > Regards > > Heiko > > > > > > > > > Hi, > > > > > > Perhaps it would work by making "+proj=ortho +lat_0=90" as > > the default projection of your map by adding MAP level > > PROJECTION block as: > > > > > > PROJECTION > > > "proj=ortho" > > > "lat_0=90" > > > "no_defs" > > > END > > > > > > If you want to get the image through WMS I suppose you > > should give it your own EPSG number and add corresponding > > line to epsg file, just like it has been done with EPSG:900913. > > > > > > -Jukka Rahkonen- > > > > > > > Heiko Schröter wrote: > > > > > > > > Hi, > > > > > > > > is there a small howto recipe of how to reproject Raster > > Images via > > > > MapServer (CGI call) with the Gdal Lib ? > > > > I need to go from EPSG:4326 to "+proj=ortho +lat_0=90" (Polar > > > > View) and i cannot figure out how to pass the Projection. > > > > The output image stays in EPSG:4326. > > > > This is not a proj4 issue. WMS calls for vector maps to be > > > > reprojected are ok (in a different scenario). > > > > > > > > Any pointer to some infos or sample code are highly appreciated. > > > > > > > > Thanks and Regards > > > > Heiko > > > > -- > > > > > > > > > > > > Reprojecting with gdalwarp works fine: > > > > gdalwarp -of GTiff -s_srs "epsg:4326" -t_srs "+proj=ortho > > > > +lat_0=90" -wo SOURCE_EXTRA=50 wmap_work.png wmap_out.png > > > > > > > > /usr/lib/cgi-bin/mapserv -v > > > > MapServer version 5.4.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG > > > > OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE > > > > SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT > > > > SUPPORTS=THREADS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL > > > > INPUT=SHAPEFILE > > > > > > > > The Test mapfile: > > > > MAP > > > > NAME WELT > > > > CONFIG "MS_ERRORFILE" "/tmp/ms_raster_error.txt" > > > >
Re: [mapserver-users] MapServer CGI GDAL Raster reprojection
Am Dienstag 13 Oktober 2009 11:50:13 schrieben Sie: Hello, sorry, no that doesn't work. I have tried with epsg:3575 (wich is somewhat polar and recognized by GDALWARP) but that fails as well. Does anyone has a working example for reprojecting raster images via gdallib ? Regards Heiko > Hi, > > Perhaps it would work by making "+proj=ortho +lat_0=90" as the default > projection of your map by adding MAP level PROJECTION block as: > > PROJECTION > "proj=ortho" > "lat_0=90" > "no_defs" > END > > If you want to get the image through WMS I suppose you should give it your > own EPSG number and add corresponding line to epsg file, just like it has > been done with EPSG:900913. > > -Jukka Rahkonen- > > > Heiko Schröter wrote: > > > > Hi, > > > > is there a small howto recipe of how to reproject Raster > > Images via MapServer (CGI call) with the Gdal Lib ? > > I need to go from EPSG:4326 to "+proj=ortho +lat_0=90" (Polar > > View) and i cannot figure out how to pass the Projection. > > The output image stays in EPSG:4326. > > This is not a proj4 issue. WMS calls for vector maps to be > > reprojected are ok (in a different scenario). > > > > Any pointer to some infos or sample code are highly appreciated. > > > > Thanks and Regards > > Heiko > > -- > > > > > > Reprojecting with gdalwarp works fine: > > gdalwarp -of GTiff -s_srs "epsg:4326" -t_srs "+proj=ortho > > +lat_0=90" -wo SOURCE_EXTRA=50 wmap_work.png wmap_out.png > > > > /usr/lib/cgi-bin/mapserv -v > > MapServer version 5.4.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG > > OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE > > SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT > > SUPPORTS=THREADS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR > > INPUT=GDAL INPUT=SHAPEFILE > > > > The Test mapfile: > > MAP > > NAME WELT > > CONFIG "MS_ERRORFILE" "/tmp/ms_raster_error.txt" > > DEBUG 5 > > STATUS ON > > SIZE 800 400 > > IMAGETYPE PNG24 > > IMAGECOLOR 240 240 240 > > SHAPEPATH "data" > > EXTENT -180 -90 180 90 > > UNITS DD > > WEB > > IMAGEPATH "images" > > IMAGEURL "images" > > MINSCALE 5 > > MAXSCALE 4 > > METADATA > > #"wms_title" "Example WMS Server" > > #"wms_onlineresource" > > "http://kahlo1/cgi-bin/mapserv?map=heiko5.map&"; > > "wms_srs" "ortho epsg:4326 epsg:900913" > > # or 'proj=ortho' doesn't matter > > END > > END > > > > LAYER > > NAME "Bild" > > DATA "/home/schroete/sciadaten/raster_test/wmap_work.png" > > TYPE RASTER > > STATUS ON > > PROJECTION > > "proj=ortho" > > END > > END > > END > > > > The MapServer Test call: > > /usr/lib/cgi-bin/mapserv -nh > > 'QUERY_STRING=MAP=/home/schroete/sciadaten/raster_test/raster. > > map&LAYERS=Bild&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&FOR > MAT=image/png&SRS=ortho&mode=map' > out.png > > > > > > Debug output: > > [Tue Oct 13 10:29:35 2009].656759 msDrawRasterLayerLow(Bild): > > entering. > > [Tue Oct 13 10:29:35 2009].845281 msDrawMap(): Layer 0 > > (Bild), 0.189s [Tue Oct 13 10:29:35 2009].845376 msDrawMap(): > > Drawing Label Cache, 0.000s [Tue Oct 13 10:29:35 2009].845397 > > msDrawMap() total time: 0.193s [Tue Oct 13 10:29:35 > > 2009].958674 msSaveImage() total time: 0.113s [Tue Oct 13 > > 10:29:35 2009].958837 mapserv request processing time > > (loadmap not incl.): 0.307s [Tue Oct 13 10:29:35 2009].958856 > > msFreeMap(): freeing map at 0x1729dc0. > > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] MapServer CGI GDAL Raster reprojection
Hi, is there a small howto recipe of how to reproject Raster Images via MapServer (CGI call) with the Gdal Lib ? I need to go from EPSG:4326 to "+proj=ortho +lat_0=90" (Polar View) and i cannot figure out how to pass the Projection. The output image stays in EPSG:4326. This is not a proj4 issue. WMS calls for vector maps to be reprojected are ok (in a different scenario). Any pointer to some infos or sample code are highly appreciated. Thanks and Regards Heiko -- Reprojecting with gdalwarp works fine: gdalwarp -of GTiff -s_srs "epsg:4326" -t_srs "+proj=ortho +lat_0=90" -wo SOURCE_EXTRA=50 wmap_work.png wmap_out.png /usr/lib/cgi-bin/mapserv -v MapServer version 5.4.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=THREADS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE The Test mapfile: MAP NAME WELT CONFIG "MS_ERRORFILE" "/tmp/ms_raster_error.txt" DEBUG 5 STATUS ON SIZE 800 400 IMAGETYPE PNG24 IMAGECOLOR 240 240 240 SHAPEPATH "data" EXTENT -180 -90 180 90 UNITS DD WEB IMAGEPATH "images" IMAGEURL "images" MINSCALE 5 MAXSCALE 4 METADATA #"wms_title" "Example WMS Server" #"wms_onlineresource" "http://kahlo1/cgi-bin/mapserv?map=heiko5.map&"; "wms_srs" "ortho epsg:4326 epsg:900913" # or 'proj=ortho' doesn't matter END END LAYER NAME "Bild" DATA "/home/schroete/sciadaten/raster_test/wmap_work.png" TYPE RASTER STATUS ON PROJECTION "proj=ortho" END END END The MapServer Test call: /usr/lib/cgi-bin/mapserv -nh 'QUERY_STRING=MAP=/home/schroete/sciadaten/raster_test/raster.map&LAYERS=Bild&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&FORMAT=image/png&SRS=ortho&mode=map' > out.png Debug output: [Tue Oct 13 10:29:35 2009].656759 msDrawRasterLayerLow(Bild): entering. [Tue Oct 13 10:29:35 2009].845281 msDrawMap(): Layer 0 (Bild), 0.189s [Tue Oct 13 10:29:35 2009].845376 msDrawMap(): Drawing Label Cache, 0.000s [Tue Oct 13 10:29:35 2009].845397 msDrawMap() total time: 0.193s [Tue Oct 13 10:29:35 2009].958674 msSaveImage() total time: 0.113s [Tue Oct 13 10:29:35 2009].958837 mapserv request processing time (loadmap not incl.): 0.307s [Tue Oct 13 10:29:35 2009].958856 msFreeMap(): freeing map at 0x1729dc0. -- --- !!! NEUE TELEPHONNUMMER !!! !!! NEW PHONE NUMBER !!! Dipl.-Ing. Heiko Schröter Institute of Environmental Physics (IUP)phone: ++49-(0)421-218-62092 Institute of Remote Sensing (IFE) fax: ++49-(0)421-218-4555 University of Bremen (FB1) P.O. Box 330440 email: schro...@iup.physik.uni-bremen.de Otto-Hahn-Allee 1 28359 Bremen Germany --- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Passing single quoted strings
On Donnerstag, 23. April 2009 19:18:32 you wrote: Thanks to Steve and Arnd. This does the trick. somevalue = "filter \"datum between '2002-8-8' and '2002-8-9'\""; Since i'am new to mapserver i was mislead by the docs and examples which use single and double qoutes freely. So i thought they are interchangeable. I cannot find a strict rule in the docs when to use single or double quotes. (Probably my blindness ...) Thanks for your help. Regards Heiko > The key is just making it look like a line in a mapfile. Your initial > tries used single quotes on a string > with internal single quotes. That would have broken a mapfile too. > Might want to post a summary > solution to your last message to the whole list. > > Steve > > >>> On 4/23/2009 at 8:01 AM, in message > > <200904231501.50805.schro...@iup.physik.uni-bremen.de>, Heiko Schröter > > wrote: > > On Donnerstag, 23. April 2009 14:34:00 you wrote: > > > > Steve you are genius. This works. > > Can we get this into the docs as well ? > > > > Thanks very much. > > Regards > > Heiko > > > >> What about trying? > >> > >> somevalue = "filter \"datum between '2002-8-8' and '2002-8-9'\""; > >> > >> The double quotes around the filter (containing single quotes) > > should > > >> please MapServer. > >> > >> Steve > >> > >> >>> Heiko Schröter 04/23/09 2:46 > > AM > > >> On Mittwoch, 22. April 2009 18:07:11 you wrote: > >> > >> I've tested teh scenario with 3 different filter strings and > > attached > > >> the > >> mapserver error logs with DEBUG 5 (in case need be). > >> The resulting URL strings are taken from apache access log file. > >> Please let me know if you need the full URL. > >> > >> Thanks and Regards > >> Heiko > >> > >> > >> The OL call: > >> sacurabiglayer = new OpenLayers.Layer.WMS( "SACURABIG", > >> > >> "http://kahlo1/cgi-bin/mapserv";, > >> > >> {map:'/home/schroete/sciadaten/MapServer/country98/heiko5.map', > >> layers: sacura_big, > >> "map.layer[SACURABIG]": > >> somevalue, > >> transparent: true}, > >>{singleTile:true, > >> isBaseLayer: false, > >>buffer:5, wrapDateLine: > >> true, > >> queryable: true}); > >> > >> Setting of the string in OL: > >> somevalue = "filter "+"'"+" datum between "+"'"+"2002-8-8"+"'"+" > > and > > >> "+"'"+" > >> 2002-8-9 "+"''"; > >> Results: > > MAP.LAYER%5BSACURABIG%5D=filter%20'%20datum%20between%20'2002-8-8'%20and%20 > > >>'%202002-8-9%20''& (ms_error_assembled_string.txt) > >> > >> Setting of the string in OL: > >> somevalue = "filter 'datum between '2002-8-8' and '2002-8-9' '"; > > MAP.LAYER%5BSACURABIG%5D=filter%20'datum%20between%20'2002-8-8'%20and%20'20 > > >>02-8-9'%20'& (ms_error_unescaped_string.txt) > >> > >> Setting of the string in OL: > >> somevalue = "filter 'datum between \'2002-8-8\' and \'2002-8-9\' > > '"; > > MAP.LAYER%5BSACURABIG%5D=filter%20'datum%20between%20'2002-8-8'%20and%20'20 > > >>02-8-9'%20'& (ms_error_escaped_single_quotes.txt) > >> > >> > >> The Mapfile Layer definition: > >>LAYER > >>CONNECTIONTYPE POSTGIS > >> NAME "SACURABIG" > >>PROCESSING "CLOSE_CONNECTION=DEFER" > >>OPACITY 60 > >>STATUS ON > >>METADATA > >>"wms_title" "sacurabig layer" > >>"wms_srs" "init=epsg:4326" > >>END > >>PROJECTION > >>"init=epsg:4326" > >>END > >>CONNECTION "
Re: [mapserver-users] Passing single quoted strings
On Mittwoch, 22. April 2009 18:07:11 you wrote: I've tested teh scenario with 3 different filter strings and attached the mapserver error logs with DEBUG 5 (in case need be). The resulting URL strings are taken from apache access log file. Please let me know if you need the full URL. Thanks and Regards Heiko The OL call: sacurabiglayer = new OpenLayers.Layer.WMS( "SACURABIG", "http://kahlo1/cgi-bin/mapserv";, {map:'/home/schroete/sciadaten/MapServer/country98/heiko5.map', layers: sacura_big, "map.layer[SACURABIG]": somevalue, transparent: true}, {singleTile:true, isBaseLayer: false, buffer:5, wrapDateLine: true, queryable: true}); Setting of the string in OL: somevalue = "filter "+"'"+" datum between "+"'"+"2002-8-8"+"'"+" and "+"'"+" 2002-8-9 "+"''"; Results: MAP.LAYER%5BSACURABIG%5D=filter%20'%20datum%20between%20'2002-8-8'%20and%20'%202002-8-9%20''& (ms_error_assembled_string.txt) Setting of the string in OL: somevalue = "filter 'datum between '2002-8-8' and '2002-8-9' '"; MAP.LAYER%5BSACURABIG%5D=filter%20'datum%20between%20'2002-8-8'%20and%20'2002-8-9'%20'& (ms_error_unescaped_string.txt) Setting of the string in OL: somevalue = "filter 'datum between \'2002-8-8\' and \'2002-8-9\' '"; MAP.LAYER%5BSACURABIG%5D=filter%20'datum%20between%20'2002-8-8'%20and%20'2002-8-9'%20'& (ms_error_escaped_single_quotes.txt) The Mapfile Layer definition: LAYER CONNECTIONTYPE POSTGIS NAME "SACURABIG" PROCESSING "CLOSE_CONNECTION=DEFER" OPACITY 60 STATUS ON METADATA "wms_title" "sacurabig layer" "wms_srs" "init=epsg:4326" END PROJECTION "init=epsg:4326" END CONNECTION "user=fei password=foo dbname=fum host=kahlo1" DATA "geocenter from sacura_big" VALIDATION 'filter' "^."# Just for testing END FILTER "orbitnr=0" TYPE POINT SIZEUNITS meters CLASS NAME "sacura_big_class" STYLE COLOR [farbe] SYMBOL "circle" SIZE 35000 END END END # Layer > What does the URL OL generate look like? I'm curious how it escapes the > text > for the URL. That should give us a hint. > > Steve > > >>> Heiko Schröter 04/21/09 1:53 AM > > Hello, > > i have to pass single quoted strings from Open Layer through mapserver > to a > postgis/postgres database. > > i.e. "filter 'value=1 and datum between '2005-1-1' and '2005-1-3' "; > The postgres db expects (afaik) the date in a single quoted string. > > The problem is that mapserver stops scanning the filter string when > coming > across the second single quote and bails out. > > The Validation string in the mapfile: > VALIDATION > 'filter' "^." >END > > Even when allowing single quotes explicitly by inserting escaped single > quotes > in the validation string it doesn't work. Escaping the single quotes in > the > assembled OL string won't help either. > > Does anyone has an idea of how to pass such strings through mapserver ? > > Now i do use an ugly hack of converting the date to abstime on the > client side > (with all the UTC converting hassle) and pass the integer to the db. > i.e. "filter 'value = 1 and abstime between "+fromDate+" and > "+toDate+"'"; > > MapServer version 5.4.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG > OUTPUT=WBMP > OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV > SUPPORTS=WMS_SERVER > INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE > > Thanks and Regards > Heiko > > > ___ > mapserver-users mailing list
[mapserver-users] Passing single quoted strings
Hello, i have to pass single quoted strings from Open Layer through mapserver to a postgis/postgres database. i.e. "filter 'value=1 and datum between '2005-1-1' and '2005-1-3' "; The postgres db expects (afaik) the date in a single quoted string. The problem is that mapserver stops scanning the filter string when coming across the second single quote and bails out. The Validation string in the mapfile: VALIDATION 'filter' "^." END Even when allowing single quotes explicitly by inserting escaped single quotes in the validation string it doesn't work. Escaping the single quotes in the assembled OL string won't help either. Does anyone has an idea of how to pass such strings through mapserver ? Now i do use an ugly hack of converting the date to abstime on the client side (with all the UTC converting hassle) and pass the integer to the db. i.e. "filter 'value = 1 and abstime between "+fromDate+" and "+toDate+"'"; MapServer version 5.4.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE Thanks and Regards Heiko ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Use of a Colortable
On Mittwoch, 15. April 2009 16:02:23 Jeff McKenna wrote: Hello, yep, i think i got the idea. I've just checked the [color_me] access and this works. Probably the (or my) way to go is to store the color value inside the postgis table as extra column as suggested. The other idea by Espen works too. But would be suited to cases with little variations or intermediate steps. Thanks to everyone for the clues. Regards Heiko > > Is it possible with mapserver to change the color of the symbol according > > to the value read in from postgis ? > > Yes this is possible, using the method described by David. I have > tested this locally: I have a column in PostGIS named 'color' with > various RGB values, and I can display them in MapServer such as the > following: > >STYLE > COLOR [color] >END > > (tested with MapServer version 5.4.0-rc1) > > > -jeff ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Use of a Colortable
Hello,, we are mapping global satellite data with postgis. Is it possible with mapserver to change the color of the symbol according to the value read in from postgis ? Now the color is fixed within the mapfile reading only the geolocations i.e. LAYER CONNECTION "user=bla password=blub dbname=foo host=fum" DATA "geocenter from table1" CLASS COLOR 50 150 150 SYMBOL "circle" SIZE 5 END END My (maybe/probably ill) idea is something like: ... DATA "value and geocenter from table1" ... COLOR on value using "/dir/my_colortable.dat" SYMBOL "circle" ... But it looks like that only one coloumn of the GIS Table could be read for a given LAYER.DATA statement. Thanks for any suggestion. Regards Heiko ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Layer Object Parameter Substitution fromURLusing GIS
Hello Steve, Mapserver fails by just scanning the mapfile. Did fetch the 5.4_rc1 and installed it. But same behaviour as with the 5.4_beta. /usr/lib/cgi-bin/mapserv -v MapServer version 5.4.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE [Thu Apr 9 08:13:06 2009].548952 loadHashTable(): Unknown identifier. Parsing error near (FILTER):(line 128) [Thu Apr 9 08:13:06 2009].549088 msFreeMap(): freeing map at 0x18c51b0. Did cut and paste your filter suggestion into the Mapfile but same result. I'am back in the office on 15th of April. Thanks for your effort. Regards Heiko > > LAYER > NAME 'psc' > ... > VALIDATION > filter '^orbitnr=[0-9]{1,5}$' > END > ... > END > > > You can set a far more general pattern (e.g. '.' matches anything) but I > recommend against it. The corrected MAPFILE: MAP NAME WELT CONFIG "MS_ERRORFILE" "/tmp/ms_error.txt" DEBUG 5 STATUS ON #SIZE 647 320 SIZE 800 400 IMAGETYPE PNG24 IMAGECOLOR 240 240 240 SHAPEPATH "data" #EXTENT -180 -89.8 180 83.623596 EXTENT -180 -90 180 90 UNITS DD WEB IMAGEPATH "images" IMAGEURL "images" MINSCALE 5 MAXSCALE 4 METADATA "wms_title" "Example WMS Server" "wms_onlineresource" "http://kahlo1/cgi-bin/mapserv?map=heiko1.map&"; "wms_srs" "epsg:4326 epsg:32661 epsg:32761 epsg:4308 epsg:3413 epsg:3575 epsg:0815 epsg:0816" END END PROJECTION "init=epsg:4326" END removed not needed layers for readability LAYER NAME "PSC" CONNECTIONTYPE POSTGIS OPACITY 30 STATUS ON METADATA "wms_title" "psc" END PROJECTION "init=epsg:4326" END CONNECTION "user=foo password=fum dbname=fei host=kahlo1" DATA "geocenter from scia_psc" VALIDATION FILTER '.' <--- Line 128 END FILTER "orbitnr=3456" TYPE POINT CLASS COLOR 250 10 10 SYMBOL "circle" SIZE 7 END END # Layer END # Ende Map ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Layer Object Parameter Substitution fromURLusing GIS
On Dienstag, 7. April 2009 15:52:10 you wrote: Hello Steve, this seem to fail as well. Funny enough i needed to change the Layernames to uppercase in OpenLayer. But anyway: var kartenstring = "karte,grid,psc"; var somevalue = "FILTER+'orbitnr=4567' "; layer = new OpenLayers.Layer.WMS( "IUP WMS", "http://kahlo1/cgi-bin/mapserv";, {map:'/home/schroete/sciadaten/MapServer/country98/heiko1.map', layers: kartenstring, "map.layer[PSC]": somevalue}, {singleTile:true}); The relevant part of the generated URL: ...&LAYERS=karte%2Cgrid%2CPSC&MAP.LAYER%5BPSC%5D=FILTER%2B%27orbitnr%3D4567%27&... I've tried various \' inside somevalue, but that won't change a thing. Backslashing the + sign won't change thing as well. And mapserver fails. The output from DEBUG 5 is as follows: [Wed Apr 8 10:52:31 2009].104328 getSymbol(): Symbol definition error. Parsing error near (+):(line 1) or [Wed Apr 8 10:51:24 2009].324130 loadLayer(): General error message. URL- based FILTER configuration failed pattern validation. Depending on what you have changed in someval. Regards Heiko > 2) Setting extra vars in OpenLayers is easy. Something like this would > work: > > myLayer = new OpenLayers.Layer.MapServer( > 'stuff', > 'http://some.site.com/cgi-bin/mapserv?map=/some/mapfile.map', > { layers:'stuff', map_transparent: 'true', > somevar: 'somevalue', > }, > { ratio:1, singleTile:true, transitionEffect:'resize', > isBaseLayer:false } > ); ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Layer Object Parameter Substitution fromURLusing GIS
On Dienstag, 7. April 2009 15:52:10 you wrote: Hi Steve, thanks for the clues. I'am probably to dumb for this. Firefox replaces the " with " and mapserv5.4 complains. I've tried brute force backslashes than but that doesn't work either (of course). I've tried than with a little webpage in case that it is a coding (ISO or UTF) problem. But this fails as well. Do you have a working example of what exactly one has to use within the URL? Sorry to bother you again with this. (Since we are using Satellite global mapping, we need to change content and projection on the fly...) The Webpage: http://www.w3.org/TR/html4/loose.dtd";> Mapserver 5.4 Test http://localhost/cgi- bin/mapserv?MAP=/home/schroete/sciadaten/MapServer/country98/heiko1.map& LAYERS=karte,grid,psc&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap& STYLES=&FORMAT=image/png&SRS=epsg:4326&BBOX=-180,-90,180,90& WIDTH=600&HEIGHT=300& map.layer[psc]=FILTER+"orbitnr&eq;3456""> link And this is what Firefox does: http://localhost/cgi-bin/mapserv? MAP=/home/schroete/sciadaten/MapServer/country98/heiko1.map& LAYERS=karte,grid,psc&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap& STYLES=&FORMAT=image/png&SRS=epsg:4326&BBOX=-180,-90,180,90& WIDTH=600&HEIGHT=300& map.layer[psc]=FILTER+%22orbitnr&eq;3456%22 (The %22 will be shown as " in the Firefox URL line) Results in: getSymbol(): Symbol definition error. Parsing error near ("):(line 1) It doesn't matter if you escape the = sign or use single qoutes within the Filter string. I'am testing now the OpenLayer approach and will report later. Thanks for your effort. Regards Heiko > Hi Heiko: Two things: > > 1) There's an error in your URL. The syntax should be something like: > > map.layer[psc]=FILTER+'orbitnr=6758' > > but you'd need to escape the ' and = characters in the URL. > > 2) Setting extra vars in OpenLayers is easy. Something like this would > work: > > myLayer = new OpenLayers.Layer.MapServer( > 'stuff', > 'http://some.site.com/cgi-bin/mapserv?map=/some/mapfile.map', > { layers:'stuff', map_transparent: 'true', > somevar: 'somevalue', > }, > { ratio:1, singleTile:true, transitionEffect:'resize', > isBaseLayer:false } > ); > > You can then modify the content of the 'somevar' variable. With code > like: > > myLayer.params.somevar = 'somenewvalue'; > > This will tag somevar=somenewvalue onto the URL passed to MapServer. > > Steve > > >>> Heiko Schröter 04/07/09 5:26 AM > > On Montag, 6. April 2009 19:57:19 you wrote: > > Hello, > > the error seems to remain in mapserver 5.4: > > /usr/lib/cgi-bin/mapserv -v > MapServer version 5.4.0-beta4 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG > OUTPUT=WBMP > OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV > SUPPORTS=WMS_SERVER > INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE > > http://localhost/cgi-bin/mapserv? > MAP=/home/schroete/sciadaten/MapServer/country98/heiko1.map& > LAYERS=karte,grid,psc&SERVICE=WMS&VERSION=1.1.1& > REQUEST=GetMap&STYLES=& > FORMAT=image/png&SRS=epsg:4326&BBOX=-180,-90,180,90& > WIDTH=600&HEIGHT=300& > map.layer[psc].filter='orbitnr=6758' > > loadLayer(): Unknown identifier. Parsing error near (orbitnr=6758):(line > 1) > > > Mapfile as below. The map is ok without the 'map.layer[]...' stuff. > > Does a kind soul knows howto do the runtime substitution from within > OpenLayer > (i know it is not the 100% correct list, but maybe someone has hit this > before). > > Regards > Heiko > > > You'll need to use 5.4 to get this functionality. That version add > > support to allow you to define > > validation strings to lock down what values can be passed for the > > variable. Another solution is > > to consider using runtime substitution to do something similar. That > > works well if the SQL is > > pretty much fixed: > > > > FILTER 'wert=%myval%' > > > > It's also easier to secure. > > > > Steve > > > > >>> On 4/6/2009 at 4:01 AM, in message > > > > <200904061101.54781.schro...@iup.physik.uni-bremen.de>, Heiko Schröter > > > > wrote: > > > Hello, > > > > > > when passing a 'FILTER' parameter to be changed with the URL to use > > > > GIS > > > > > requests, mapserv(5.0.3) fails with: > > > loadLayer(): Unknown identifier. Parsin
Re: [mapserver-users] Layer Object Parameter Substitution from URLusing GIS
On Montag, 6. April 2009 19:57:19 you wrote: Hello, the error seems to remain in mapserver 5.4: /usr/lib/cgi-bin/mapserv -v MapServer version 5.4.0-beta4 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE http://localhost/cgi-bin/mapserv? MAP=/home/schroete/sciadaten/MapServer/country98/heiko1.map& LAYERS=karte,grid,psc&SERVICE=WMS&VERSION=1.1.1& REQUEST=GetMap&STYLES=& FORMAT=image/png&SRS=epsg:4326&BBOX=-180,-90,180,90& WIDTH=600&HEIGHT=300& map.layer[psc].filter='orbitnr=6758' loadLayer(): Unknown identifier. Parsing error near (orbitnr=6758):(line 1) Mapfile as below. The map is ok without the 'map.layer[]...' stuff. Does a kind soul knows howto do the runtime substitution from within OpenLayer (i know it is not the 100% correct list, but maybe someone has hit this before). Regards Heiko > You'll need to use 5.4 to get this functionality. That version add > support to allow you to define > validation strings to lock down what values can be passed for the > variable. Another solution is > to consider using runtime substitution to do something similar. That > works well if the SQL is > pretty much fixed: > > FILTER 'wert=%myval%' > > It's also easier to secure. > > Steve > > >>> On 4/6/2009 at 4:01 AM, in message > > <200904061101.54781.schro...@iup.physik.uni-bremen.de>, Heiko Schröter > > wrote: > > Hello, > > > > when passing a 'FILTER' parameter to be changed with the URL to use > > GIS > > > requests, mapserv(5.0.3) fails with: > > loadLayer(): Unknown identifier. Parsing error near (FILTER):(line > > 1) > > > The call is: > > > > http://localhost/cgi-bin/mapserv?MAP=/MapServer/country98/heiko1.map&; > > > > LAYERS=karte,grid,psc&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap& > > STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage& > > FORMAT=image/png& > > SRS=epsg:4326&BBOX=-180,7.91,-82.08,105.83& > > WIDTH=256&HEIGHT=256& > > MAP.LAYER[psc].FILTER='wert=0' > > (Linebreaks included for readability) > > > > When omitting this part: " MAP.LAYER[psc].FILTER='wert=0' " the map > > is > > > generated fine (without the proper GIS data of course). > > > > I did read several comments in the archive and the net about this > > issue but > > > haven't found a solution to this problem. > > What do i miss here ? > > > > Thanks and Regards > > Heiko > > > > > > The Mapfile: > > MAP > > NAME WELT > > DEBUG ON > > STATUS ON > > #SIZE 647 320 > > SIZE 800 400 > > IMAGETYPE PNG24 > > IMAGECOLOR 240 240 240 > > SHAPEPATH "data" > > EXTENT -180 -90 180 90 > > UNITS DD > > WEB > > IMAGEPATH "images" > > IMAGEURL "images" > > MINSCALE 5 > > MAXSCALE 4 > > METADATA > > "wms_title" "Example WMS Server" > > "wms_onlineresource" > > "http://localhost/cgi-bin/mapserv?map=heiko.map&"; > > > "wms_srs" "epsg:4326 epsg:32661 epsg:32761" > > END > > END > > SYMBOL > > NAME 'circle' > > TYPE ELLIPSE > > POINTS 1 1 END > > FILLED TRUE > > END > > SYMBOL > > NAME 'star' > > TYPE VECTOR > > FILLED TRUE > > POINTS > > 0 .375 > > .35 .375 > > .5 0 > > .65 .375 > > 1 .375 > > .75 .625 > > .875 1 > > .5 .75 > > .125 1 > > .25 .625 > > END > > END > > PROJECTION > > "init=epsg:4326" > > END > > LAYER > > NAME "karte" > > TYPE POLYGON > > STATUS ON > > OPACITY 50 > > DATA "cntry98" > > METADATA > > "wms_title" "karte layer&q
Re: [mapserver-users] Layer Object Parameter Substitution from URLusing GIS
On Montag, 6. April 2009 19:57:19 you wrote: Thanks very much. Will check that out. Runtime substitution might not be an option since the values are passed from OpenLayer. What i have figured out OL passes the params in the URL. Heiko > You'll need to use 5.4 to get this functionality. That version add > support to allow you to define > validation strings to lock down what values can be passed for the > variable. Another solution is > to consider using runtime substitution to do something similar. That > works well if the SQL is > pretty much fixed: > > FILTER 'wert=%myval%' > > It's also easier to secure. > > Steve > > >>> On 4/6/2009 at 4:01 AM, in message > > <200904061101.54781.schro...@iup.physik.uni-bremen.de>, Heiko Schröter > > wrote: > > Hello, > > > > when passing a 'FILTER' parameter to be changed with the URL to use > > GIS > > > requests, mapserv(5.0.3) fails with: > > loadLayer(): Unknown identifier. Parsing error near (FILTER):(line > > 1) > > > The call is: > > > > http://localhost/cgi-bin/mapserv?MAP=/MapServer/country98/heiko1.map&; > > > > LAYERS=karte,grid,psc&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap& > > STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage& > > FORMAT=image/png& > > SRS=epsg:4326&BBOX=-180,7.91,-82.08,105.83& > > WIDTH=256&HEIGHT=256& > > MAP.LAYER[psc].FILTER='wert=0' > > (Linebreaks included for readability) > > > > When omitting this part: " MAP.LAYER[psc].FILTER='wert=0' " the map > > is > > > generated fine (without the proper GIS data of course). > > > > I did read several comments in the archive and the net about this > > issue but > > > haven't found a solution to this problem. > > What do i miss here ? > > > > Thanks and Regards > > Heiko > > > > > > The Mapfile: > > MAP > > NAME WELT > > DEBUG ON > > STATUS ON > > #SIZE 647 320 > > SIZE 800 400 > > IMAGETYPE PNG24 > > IMAGECOLOR 240 240 240 > > SHAPEPATH "data" > > EXTENT -180 -90 180 90 > > UNITS DD > > WEB > > IMAGEPATH "images" > > IMAGEURL "images" > > MINSCALE 5 > > MAXSCALE 4 > > METADATA > > "wms_title" "Example WMS Server" > > "wms_onlineresource" > > "http://localhost/cgi-bin/mapserv?map=heiko.map&"; > > > "wms_srs" "epsg:4326 epsg:32661 epsg:32761" > > END > > END > > SYMBOL > > NAME 'circle' > > TYPE ELLIPSE > > POINTS 1 1 END > > FILLED TRUE > > END > > SYMBOL > > NAME 'star' > > TYPE VECTOR > > FILLED TRUE > > POINTS > > 0 .375 > > .35 .375 > > .5 0 > > .65 .375 > > 1 .375 > > .75 .625 > > .875 1 > > .5 .75 > > .125 1 > > .25 .625 > > END > > END > > PROJECTION > > "init=epsg:4326" > > END > > LAYER > > NAME "karte" > > TYPE POLYGON > > STATUS ON > > OPACITY 50 > > DATA "cntry98" > > METADATA > > "wms_title" "karte layer" > > "DESCRIPTION" "Grid" > > END > > PROJECTION > > "init=epsg:4326" > > END > > CLASS > > NAME "karte_color" > > OUTLINECOLOR 60 60 60 > > COLOR 100 100 100 > > SYMBOL 0 > > END > > END > > LAYER > >NAME "grid" > >OPACITY 60 > >METADATA > > "wms_title" "grid layer" > > "DESCRIPTION" "Grid" > >END > >TYPE LINE >
[mapserver-users] Layer Object Parameter Substitution from URL using GIS
Hello, when passing a 'FILTER' parameter to be changed with the URL to use GIS requests, mapserv(5.0.3) fails with: loadLayer(): Unknown identifier. Parsing error near (FILTER):(line 1) The call is: http://localhost/cgi-bin/mapserv?MAP=/MapServer/country98/heiko1.map&; LAYERS=karte,grid,psc&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap& STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage& FORMAT=image/png& SRS=epsg:4326&BBOX=-180,7.91,-82.08,105.83& WIDTH=256&HEIGHT=256& MAP.LAYER[psc].FILTER='wert=0' (Linebreaks included for readability) When omitting this part: " MAP.LAYER[psc].FILTER='wert=0' " the map is generated fine (without the proper GIS data of course). I did read several comments in the archive and the net about this issue but haven't found a solution to this problem. What do i miss here ? Thanks and Regards Heiko The Mapfile: MAP NAME WELT DEBUG ON STATUS ON #SIZE 647 320 SIZE 800 400 IMAGETYPE PNG24 IMAGECOLOR 240 240 240 SHAPEPATH "data" EXTENT -180 -90 180 90 UNITS DD WEB IMAGEPATH "images" IMAGEURL "images" MINSCALE 5 MAXSCALE 4 METADATA "wms_title" "Example WMS Server" "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=heiko.map&"; "wms_srs" "epsg:4326 epsg:32661 epsg:32761" END END SYMBOL NAME 'circle' TYPE ELLIPSE POINTS 1 1 END FILLED TRUE END SYMBOL NAME 'star' TYPE VECTOR FILLED TRUE POINTS 0 .375 .35 .375 .5 0 .65 .375 1 .375 .75 .625 .875 1 .5 .75 .125 1 .25 .625 END END PROJECTION "init=epsg:4326" END LAYER NAME "karte" TYPE POLYGON STATUS ON OPACITY 50 DATA "cntry98" METADATA "wms_title" "karte layer" "DESCRIPTION" "Grid" END PROJECTION "init=epsg:4326" END CLASS NAME "karte_color" OUTLINECOLOR 60 60 60 COLOR 100 100 100 SYMBOL 0 END END LAYER NAME "grid" OPACITY 60 METADATA "wms_title" "grid layer" "DESCRIPTION" "Grid" END TYPE LINE STATUS ON PROJECTION "init=epsg:4326" END CLASS NAME "Graticule" COLOR 0 0 0 # Labels comented out for readabilty in the moment # LABEL # COLOR 0 0 0 # #FONT "fritqat" # #TYPE truetype #MINDISTANCE 1000 # SIZE SMALL # POSITION LR # PARTIALS FALSE # BUFFER 5 # OUTLINECOLOR 200 200 200 # END END GRID LABELFORMAT "DD" # LABELFORMAT '%g°' # dec degrees with symbol # MINARCS 1 MAXARCS 1 MININTERVAL 30 MAXINTERVAL 60 # MINSUBDIVIDE 100 MAXSUBDIVIDE 300 # LABELFORMAT ’%7.0f m’ # nice if a projected SRS used # MININTERVAL 2 # MAXSUBDIVIDE 2 END END # Layer LAYER NAME "psc" CONNECTIONTYPE POSTGIS OPACITY 80 STATUS ON METADATA "wms_title" "psc layer" END PROJECTION "init=epsg:4326" END CONNECTION "user=fum password=xyz dbname=foo host=localhost" DATA "geocenter from scia_psc" FILTER "wert=1" TYPE POINT CLASS COLOR 250 10 10 SYMBOL "circle" SIZE 7 END END LAYER CONNECTIONTYPE POSTGIS NAME "nlc" OPACITY 80 STATUS ON METADATA "wms_title" "nlc layer" END PROJECTION "init=epsg
[mapserver-users] Dynamic 'OnMouseOver' Info generation vom PostGIS/Postgres
Hello all, we are displaying satellite measurement geolocations with Mapserver and PostGIS/Postgres underneath. I would like to add a feature (similar to the MapServer:ImagMap stuff) that displays some more info about the point on which the mouse is over inside the map. i.e. geolocation, name of datafile, value or so. These infos can be sourced from the Postgres db. It is ok to just show these infos on the bottom window frame (like the MapServer:ImageMap example). How do i create the html code (javascript or php or whatever needed) with the dynamic content piped back from the Postgres db ? Sorry if this is an obvious question. I did read the ImageMap and Template stuff, but i cannot get grip to the logic when the data are coming from a db. Any pointer to more info or background knowledge deeply apreciated. Thanks. Heiko ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users