Re: [mapserver-users] Performance in regular expressions or an alternative way to select a list of features
Hello David, I wasn't aware of the IN syntax. It looks cleaner, and hopefully will be better. I think in the end I will try all sollutions and see which one is the fastest for a given (large) expression. Thangs again, Adrian Fawcett, David wrote: Adrian, One method that I have used is to use an IN statement in my expression and then use a variable to populate the list of IDs in the statement. I create a class like this: CLASS NAME Low EXPRESSION ('[COUNTY_FIP]' in '%group1%') OUTLINECOLOR 0 0 0 COLOR 255 204 204 END And then in the URL calling the map, I include group1=27001,27003,27005 I actually use this with five classes (five different URL vars) to create a thematic map of counties based entirely on data passed in through the URL. I have no idea on how the performance of this method compares to what you have done, but it might be worth a try. There are only 87 counties in Minnesota, so that is the largest number it gets, but the performance isn't bad. David. -Original Message- *From:* mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Adrian Popa *Sent:* Tuesday, July 14, 2009 1:15 AM *To:* mapserver-users@lists.osgeo.org *Subject:* [mapserver-users] Performance in regular expressions or an alternative way to select a list of features Hello everyone, Here's my problem: I'm trying to highlight segments from a line layer by using an expression in a specific class. This portion of the mapfile is dynamically generated and when it is done, it is sent to mapserver for rendering. My problem is that I have to select between 10 - 400 features at a time and I noticed when I have a lot of features there is a severe performance degradation in mapserver (takes a lot of time to render or even times out). Right now, my expression is built using regular expressions: something like: *EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/* This works ok, but as I said has a performance penalty when you reach ~400 items. My data is selected from a shapefile layer which has about 5500 items. Since I wouldn't be using the regular expressions at full capacity (I'm matching the full name), I might rewrite the expression using something like: *EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR ([NAME]==ITEM3) OR ([NAME]==ITEM4) )* From the documentation I see that: /Regular expression with MapServer work similarly to string comparison, but allow more complex operation. They are slower than pure string comparisons, but might be still faster than logical expression. As with the string comparison use regular expressions, a FILTERITEM or a CLASSITEM has to defined, respectively. /I would like to know if there is an efficient way of selecting a list of elements from a layer, or what are your recommendations. Also - have there been significant changes in performance for this issue from mapserver 4.10 (I am now migrating to mapserver 5.4)? Thanks, Adrian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Performance in regular expressions or analternative way to select a list of features
Hello Steve, I haven't tried out the simplified regex so I don't know if it will be faster. I will try to test it as part of a speed test of the various methods... I'm not sure what you mean by writing a temporary set of geometries. Do you mean adding an index to my data so that I can select it by a different (grouping) field instead? Unfortunately I can't do that because the same item can be part of 10-20 groups, so there would not be an easy way to group items apart from duplicating them in the shapefile/dbf. I'm not sure if there's a problem if the same feature appears 12 times in the same shapefile. In the end data reorganizing might be the fastest method available. Problem is some items will belong to groups dinamically, so I will have to implement a selection mechanism based on item id... Regards, Adrian Steve Lime wrote: Have you tried a simplified version of your regex? I think you can do: EXPRESSION /^ITEM1|ITEM2|ITEM3|ITEM4$/ You might also consider writing a temporary set of geometries if a user will continually display from that set. In that case your overhead would be in managing the set of features which would be higher the first time but then very fast to render. Your dynamic portion of the mapfile would reference the temporary data. Steve On 7/14/2009 at 1:15 AM, in message 4a5c2277.80...@romtelecom.ro, Adrian Popa adrian_gh.p...@romtelecom.ro wrote: Hello everyone, Here's my problem: I'm trying to highlight segments from a line layer by using an expression in a specific class. This portion of the mapfile is dynamically generated and when it is done, it is sent to mapserver for rendering. My problem is that I have to select between 10 - 400 features at a time and I noticed when I have a lot of features there is a severe performance degradation in mapserver (takes a lot of time to render or even times out). Right now, my expression is built using regular expressions: something like: *EXPRESSION /^ITEM1$|^ITEM2$|^ITEM3$|^ITEM4$/* This works ok, but as I said has a performance penalty when you reach ~400 items. My data is selected from a shapefile layer which has about 5500 items. Since I wouldn't be using the regular expressions at full capacity (I'm matching the full name), I might rewrite the expression using something like: *EXPRESSION ( ([NAME]==ITEM1) OR ([NAME]==ITEM2) OR ([NAME]==ITEM3) OR ([NAME]==ITEM4) )* From the documentation I see that: /Regular expression with MapServer work similarly to string comparison, but allow more complex operation. They are slower than pure string comparisons, but might be still faster than logical expression. As with the string comparison use regular expressions, a FILTERITEM or a CLASSITEM has to defined, respectively. /I would like to know if there is an efficient way of selecting a list of elements from a layer, or what are your recommendations. Also - have there been significant changes in performance for this issue from mapserver 4.10 (I am now migrating to mapserver 5.4)? Thanks, Adrian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Displaying a string instead of a label
Hi everybody, Can someone point me to the relevant part of the documentation/example that shows how to display a static string (set at the layer level) for a layer instead of displaying a label? Does 'annotation' have anything to do with this? Thanks, Adrian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Smaller polygon sizes when usingmapserver 5.4.1compare to 5.2.0
Hi Thomas, Please note, that this Mapserver behaviour (correct or incorrect) still exists in 5.4.1 version, when the GD library is used. The change of behaviour affects the rendering of the background when AGG library is used. Also, in the documentation, the use of BACKGROUNDCOLOR is regarded as creating a billboard effect. It would be nice to have capability to control the size (and appearance) of this billboard, which seems to exist in the older 5.2.0 version, but have been partially removed in the new 5.4.1 version. The other point was about the rendering of polygons. I would suggest to put some kind of a note or explanation for the 5.4.1 version, that when the OUTLINECOLOR is not specified, the polygon will be one pixel smaller in size in all directions, from the real one and to avoid this, the OUTLINECOLOR needs to be always defined either with the same colour as the rest of the polygon or with another desired colour. Best regards, Nick -Original Message- From: Thomas Bonfort [mailto:thomas.bonf...@camptocamp.com] Sent: 15 July 2009 06:36 To: Steve Lime Cc: nniko...@gypsii.com; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Smaller polygon sizes when usingmapserver 5.4.1compare to 5.2.0 the previous versions of mapserver (incorrectly I think) used the value of the label buffer to expand the background billboard. You'd get nice results whith a 1 or 2 px buffer like in your case, but unusable ones when you added larger buffers. I hope we can work around this for 5.6 with the possible label style rewrite. regards, thomas www.camptocamp.com +33 4 79 26 57 97 On Tue, Jul 14, 2009 at 03:01, Steve Limesteve.l...@dnr.state.mn.us wrote: Wonder if it's the same issue as with the polygon size you noted. Even though the shield is a rect it's rendered as a polygon. Thomas, should polygons be drawn with an outline same as the fill color if no outline color is specifiied? Steve Nikolai Nikolov nniko...@gypsii.com 07/09/09 2:43 AM Hi Steve and everyone, The images below are from Mapserver 5.2.0 (left) and 5.4.1 (right) of the same map using AGG. Please note the difference in the size of the road shields (green shields). The following are images from the same servers (Mapserver 5.2.0 (left) and 5.4.1 (right)) of the same map (different zoom) using GD. Please note that the two maps are practically the same. The complete map-file used for the first example is attached to this e-mail. The parts of it specific to the issue are like that: OUTPUTFORMAT NAME AGG_PNG DRIVER AGG/PNG MIMETYPE image/png IMAGEMODE RGB EXTENSION png #FORMATOPTION QUANTIZE_FORCE=TRUE #FORMATOPTION QUANTIZE_COLORS=256 FORMATOPTION PALETTE_FORCE=TRUE FORMATOPTION PALETTE=/var/www/html/maps_gypsii/palette.txt FORMATOPTION INTERLACE=OFF END and CLASS EXPRESSION /^E/ LABEL PRIORITY 4 PARTIALS false MINFEATURESIZE 10 MINDISTANCE 300 COLOR 255 255 255 BACKGROUNDCOLOR 128 208 100 BACKGROUNDSHADOWCOLOR 81 145 58 ANGLE 0 BUFFER 2 FONT arial-bold TYPE truetype SIZE 7 END END The difference for the second examples is in the output format used: OUTPUTFORMAT NAME PNG DRIVER GD/PNG MIMETYPE image/png IMAGEMODE RGB EXTENSION png #FORMATOPTION QUANTIZE_FORCE=TRUE #FORMATOPTION QUANTIZE_COLORS=256 FORMATOPTION PALETTE_FORCE=TRUE FORMATOPTION PALETTE=/var/www/html/maps_gypsii/palette.txt FORMATOPTION INTERLACE=OFF END Many thanks, Nick -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: 08 July 2009 15:29 To: Nikolai Nikolov; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Smaller polygon sizes when usingmapserver 5.4.1compare to 5.2.0 Perhaps you could post image samples and a mapfile? Steve On 7/8/2009 at 3:05 AM, in message 65d1c555be9443a180f3b1697ef7e...@benefonuk.local, Nikolai Nikolov nniko...@gypsii.com wrote: Hi everyone, I've just upgraded one of my test servers from 5.2.0 to 5.4.1. I have an issue there and I wonder whether anybody have noticed it. My map polygones seems to be fractionaly smaller (compare to those drawned by 5.2.0). I am using the same maps, map files, PHP scripts, etc. The plygons which belong to the same layer, do not quite well fit with each other - their borders match perfectly before the upgarde to 5.4.1. Also, I use BACKGROUNDCOLOR in my map file to create shield like square behind a label. Those squares are now significantly smaller too. I wander what causes this effect and
RE: [mapserver-users] .map file wont display in Open Layers
Thanks for your reply. I have set up the IMAGEPATH and IMAGE URL as you have suggested and i can now view the outline of my map however it is in red. As you suggested is is probably my projection which i causing this. Any ideas what the correct projection setting might be? Thanks again Paul Date: Mon, 13 Jul 2009 08:17:21 -0600 From: bfra...@geoanalytic.com To: paul_ever...@hotmail.com CC: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] .map file wont display in Open Layers Paul, You may need to define your output projection instead of using AUTO (I didn't know mapserver would tolerate that in the MAP section!). And IMAGEPATH is the file-system path to a folder writable by mapserver. Here's an example using standard ms4w: IMAGEPATH '\ms4w\tmp\ms_tmp\' with IMAGEURL being its web-based equivalent (the same location on disk but access via your web server): IMAGEURL '\ms_tmp\' since ms_tmp is set as an alias in Apache's httd.conf: Alias /ms_tmp/ C:/ms4w/tmp/ms_tmp/ Best Regards, Brent Fraser Paul Curran wrote: Hi, If anyone can help would be greatly appreciated i have been have difficulties displaying my map in Open Layers for little while now. I have a map file (uk.map) pulling in one layer which is a .shp file consisting of .tiff files i created using FWTools. However i call the .map file from my html page and the map will not display in openlayers just a blank screen within the Open Layers Window. Can anyone see where i am going wrong? Here is my map file MAP NAME ukmap STATUS ON IMAGETYPE PNG IMAGECOLOR 153 204 255 # Map image size SIZE 800 800 UNITS METERS EXTENT -888385.321101 -31000.00 1548385.321101 1271000.00 PROJECTION AUTO END # Background color for the map canvas -- change as desired IMAGECOLOR 192 192 192 IMAGEQUALITY 95 IMAGETYPE gif OUTPUTFORMAT NAME gif DRIVER 'GD/GIF' MIMETYPE 'image/gif' #IMAGEMODE PC256 EXTENSION 'gif' END # Legend LEGEND IMAGECOLOR 255 255 255 STATUS ON KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END END # Web interface definition. Only the template parameter # is required to display a map. See MapServer documentation WEB # Set IMAGEPATH to the path where MapServer should # write its output. IMAGEPATH '/tmp/' # Set IMAGEURL to the url that points to IMAGEPATH # as defined in your web server configuration IMAGEURL '/tmp/' # WMS server settings METADATA 'wms_title' 'ukmap' 'wms_onlineresource' 'http://my.host.com/cgi-bin/mapserv?map=wms.map;' 'wms_srs' 'EPSG:4326' END #Scale range at which web interface will operate # Template and header/footer settings # Only the template parameter is required to display a map. See MapServer documentation END LAYER NAME 'map' TYPE POLYGON DATA 'C:\ms4w\apps\openlayers-2.5\data\map.shp' METADATA 'wms_title' 'map' END STATUS DEFAULT TRANSPARENCY 100 PROJECTION 'proj=longlat' 'ellps=WGS84' 'datum=WGS84' 'no_defs' '' END CLASS NAME 'map' STYLE SYMBOL 0 SIZE 2 OUTLINECOLOR 0 0 0 COLOR 144 50 207 END END END END And my html page: html xmlns=http://www.w3.org/1999/xhtml; headBiNARIMS MAPPING TEST/i/B style type=text/css #map { width: 800px; height: 475px; border: 1px solid black; } /style script src=../lib/OpenLayers.js/script script type=text/javascript var lon = 5; var lat = 40; var zoom = 1; var bounds = new OpenLayers.Bounds(-888385.321101, -31000.00, 1548385.321101, 1271000.00); var map, layer; function init(){ map = new OpenLayers.Map('map', {maxExtent: bounds}); map.addControl(new OpenLayers.Control.PanZoomBar()); map.addControl(new OpenLayers.Control.MouseToolbar()); map.addControl(new OpenLayers.Control.MousePosition()); map.addControl(new OpenLayers.Control.OverviewMap()); layer = new OpenLayers.Layer.MapServer( OpenLayers WMS, http://127.0.0.1/cgi-bin/mapserv.exe;, { layers: 'basic', map: 'c:/ms4w/apps/openlayers-2.5/data/uk.map' }, { gutter: 15 }); map.addLayer(layer); map.zoomToExtent(bounds); map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); } /script /head body onload=init() div id=map/div /body /html Any help much appreciated. Thanks in advance Upgrade to Internet Explorer 8 Optimised for MSN. Download Now http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users _ Share your photos with Windows
Re: [mapserver-users] Displaying a string instead of a label
Hi Adrian, You can set the TEXT property of the CLASS object like this : CLASS NAME departement LABEL ANGLE 0.00 ANTIALIAS TRUE FONT Arial MAXSIZE 256 MINSIZE 4 SIZE 8 TYPE TRUETYPE BUFFER 0 COLOR 0 0 0 FORCE FALSE MINDISTANCE -1 MINFEATURESIZE -1 OFFSET 1 1 PARTIALS TRUE POSITION CC SHADOWCOLOR 0 0 0 END STYLE ANGLE 360 COLOR 232 246 9 OPACITY 100 SIZE 10 SYMBOL Carre END TEXT my static text END It will override the label. You don't need CLASSITEM, LABELITEM, LABELMAXSCALEDENOM and LABELMINSCADENOM but you need the LABEL object. The documentation is here : http://mapserver.org/mapfile/class.html /TEXT [string]/ /Static text to label features in this class with. This overrides values obtained from the LABELTIEM. The string may be given as an expression delimited using the ()’s. This allows you to concatenate multiple attributes into a single label. For example: ([FIRSTNAME],[LASTNAME])./ I think you can set the TEXT property on classical layer types such as POLYGON, LINE, POINT, not only ANNOTATION. If you use ANNOTATION, then the text will be placed at the centroid of the polygon of the middle of the line. Regards, -- Charlotte DECLERCQ ALKANTE SAS Ingénieur RD SIG 1, rue du Chêne Morand 35 510 Cesson-Sévigné Bur: + 33 (0) 2 99 22 25 70 fax : + 33 (0) 2 99 32 12 76 Adrian Popa a écrit : Hi everybody, Can someone point me to the relevant part of the documentation/example that shows how to display a static string (set at the layer level) for a layer instead of displaying a label? Does 'annotation' have anything to do with this? Thanks, Adrian ___ 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] Displaying a string instead of a label
Thank you Charlotte, I will give it a try! Regards, Adrian Charlotte Declercq wrote: Hi Adrian, You can set the TEXT property of the CLASS object like this : CLASS NAME departement LABEL ANGLE 0.00 ANTIALIAS TRUE FONT Arial MAXSIZE 256 MINSIZE 4 SIZE 8 TYPE TRUETYPE BUFFER 0 COLOR 0 0 0 FORCE FALSE MINDISTANCE -1 MINFEATURESIZE -1 OFFSET 1 1 PARTIALS TRUE POSITION CC SHADOWCOLOR 0 0 0 END STYLE ANGLE 360 COLOR 232 246 9 OPACITY 100 SIZE 10 SYMBOL Carre END TEXT my static text END It will override the label. You don't need CLASSITEM, LABELITEM, LABELMAXSCALEDENOM and LABELMINSCADENOM but you need the LABEL object. The documentation is here : http://mapserver.org/mapfile/class.html /TEXT [string]/ /Static text to label features in this class with. This overrides values obtained from the LABELTIEM. The string may be given as an expression delimited using the ()’s. This allows you to concatenate multiple attributes into a single label. For example: ([FIRSTNAME],[LASTNAME])./ I think you can set the TEXT property on classical layer types such as POLYGON, LINE, POINT, not only ANNOTATION. If you use ANNOTATION, then the text will be placed at the centroid of the polygon of the middle of the line. Regards, ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Mapfile displaying in red
Hi When i load my map file which can be seen below i can view the outline of map but the actual map displays as red. I am viewing the map via the mapserver.exe (e.g.http://localhost/cgi-bin/mapserv.exe?mode=mapmap=c:/ms4w/apps/openlayers-2.5/data/test.maplayer='map') Here is my map file, Can anyone spot were i am going wrong? any help greatly appreciated. The uk.shp file i am attempting to load consists of .tiff images amd was put together using FWTools MAP NAME test # Map image size SIZE 400 600 IMAGECOLOR 249 245 186 IMAGETYPE PNG24 OUTPUTFORMAT NAME PNG24 DRIVER 'GD/PNG' MIMETYPE 'image/PNG' #IMAGEMODE PC256 EXTENSION 'png' END EXTENT -888385.321101 -31000.00 1548385.321101 1271000.00 WEB IMAGEPATH \ms4w\tmp\ms_tmp\ IMAGEURL \ms_tmp\ METADATA WMS_SRS EPSG:4326 EPSG:900913 END END LAYER NAME 'map' DATA 'C:\ms4w\apps\openlayers-2.5\data\map.shp' TYPE polygon STATUS DEFAULT TRANSPARENCY 100 PROJECTION 'proj=longlat' 'ellps=WGS84' 'datum=WGS84' 'no_defs' '' END CLASS NAME 'map' STYLE COLOR 255 0 0 END LABEL TYPE bitmap END END END END _ Get the best of MSN on your mobile http://clk.atdmt.com/UKM/go/147991039/direct/01/___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] symbolset
Hi,what's the format (content)of symbolset file (.sym)?do you have some exemple, plz?Best regards;YounessELMEDRAOUILes informations figurant sur cet e-mail ont un caractère strictement confidentiel et sont exclusivement adressées au destinataire mentionné ci-dessus.Tout usage reproduction ou divulgation de cet e-mail est strictement interdit si vous n'en êtes pas le destinataire.Dans ce cas veuillez nous en avertir immédiatement par la même voie et détruire l'original. Merci ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] symbolset
Hello Try this: http://mapserver.org/mapfile/symbology/construction.html?highlight=symbol 2009/7/15 YOUNESS ELMEDRAOUI youness.elmedra...@somei.fr Hi, what's the format (content) of symbolset file (.sym)? do you have some exemple, plz? Best regards; Youness ELMEDRAOUI Les informations figurant sur cet e-mail ont un caractère strictement confidentiel et sont exclusivement adressées au destinataire mentionné ci-dessus.Tout usage, reproduction ou divulgation de cet e-mail est strictement interdit si vous n'en êtes pas le destinataire.Dans ce cas, veuillez nous en avertir immédiatement par la même voie et détruire l'original. Merci ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Martinez Morata David Thinking GIS ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Réf. : Re: [mapserver-users] symbolset
THKS, YounessELMEDRAOUILes informations figurant sur cet e-mail ont un caractère strictement confidentiel et sont exclusivement adressées au destinataire mentionné ci-dessus.Tout usage reproduction ou divulgation de cet e-mail est strictement interdit si vous n'en êtes pas le destinataire.Dans ce cas veuillez nous en avertir immédiatement par la même voie et détruire l'original. Merci ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Zoom to given coordinate(lat/lon) using Mapscript...
Thanks Tamas! On Tue, Jul 14, 2009 at 5:30 PM, Tamas Szekeres szeker...@gmail.com wrote: Paul, Assuming the desired coordinates are in the same spatial reference system as the layer you could use mapObj.setCenter and mapObj.scaleExtent. Best regards, Tamas 2009/7/14 Paul james paulj...@gmail.com How can I do that? Paul ___ 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] .map file wont display in Open Layers
Paul, The PROJECTION in the MAP portion refers to your desired output map projection. It's whatever you want it to be. The EXTENT values (and UNITS) must be relevant for your chosen projection. Brent Fraser Paul Curran wrote: Thanks for your reply. I have set up the IMAGEPATH and IMAGE URL as you have suggested and i can now view the outline of my map however it is in red. As you suggested is is probably my projection which i causing this. Any ideas what the correct projection setting might be? Thanks again Paul Date: Mon, 13 Jul 2009 08:17:21 -0600 From: bfra...@geoanalytic.com To: paul_ever...@hotmail.com CC: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] .map file wont display in Open Layers Paul, You may need to define your output projection instead of using AUTO (I didn't know mapserver would tolerate that in the MAP section!). And IMAGEPATH is the file-system path to a folder writable by mapserver. Here's an example using standard ms4w: IMAGEPATH '\ms4w\tmp\ms_tmp\' with IMAGEURL being its web-based equivalent (the same location on disk but access via your web server): IMAGEURL '\ms_tmp\' since ms_tmp is set as an alias in Apache's httd.conf: Alias /ms_tmp/ C:/ms4w/tmp/ms_tmp/ Best Regards, Brent Fraser Paul Curran wrote: Hi, If anyone can help would be greatly appreciated i have been have difficulties displaying my map in Open Layers for little while now. I have a map file (uk.map) pulling in one layer which is a .shp file consisting of .tiff files i created using FWTools. However i call the .map file from my html page and the map will not display in openlayers just a blank screen within the Open Layers Window. Can anyone see where i am going wrong? Here is my map file MAP NAME ukmap STATUS ON IMAGETYPE PNG IMAGECOLOR 153 204 255 # Map image size SIZE 800 800 UNITS METERS EXTENT -888385.321101 -31000.00 1548385.321101 1271000.00 PROJECTION AUTO END # Background color for the map canvas -- change as desired IMAGECOLOR 192 192 192 IMAGEQUALITY 95 IMAGETYPE gif OUTPUTFORMAT NAME gif DRIVER 'GD/GIF' MIMETYPE 'image/gif' #IMAGEMODE PC256 EXTENSION 'gif' END # Legend LEGEND IMAGECOLOR 255 255 255 STATUS ON KEYSIZE 18 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END END # Web interface definition. Only the template parameter # is required to display a map. See MapServer documentation WEB # Set IMAGEPATH to the path where MapServer should # write its output. IMAGEPATH '/tmp/' # Set IMAGEURL to the url that points to IMAGEPATH # as defined in your web server configuration IMAGEURL '/tmp/' # WMS server settings METADATA 'wms_title' 'ukmap' 'wms_onlineresource' 'http://my.host.com/cgi-bin/mapserv?map=wms.map;' 'wms_srs' 'EPSG:4326' END #Scale range at which web interface will operate # Template and header/footer settings # Only the template parameter is required to display a map. See MapServer documentation END LAYER NAME 'map' TYPE POLYGON DATA 'C:\ms4w\apps\openlayers-2.5\data\map.shp' METADATA 'wms_title' 'map' END STATUS DEFAULT TRANSPARENCY 100 PROJECTION 'proj=longlat' 'ellps=WGS84' 'datum=WGS84' 'no_defs' '' END CLASS NAME 'map' STYLE SYMBOL 0 SIZE 2 OUTLINECOLOR 0 0 0 COLOR 144 50 207 END END END END And my html page: html xmlns=http://www.w3.org/1999/xhtml; headBiNARIMS MAPPING TEST/i/B style type=text/css #map { width: 800px; height: 475px; border: 1px solid black; } /style script src=../lib/OpenLayers.js/script script type=text/javascript var lon = 5; var lat = 40; var zoom = 1; var bounds = new OpenLayers.Bounds(-888385.321101, -31000.00, 1548385.321101, 1271000.00); var map, layer; function init(){ map = new OpenLayers.Map('map', {maxExtent: bounds}); map.addControl(new OpenLayers.Control.PanZoomBar()); map.addControl(new OpenLayers.Control.MouseToolbar()); map.addControl(new OpenLayers.Control.MousePosition()); map.addControl(new OpenLayers.Control.OverviewMap()); layer = new OpenLayers.Layer.MapServer( OpenLayers WMS, http://127.0.0.1/cgi-bin/mapserv.exe;, { layers: 'basic', map: 'c:/ms4w/apps/openlayers-2.5/data/uk.map' }, { gutter: 15 }); map.addLayer(layer); map.zoomToExtent(bounds); map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); } /script /head body onload=init() div id=map/div /body /html Any help much appreciated. Thanks in advance Upgrade to Internet Explorer 8 Optimised for MSN. Download Now http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U ___ mapserver-users mailing list
Re: [mapserver-users] Mapfile displaying in red
Paul, Read the Mapserver documentation on tile indexing (http://mapserver.org/input/raster.html#rasters-and-tile-indexing). Best Regards, Brent Fraser Paul Curran wrote: Hi When i load my map file which can be seen below i can view the outline of map but the actual map displays as red. I am viewing the map via the mapserver.exe (e.g.http://localhost/cgi-bin/mapserv.exe?mode=mapmap=c:/ms4w/apps/openlayers-2.5/data/test.maplayer='map' http://localhost/cgi-bin/mapserv.exe?mode=mapmap=c:/ms4w/apps/openlayers-2.5/data/test.maplayer='map') Here is my map file, Can anyone spot were i am going wrong? any help greatly appreciated. The uk.shp file i am attempting to load consists of .tiff images amd was put together using FWTools MAP NAME test # Map image size SIZE 400 600 IMAGECOLOR 249 245 186 IMAGETYPE PNG24 OUTPUTFORMAT NAME PNG24 DRIVER 'GD/PNG' MIMETYPE 'image/PNG' #IMAGEMODE PC256 EXTENSION 'png' END EXTENT -888385.321101 -31000.00 1548385.321101 1271000.00 WEB IMAGEPATH \ms4w\tmp\ms_tmp\ IMAGEURL \ms_tmp\ METADATA WMS_SRS EPSG:4326 EPSG:900913 END END LAYER NAME 'map' DATA 'C:\ms4w\apps\openlayers-2.5\data\map.shp' TYPE polygon STATUS DEFAULT TRANSPARENCY 100 PROJECTION 'proj=longlat' 'ellps=WGS84' 'datum=WGS84' 'no_defs' '' END CLASS NAME 'map' STYLE COLOR 255 0 0 END LABEL TYPE bitmap END END END END Upgrade to Internet Explorer 8 Optimised for MSN. Download Now http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U ___ 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] Mapfile displaying in red
Paul, Your polygon data is red because you are telling MapServer to color it red. In the class in your layer 'map' (probably not a great layer or class name), you are using a style to color your polygons. CLASS NAME 'map' STYLE COLOR 255 0 0 END LABEL TYPE bitmap END END You have set the value of the color property to be 255 0 0. Colors are set as RGB (Red Green Blue) triplets. In that line, you are saying, 'color it with the full amount of red and don't use any green or blue'. If you change the value to 0 0 255, you will see blue polygons. For an easy way to come up with prettier colors, take a look at ColorBrewer: http://www.personal.psu.edu/cab38/ColorBrewer/ColorBrewer_intro.html David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Paul Curran Sent: Wednesday, July 15, 2009 5:20 AM To: mapser all users Subject: [mapserver-users] Mapfile displaying in red Hi When i load my map file which can be seen below i can view the outline of map but the actual map displays as red. I am viewing the map via the mapserver.exe (e.g.http://localhost/cgi-bin/mapserv.exe?mode=mapmap=c:/ms4w/apps/open layers-2.5/data/test.maplayer='map') Here is my map file, Can anyone spot were i am going wrong? any help greatly appreciated. The uk.shp file i am attempting to load consists of .tiff images amd was put together using FWTools MAP NAME test # Map image size SIZE 400 600 IMAGECOLOR 249 245 186 IMAGETYPE PNG24 OUTPUTFORMAT NAME PNG24 DRIVER 'GD/PNG' MIMETYPE 'image/PNG' #IMAGEMODE PC256 EXTENSION 'png' END EXTENT -888385.321101 -31000.00 1548385.321101 1271000.00 WEB IMAGEPATH \ms4w\tmp\ms_tmp\ IMAGEURL \ms_tmp\ METADATA WMS_SRS EPSG:4326 EPSG:900913 END END LAYER NAME 'map' DATA 'C:\ms4w\apps\openlayers-2.5\data\map.shp' TYPE polygon STATUS DEFAULT TRANSPARENCY 100 PROJECTION 'proj=longlat' 'ellps=WGS84' 'datum=WGS84' 'no_defs' '' END CLASS NAME 'map' STYLE COLOR 255 0 0 END LABEL TYPE bitmap END END END END Upgrade to Internet Explorer 8 Optimised for MSN. Download Now http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapfile displaying in red
Hello Paul, Comments inline below: Paul Curran wrote: Hi When i load my map file which can be seen below i can view the outline of map but the actual map displays as red. I am viewing the map via the mapserver.exe (e.g.http://localhost/cgi-bin/mapserv.exe?mode=mapmap=c:/ms4w/apps/openlayers-2.5/data/test.maplayer='map' http://localhost/cgi-bin/mapserv.exe?mode=mapmap=c:/ms4w/apps/openlayers-2.5/data/test.maplayer='map') For testing your mapfile, just use the shp2img commandline utility, included in MS4W (http://www.mapserver.org/utilities/shp2img.html). Here is my map file, Can anyone spot were i am going wrong? any help greatly appreciated. The uk.shp file i am attempting to load consists of .tiff images amd was put together using FWTools Make sure the EXTENT parameter is set to the extents of your shapefile - you can use the ogrinfo utility (also included in MS4W) to grab the shp's extents. I would also remove all projection objects, if you only have one layer. Also, I don't understand what data your layer consists of. Are you saying that the shapefile is an indexfile of the extents of the tiffs? (if yes, note that all the tools you needed to create it are also included in MS4W) If you have any questions about the tools in MS4W feel free to fire an email to its mailing list: http://lists.maptools.org/mailman/listinfo/ms4w-users -jeff -- Jeff McKenna FOSS4G Consulting and Training Services http://www.gatewaygeomatics.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] symbolset
YOUNESS ELMEDRAOUI wrote: Hi, what's the format (content) of symbolset file (.sym)? do you have some exemple, plz? Since I have seen you asking MS4W questions before, you're best examples will be in the MS4W add-on packages that you can download for MS4W. (I recommend studying one of the mapfiles in the PHP/MapScript Sample Application, and you can even just use its font files. If you have any questions about using MS4W add-on packages or MS4W configuration, please send questions to its mailing list at: http://lists.maptools.org/mailman/listinfo/ms4w-users -jeff -- Jeff McKenna FOSS4G Consulting and Training Services http://www.gatewaygeomatics.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] mapfile projection
Richard Greenwood wrote: On Tue, Jul 14, 2009 at 11:27 AM, Andy Colson a...@squeakycode.net mailto:a...@squeakycode.net wrote: Hi all, I'm working on my first mapping project, so IANAM (I am no a mapper). Here is the projection info from a shapefile I'm using: PROJCS[NAD_1983_StatePlane_Iowa_North_FIPS_1401_Feet, GEOGCS[GCS_North_American_1983, DATUM[D_North_American_1983, SPHEROID[GRS_1980,6378137.0,298.257222101]], PRIMEM[Greenwich,0.0], UNIT[Degree,0.017453292519943295]], PROJECTION[Lambert_Conformal_Conic], PARAMETER[False_Easting,4921250.0], PARAMETER[False_Northing,3280833.3], PARAMETER[Central_Meridian,-93.5], PARAMETER[Standard_Parallel_1,42.07], PARAMETER[Standard_Parallel_2,43.27], PARAMETER[Latitude_Of_Origin,41.5], UNIT[Foot_US,0.30480060960121924], PARAMETER[scale_factor,1.0]] I used QGIS to create a mapfile, and it generated this: PROJECTION 'proj=longlat' 'ellps=WGS84' 'datum=WGS84' 'no_defs' '' END I was kind of thinking this (Thanks to FrankW for helping me find the right epsg code): PROJECTION 'init=epsg:3417' END Is the first one even right? No Would there be a difference? The first one is spherical, but State Plane is Cartesian (on a plane). Why might I choose one over the other? I'm going to put this into postgis, with srid = 3417, will that make any difference. Yes. (I'd like to avoid re-projections.. I think... don't I?) Reprojection isn't evil. You may as well do it right, but the main thing with postgis is that you put it in, and take it out, calling the same projection. Which could be -1 if you really don't know/care. MapServer doesn't set a layer's projection from postgis. If you have a layer(s) that's different from the map's overall projection, then you'd need to set the projection in the layer definition, not necessarily in postgis. Setting a layer's projection different from the map's projection is what will trigger reprojection. HTH, -- Richard Greenwood richard.greenw...@gmail.com mailto:richard.greenw...@gmail.com www.greenwoodmap.com http://www.greenwoodmap.com Ahh, so QGIS didn't export a projection that matched my data. (I assume its a default that it always exports...) The first one is spherical, but State Plane is Cartesian (on a plane). Heh.. that's one of those answers that brings up more questions. But google is helping me out. Thanks for the help, -Andy ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] access problems from cgi-bin on Mac OS X 10.4.11 / MAMP
I'm on 10.5 and never played with 10.4, but I'll see if I can help as it's all just UNIX, right? :-) I'm also assuming that your directory definition was not copied, pasted and emailed correctly so the superfluous \ are not really in that file. Have you checked the permissions on the directory itself? It may not be possible for the apache user to cd into the directory where the cgi-bin directory resides. From: rmaurer jevoudrais0...@gmail.com To: mapserver-users@lists.osgeo.org Sent: Friday, July 10, 2009 11:28:03 AM Subject: [mapserver-users] access problems from cgi-bin on Mac OS X 10.4.11 / MAMP So I'm a first time MapServer user and have been trying to navigate the installation process. I think I almost have it, but I am having some last problems. When I access my executable mapserv file from the command line, I get this: This script can only be used to decode form results and should be initiated as a CGI process via a httpd server. All sounds good, right? Well, I am using MAMP to host an Apache2.0 server. The httpd.conf file has the following in it: Alias /cgi-bin/ [rootfile]/cgi-bin/ Directory [rootfile]/cgi-bin/\ AllowOverride None Options ExecCGI FollowSymLinks Indexes Order allow,deny Allow from all /Directory\ AddHandler cgi-script .cgi .py I know that first line should probably be ScriptAlias, but I kept getting a Permission Denied message and read in a forum that this was a solution somebody had come up with, and indeed it worked for me as well. Anyways, the problem is that in this cgi-bin I have my mapserv executable (though one of the things I'm thinking is that maybe I need to add something else to AddHandler to make it think that this file is executable?). But when I got to //localhost/cgi-bin/mapserv it tries to download the file as Untyped Binary Data and it doesn't execute anthing. In case its of any help the ls -l for my cgi-bin gives the following information: -rwxr-xr-x 1 Rebecca Rebecca 51244 Jul 9 07:52 mapserv Do I not have this installed correctly? Or is my server just not realizing that this is executable. I would be thrilled if I could just get to the point where //localhost/cgi-bin/mapserv just brought up a No query information to decode message, since I think I can handle it from there. Thank you very much, Rebecca View this message in context: access problems from cgi-bin on Mac OS X 10.4.11 / MAMP Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Java mapscript on Linux
Hello, Im trying to deploy on Linux (Ubuntu 8.04) a Java application that uses mapscript. And I cant find any libmapscript.so for Java (Ubuntu has some packages for Perl, Python PhP but not Java). Is there any other choice than getting the source code and compile it? (I believe that mapscript for PhP5 wont contain the correct JNI headers to be used by mapscript.jar) Thanks in advance! ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Java mapscript on Linux
Hi, I am afraid you have to compile java mapscript from the sources. Good luck, Umberto On Wed, Jul 15, 2009 at 7:24 PM, Ganaël Jatteaug...@galigeo.com wrote: Hello, I’m trying to deploy on Linux (Ubuntu 8.04) a Java application that uses mapscript. And I can’t find any libmapscript.so for Java (Ubuntu has some packages for Perl, Python PhP but not Java). Is there any other choice than getting the source code and compile it? (I believe that mapscript for PhP5 won’t contain the correct JNI headers to be used by mapscript.jar) Thanks in advance! ___ 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] Delete feature...
Hello ^^ I´ve defined a Marker layer like that: LAYER NAME MarkerLayer TYPE POINT FEATURE END STATUS ON TEMPLATE dummy CLASS SYMBOL circle SIZE 15 COLOR 255 120 0 END END Now, with mapscript I add several points (with method addFeature) ... How can I delete that points? Stella =_- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] GetCapabilities response being truncated
I'm still struggling to find the cause of this strange problem. Has anyone successfully run x64 MapServer (from http://vbkto.dyndns.org:1280/sdk/) on Windows? Has anyone ever seen the 4096 character truncating problem before? Thanks for any help you can provide. - John John Callahan wrote: Update: I should rephrase my statements... When run from the command line, c:\apache2.2\cgi-bin\mapserv QUERY_STRING=map=...REQUEST=GetCapabilities only works when output is to the screen. When directing the output to a file, like c:\apache2.2\cgi-bin\mapserv QUERY_STRING=map=...REQUEST=GetCapabilities geomap.xml, then the output is again truncated. The limit is not 4053 characters but rather 4096 characters. At least the number makes more sense. Using MapServer 5.4.1, x64 in Windows 2008 Server. More details on the environment is: http://vbkto.dyndns.org:1280/sdk/PackageInfo.aspx?file=release-1400-x64-gdal-1-6-mapserver-5-4.zip - John John Callahan wrote: This seems to be a strange problem... I can generate maps fine through the browser and mode=map. However, responses to GetCapabilities requests are being truncated. They are being truncated to 4053 characters. I've tried this using two separate map files, using different data, both WMS 1.1.0 and 1.1.1 versions, and the same result every time. I found some references to old posts but they didn't seem to apply here. My data in each map file is just one shapefile. My map file symbology is also very simple; it's listed below. When run from the command line (mapserv QUERY_STRING=map=...REQUEST=GetCapabilities), it works perfectly. I'm using the x64 stable build from http://vbkto.dyndns.org:1280/sdk/Default.aspx (MSVC2005 Win64) Apache 2.2.10 and PHP 5.2.5 (x64 versions) if that matters. I just don't know what's going on. Sounds like a problem with my server setup. Has anyone experienced this before? Any suggestions on what I can check? Thanks. - John * start of mapfile # Map file created from QGIS project file C:/Apache2.2/cgi-bin/maps/geomap12.qgs # Edit this file to customize for your map interface # (Created with PyQgis MapServer Export plugin) MAP NAME 'geomap12' # Map image size SIZE 600 600 UNITS meters CONFIG PROJ_LIB C:/programs/proj/nad/ EXTENT 213919.523729 80938.404739 236765.007609 99539.050324 PROJECTION init=epsg:26957 END # Background color for the map canvas -- change as desired TRANSPARENT ON IMAGECOLOR 192 192 192 IMAGEQUALITY 95 IMAGETYPE png OUTPUTFORMAT NAME png DRIVER 'GD/PNG' MIMETYPE 'image/png' #IMAGEMODE PC256 EXTENSION 'png' END # Web interface definition. Only the template parameter # is required to display a map. See MapServer documentation WEB # Set IMAGEPATH to the path where MapServer should # write its output. IMAGEPATH 'C:/Apache2.2/htdocs/output/' # Set IMAGEURL to the url that points to IMAGEPATH # as defined in your web server configuration IMAGEURL '/output/' # WMS server settings METADATA 'wms_title' 'geomap12' 'wms_onlineresource' 'http://diagproweb01/cgi-bin/mapserv.exe?map=c:/webgis/mapfiles/geomap12.map;' 'wms_srs' 'EPSG:26957 EPSG:4326' END #Scale range at which web interface will operate # Template and header/footer settings # Only the template parameter is required to display a map. See MapServer documentation END LAYER NAME 'geounits' TYPE POLYGON DATA 'C:\webgis\data\geomap_pubs\geomap12.shp' METADATA 'wms_title' 'geounits' END STATUS DEFAULT TRANSPARENCY 100 PROJECTION init=epsg:26957 END CLASS NAME 'geomap12' STYLE SYMBOL 0 SIZE 2 OUTLINECOLOR 0 0 0 COLOR 144 50 207 END ENDEND END * end of mapfile ** John Callahan, Geospatial Application Developer Delaware Geological Survey, University of Delaware URL: http://www.dgs.udel.edu ** ___ 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] Delete feature...
There's no such function at the moment, the only chance is to remove and re-create the entire layer in order to remove all features. Best regards, Tamas 2009/7/15 stela anders stelaand...@gmail.com Hello ^^ I´ve defined a Marker layer like that: LAYER NAME MarkerLayer TYPE POINT FEATURE END STATUS ON TEMPLATE dummy CLASS SYMBOL circle SIZE 15 COLOR 255 120 0 END END Now, with mapscript I add several points (with method addFeature) ... How can I delete that points? Stella =_- ___ 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