[mapserver-users] Setting MBR of layers displayed
Good morning all, hope you enjoyed the weekend. I am using mapserver retrieving data from a PostGIS database and have a client who wants to have one map covering a large area, containing six different prospect locations. Each prospect has different data requirements and I need to set the legend/map up so that when a user zooms into one prospect the detailed layers of all the other prospects are not drawn (or tried to be drawn) or shown in the legend as is the case when using maxscaledenom etc. Essentially I want to set an MBR so that the layers are drawn only when the map is within that MBR and a the right zoom scale. Cheers in advance. Tony ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WMS Server problem
Hi guys, Apologies for adding another question related to a similar previous post but I too am having problems getting MapServer to serve a WMS layer. At this stage I can't get a GetCapabilities (it wants to download the mapserv file) or Mode=map to work via the browser. I have been able to get the layer to render correctly using openLayers in WMS mode however. Below is my basic mapfile and openLayers file. Note I have stripped most of the styling out of the mapfile. Tony MAPFILE MAP NAME Roads250k SIZE 800 500 STATUS ON EXTENT 140 -23.25 150 -17 UNITS DD SYMBOLSET /var/www/remwms/htdocs/includes/symbols.sym FONTSET /usr/share/fonts/truetype/font.list SHAPEPATH /var/www/rem_openlayers/Data/ DEBUG 2 CONFIG MS_ERRORFILE /var/www/ms_tmp/ms_error.txt OUTPUTFORMAT NAME AGGA MIMETYPE image/png DRIVER AGG/PNG EXTENSION png IMAGEMODE RGBA TRANSPARENT ON END PROJECTION init=epsg:4283 END WEB IMAGEPATH /var/www/ms_tmp/ IMAGEURL http://mapserver1/ms_tmp/; METADATA wms_version 1.1.1 wms_title Geography250k wms_onlineresource http://mapserver1/cgi-bin/mapserv?map=/var/www/rem_openlayers/roads250k.map; wms_srs EPSG:4283 EPSG:4326 END END LAYER NAME Roads_250k GROUP Geography EXTENT 140 -23.25 150 -17 CONNECTIONTYPE postgis CONNECTION host=localhost port=5432 dbname=ga_250k user=postgres password=postgres DATA wkb_geometry FROM topo250k_majorroads using unique ogc_fid using srid=4283 METADATA wms_title roads250k wms_group_title Geography END PROJECTION init=epsg:4283 END TYPE LINE DUMP TRUE STATUS ON CLASS COLOR 255 64 64 END END END OPENLAYERS html xmlns=http://www.w3.org/1999/xhtml; head titleOpen Layers MapServer/title style type=text/css #map { width: 800px; height: 550px; border: 3px solid black; } /style script src=' http://maps.google.com/maps?file=apiamp;v=2amp;key=ABQIjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ '/script script src=http://www.openlayers.org/api/OpenLayers.js;/script script type=text/javascript var lon = 147; var lat = -20; var zoom = 6; var map; var layer; var gsat = new OpenLayers.Layer.Google( Google Earth, {type: G_HYBRID_MAP, numZoomLevels: 30} ); var qld_epm = new OpenLayers.Layer.WMS( Current EPM's, http://atlas.information.qld.gov.au/ArcGIS/services/IRTM/MapServer/WMSServer ?, {isBaseLayer:false, transparent:true, layers: 56} ); var mapserver_wms = new OpenLayers.Layer.WMS ( Geography 250k, http://mapserver1/cgi-bin/mapserv?map=/var/www/rem_openlayers/roads250k.map , {layers: roads250k, isBaseLayer:false, transparent:true} ); function init(){ map = new OpenLayers.Map( 'map', { controls: [ new OpenLayers.Control.LayerSwitcher( {title: Layer Control} ), new OpenLayers.Control.Navigation(), new OpenLayers.Control.ScaleLine(), new OpenLayers.Control.MousePosition(), new OpenLayers.Control.PanZoomBar( {title: Navigation Bar} )] }); map.addLayers([gsat,qld_epm,mapserver_wms]); map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); } /script /head body onload=init() div id=map/div /body /html ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] map projection problem
Hi All, I'm a bit confused as to the way mapserver deals with projections. My understanding is that if I place a 'PROJECTION' tag as a high level object in the mapfile, then that is the projection I should expect when I read coordinates from a tool such as Chameleon's cursorpos widget. If I then have layers using data of a different base projection I need to place a 'PROJECTION' tag within the 'LAYER' object describing the projection of the base layer. This will ensure all layers even if they are different projections will reproject correctly and layers will render in the correct position relative to each other. If the above is correct can someone explain why I my map is rendering in the projection of the base layers rather than the projection I define in the mapfile level 'PROJECTION' object. See below for me example mapfile. Tony # # Start of map file # MAP NAME sp_geography STATUS ON SIZE 800 500 EXTENT 564300 9470937 599600 9493000 UNITS METERS SHAPEPATH /opt/FriedaRiver/ IMAGECOLOR 237 255 208 SYMBOLSET /opt/testwww/htdocs/includes/symbols.sym FONTSET /usr/share/fonts/truetype/font.list DEBUG 2 CONFIG MS_ERRORFILE /opt/testwww/wms_error/ms_error.txt OUTPUTFORMAT NAME AGGA MIMETYPE image/png DRIVER AGG/PNG EXTENSION png IMAGEMODE RGBA TRANSPARENT ON END # # Start of web interface definition # WEB IMAGEPATH /opt/testwww/ms_tmp/ IMAGEURL /ms_tmp/ END # # Assign Projection # PROJECTION init=epsg:32754 END LAYER GROUP Geography CONNECTIONTYPE postgis CONNECTION host=localhost port=5432 dbname=FriedaRiver user=password= NAME Rivers DATA wkb_geometry FROM png_riversamg66z54 using unique ogc_fid PROJECTION init=epsg:20254 END METADATA SOURCE METADATA: Supplied by Xstrata 2003 END TEMPLATE /var/www/chameleon/widgets/Query/QueryResults.phtml STATUS ON TYPE LINE LABELITEM name CLASS STYLE SYMBOL minor towns COLOR 50 100 255 SIZE 1 END LABEL ANGLE FOLLOW MINDISTANCE 200 FONT ArialItalic TYPE TRUETYPE SIZE 8 COLOR 50 100 255 OUTLINECOLOR 255 255 255 POSITION UC END END END LAYER GROUP Tenement CONNECTIONTYPE postgis CONNECTION host=localhost port=5432 dbname=FriedaRiver user= password=* NAME Tenement EL58 DATA wkb_geometry FROM el58_agd66z54 using unique ogc_fid PROJECTION init=epsg:20254 END METADATA SOURCE METADATA: Supplied by Xstrata 2003 END TEMPLATE /var/www/chameleon/widgets/Query/QueryResults.phtml STATUS ON TYPE LINE CLASS STYLE COLOR 0 0 0 WIDTH 3 END END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WMS Client and SLD
All, This is the first time I have tried styling external WMS data using SLD and cannot get the returned data/image in the desired style. Below is the simplified mapfile and SLD file. If anyone has any pointers I'd be more than grateful. Please note that the link to the SLD file does work with the following return: 56 APPLICATION STATUS #ff GRANTED STATUS #be Tony Mapfile: # # Start of map file # MAP NAME qld_tenement STATUS ON SIZE 800 500 EXTENT 140 -23.25 150 -17 UNITS DD SHAPEPATH /var/www/remwms/htdocs/data IMAGECOLOR 192 213 255 SYMBOLSET /var/www/remwms/htdocs/includes/symbols.sym FONTSET /usr/share/fonts/truetype/font.list DEBUG 2 CONFIG MS_ERRORFILE /var/www/ms_tmp/ms_error.txt #IMAGETYPE PNG OUTPUTFORMAT NAME AGGA MIMETYPE image/png DRIVER AGG/PNG EXTENSION png IMAGEMODE RGBA TRANSPARENT ON END # # Start of web interface definition # WEB IMAGEPATH /var/www/ms_tmp/ IMAGEURL http://mapserver1/ms_tmp/; END # # Assign Projection # PROJECTION init=epsg:4283 END LAYER NAME EPM TYPE RASTER STATUS ON CONNECTIONTYPE WMS CONNECTION 'http://atlas.information.qld.gov.au/ArcGIS/services/IRTM/MapServer/WMSServer?' METADATA wms_srs EPSG:4326 wms_name 56 wms_server_version 1.1.1 wms_format image/png wms_title EPM wms_include_itemsall wms_sld_url http://mapserver1/remwms/includes/sld/publicsld.xml; wms_legend_graphic 0 wms_feature_info_mime_type text/plain END END END SLD File: ?xml version=1.0 encoding=UTF-8? StyledLayerDescriptor version=1.0.0 xmlns=http://www.opengis.net/sld; xmlns:ogc=http://www.opengis.net/ogc; xmlns:xlink=http://www.w3.org/1999/xlink; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd; NamedLayer Name56/Name UserStyle FeatureTypeStyle Rule NameAPPLICATION/Name ogc:Filterogc:PropertyIsEqualToogc:PropertyNameSTATUS/ogc:PropertyName/ogc:PropertyIsEqualTo/ogc:Filter PolygonSymbolizer Fill CssParameter name=fill#ff/CssParameter /Fill /PolygonSymbolizer /Rule Rule NameGRANTED/Name ogc:Filterogc:PropertyIsEqualToogc:PropertyNameSTATUS/ogc:PropertyName/ogc:PropertyIsEqualTo/ogc:Filter PolygonSymbolizer Fill CssParameter name=fill#be/CssParameter /Fill /PolygonSymbolizer /Rule /FeatureTypeStyle /UserStyle /NamedLayer /StyledLayerDescriptor -- Tony Baylis Spatial Information Specialist Resource and Exploration Mapping Suite 8, 290 Boundary St Spring Hill QLD 4000 Ph3832 1600 Fax 3832 1603 Mob 0419 759 131 Email tony.bay...@resexmap.com.au www resexmap.com.au ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] AGG Rendering problem
Thanks to Rahkonon and and Paul for their responses but neither solved the problem. I eventually moved a map from my existing working mapserver/agg instance to the rebuilt one and after doing the required bits to point it at the right data IT also did not work in AGG rendering mode. I then removed all layers and started adding them back to the map one by one to see if it was a problem with the layer setup somewhere...sure enough one of the layers was referencing a symbol in the symbolset that AGG obviously dislikes. Once I removed the 'SIZE' criteria from the 'STYLE' AGG rendering worked. Since putting the original map together I have created another (better) symbol for this object and using this all is working well. So there you have it...a symbol working with standard rendering but not with AGG, the result being the application seemed to lose connection. Tony Tony Baylis Spatial Information Specialist Resource and Exploration Mapping Suite 8, 290 Boundary St Spring Hill QLD 4000 Ph3832 1600 Fax 3832 1603 Mob 0419 759 131 Email tony.bay...@resexmap.com.au www resexmap.com.au Rahkonen Jukka wrote: Hi, Try adding MIMETYPE to outputformat. I guess that without it Mapserver is using default for jpeg requests. If you use, while testing, your own mimetype like MIMETYPE image/jpeg2 and in request use FORMAT=image/jpeg2 you should be able to compare what happens with image/jpeg and image/jpeg2. If jpeg2 works you know that Mapserver if using your own imageformat because otherwise image/jpeg2 would not be recognised. Then rename AGG MIMETYPE to image/jpeg and see if the output now seems to be generated by AGG. -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Tony Baylis Lähetetty: 26. lokakuuta 2009 15:15 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: [mapserver-users] AGG Rendering problem Hi all, This is my first post in a long time so be gentle...My problem is I have finally updated an old server to use MapServer 5.4.2 and want to use AGG rendering I have done this without a problem on another server earlier in the year but for some reason whenever I add the 'OUTPUTFORMAT' section and remove 'IMAGETYPE' I get a Connection Lost type error from the browser. Replace 'IMAGETYPE' and the connection is restored but the map is definitely not anti-aliased. Below is the relevant section from my mapfile and below that the output from a ./mapserv -v. Both outputs match the server that works. #IMAGETYPE JPEG OUTPUTFORMAT NAME AGG_JPEG DRIVER AGG/JPEG IMAGEMODE RGB END ./mapserv -vMapServer version 5.4.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_CLIENT SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=TIFF INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE Here's hoping you can help. Tony -- Tony Baylis Spatial Information Specialist Resource and Exploration Mapping Suite 8, 290 Boundary St Spring Hill QLD 4000 Ph3832 1600 Fax 3832 1603 Mob 0419 759 131 Email tony.bay...@resexmap.com.au www resexmap.com.au ___ 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] AGG Rendering problem
Hi all, This is my first post in a long time so be gentle...My problem is I have finally updated an old server to use MapServer 5.4.2 and want to use AGG rendering I have done this without a problem on another server earlier in the year but for some reason whenever I add the 'OUTPUTFORMAT' section and remove 'IMAGETYPE' I get a Connection Lost type error from the browser. Replace 'IMAGETYPE' and the connection is restored but the map is definitely not anti-aliased. Below is the relevant section from my mapfile and below that the output from a ./mapserv -v. Both outputs match the server that works. #IMAGETYPE JPEG OUTPUTFORMAT NAME AGG_JPEG DRIVER AGG/JPEG IMAGEMODE RGB END ./mapserv -vMapServer version 5.4.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_CLIENT SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=TIFF INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE Here's hoping you can help. Tony -- Tony Baylis Spatial Information Specialist Resource and Exploration Mapping Suite 8, 290 Boundary St Spring Hill QLD 4000 Ph3832 1600 Fax 3832 1603 Mob 0419 759 131 Email tony.bay...@resexmap.com.au www resexmap.com.au ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users