[mapserver-users] Server Root
Dear Listers, I am a beginner user of Mapserver. I installed Mapserver and Apache2 successfully. I am running Mac OS X 10.5.8 Leopard. I downloaded the tutorial data and tried to view Example 1, but I was unable to do so. I got the error for the following command: http://192.168.1.147/cgi-bin/mapserv?map=/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map msLoadMap(): Unable to access file. (/ms4w/apps/tutorial/htdocs/ example1-1.map) I noticed that the example1-1.map was not in the htdocs file in the file tree that I downloaded, but it was in the mapfile folder. I still got the same error. I searched around for the solutions on the web, but I didn't really understand them. I think the problem is that I can't find the web root where the files should be stored. I looked in the httpd.config file and saw that the ServerRoot was "/ usr" so I added the tutorial files in that folder, but again no solution. What am I doing wrong? I would appreciate any help you can provide? Thanks, Andrew Andrew Lewin, M.Sc., Adv. Dipl. GIS President Spatial-Conserve Inc. www.spatialconserve.com Email: ale...@spatialconserve.com Tel: (905) 639-4646 Mobile: (905) 630-8441 Skype: andrew.lewin99 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
mapserver-users@lists.osgeo.org
I resolved the problem. I was using FWtools2.4.6 (MapServer 5.6.0 Beta4), that hadn't enabled the AGG Rendering driver. I tried to switch to MS4W 5.2.1, and change the OUTPUTFORMAT in mapfile to this: OUTPUTFORMAT NAME 'AGG' DRIVER AGG/PNG IMAGEMODE RGB END Now it works fine. Kiks -- View this message in context: http://n2.nabble.com/Blank-image-result-after-the-call-http-localhost-mapserver-mapserv-exe-map-ecw-map-mode-map-tp4596732p4598561.html 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@lists.osgeo.org
Adjusting the MIME types I find the problem and I managed to make a WMS call to my raster maps, and I make an shp index for my tiles, too! Thanks a lot. I still have one other little problem that I can't solve... In the WMS call, if I put height and width approssimativly major than 550 pixel, the jpeg file seems to be corrupted. The MAXSIZE = 2048 has not resolved the problem. Any Ideas? Kiks This is my new filemap: MAP NAME Ortofoto # CONFIG "MS_ERRORFILE" "stdout" # DEBUG 3 CONFIG "ON_MISSING_DATA" "IGNORE" MAXSIZE 2048 UNITS METERS EXTENT 1533000 4450600 2668880 4961480 OUTPUTFORMAT NAME jpeg DRIVER "GD/JPEG" MIMETYPE "image/jpeg" IMAGEMODE RGB EXTENSION "jpg" END CONFIG "PROJ_LIB" "C:\Programmi\FWTools2.4.6\proj_lib" PROJECTION "init=epsg:4326" END LAYER NAME "orto" TYPE RASTER STATUS DEFAULT # TRANSFORM FALSE # DATA "c:\tematismi\ortofoto\197120.ecw" TILEINDEX "Ortofoto.shp" TILEITEM "Location" END # Layer END # Map File -- View this message in context: http://n2.nabble.com/Blank-image-result-after-the-call-http-localhost-mapserver-mapserv-exe-map-ecw-map-mode-map-tp4596732p4598441.html 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
Re: [mapserver-users] changing the color of a line
You can try this: http://mapserver.org/ogc/sld.html Like I said, I've never used it, have no idea if it'll work. -Andy On 2/19/2010 1:41 AM, ahmettemi...@gmail.com wrote: thank you Actually, I want to change color of contour map according to another map that lies beneath of contour map. Otherwise contours cannot be discerned. So, it' type is line. And I thought I might be able to change its color using "layer.updateFromString("COLOR 245 13 60");" but it failed. what might the alternative solutions be ? regards tarihinde, Andy Colson şunu yazdı: > On 2/18/2010 1:35 PM, ahmet temiz wrote: > > > hello > > > > how can I change the color of a line programmatically in mapscript environment > > (preferably in java) > > > > regards > > > > > I think we need a little more info. Is this line inside a layer... of type LINE? Is the layer type POLYGON and you want to change one line of one polygon? Is the line the only thing in the layer? If there are lots of lines in the layer, do you know how to find the one you want? > > > > As an example, which may not be helpful... I have perl mapscript that highlights a polygon. > > > > In my mapfile I created a new, empty layer named annotate_pin, with coloring defined (green in my case). I do sql on my PostGIS database to find the polygon I want to "highlight". I copy the polygon from the "parcels" layer into the "annotate_pin" layer. > > > > my $layer = $map->getLayerByName('parcels'); > > $layer->open(); > > > > #newlayer is misnamed... it does exist in the .map file > > my $newlayer = $map->getLayerByName('annotate_pin'); > > $newlayer->{status} = $mapscript::MS_ON; > > > > # sid here is set to the shape I want to copy/highlight > > $db->pg_result(); > > ($sid) = $q->fetchrow_array; > > > > # get the shape > > my $shp = $layer->getFeature($sid); > > $layer->close(); > > if (!$shp) > > { > >print STDERR " cannot getFeature($sid) \n"; > > } > > > > #copy it to a new shape > > my $shape = $shp->clone(); > > > > #add new shape into the annotate_pin layer > > $newlayer->addFeature($shape); > > > > ... later we draw with $map, which has one polygon in the annotate_pin layer. > > > > Note that this is one way, there is the new styling options, but it's all xml and I cant stand xml, so I never even looked at it. Not sure if this is at all what you were looking for, but hope it helps. > > > > -Andy > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] failing in updateFromString
A color should be in a style object. something like this should work: layer.updateFromString("LAYER CLASS STYLE COLOR 245 13 60 END END END"); Alan On February 19, 2010 03:29:03 am ahmettemi...@gmail.com wrote: > hello > > I want to change color of contour map according to > another map that lies beneath of contour map. Otherwise > contours cannot be discerned. > > > And I thought I might be able to change of lines' color using > > "layer.updateFromString("COLOR 245 13 60");" > > but it failed. > > what might the alternative solutions be ? > > regards > -- Alan Boudreault Mapgears http://www.mapgears.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: Linetype with spikes around a polygon
Hi, I have the same wish but I gave up to get it done in your way. Therefore I used a font (wingding3) and wanted to use that along the line. I thought it would work, but now I see the font always is aligned to the middle of the line. Even when the font symbol itself isn't centered, like the '^' character for instance. Does anybody know of a workaround? - http://www.topspots.org -- View this message in context: http://n2.nabble.com/Linetype-with-spikes-around-a-polygon-tp4597686p4597772.html 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] Linetype with spikes around a polygon
Hello list, I'm trying to create a linetype, see attached image. The spikes has to follow the line. For example, in a rectangle all the spikes pointing to the inside. Any suggestions would be welcome. Mapserver 5.0 Symbol file SYMBOL NAME "test" TYPE VECTOR POINTS 0 0 1 0 0.5 7 0 0 END FILLED TRUE STYLE 1 10 1 10 END END Map file CLASS STYLE SYMBOL 'circle' OUTLINECOLOR 0 0 0 SIZE 2 END STYLE SYMBOL 'test' OUTLINECOLOR 0 0 0 SIZE 4 END thanks in advance Fons <>___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
mapserver-users@lists.osgeo.org
Kiks wrote: > and if I add &VERSION=1.1.1, or if I try the GetMap with all > the parameters > needed (BBOX, etc.) the browser (IE 8 and Chrome) ask me to > download the > mapserv.exe ! It is not mapserv.exe. Browser just does not understand the MIME type. Save it on a disk and open it with text editor, it may give you some information. And don't hurry, your configuration is for sure not ready for WMS. Make it work with browser calls firs, read the manual and continue. http://www.mapserver.org/ogc/wms_server.html -Jukka- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
mapserver-users@lists.osgeo.org
Hi folks, thanks for the quick replies you have posted! I tried to change the STATUS to DEFAULT and I removed the projection information. Now I can see the image created with the shp2img utility, and also with the ALL_DEBUG option it seems to be all right! But I still can't get an image in the browser with these calls: http://localhost/mapserver/mapserv.exe?map=ecw.map&mode=map&layers=all http://localhost/mapserver/mapserv.exe?map=ecw.map&mode=map And when I call this: http://localhost/mapserver/mapserv.exe?map=ecw.map&SERVICE=WMS&REQUEST=GetCapabilities the reply is like before: WMS Ortofoto 2048 2048 text/xml image/jpeg image/gif image/png image/png; mode=24bit image/vnd.wap.wbmp image/tiff image/svg+xml text/plain application/vnd.ogc.gml text/xml image/jpeg image/gif image/png image/png; mode=24bit image/vnd.wap.wbmp text/xml XML INIMAGE BLANK Ortofoto Ortofoto Ortofoto 1.54612e+006 1.55288e+006 4.94363e+006 4.95025e+006 ecw ecw 1.54612e+006 1.55288e+006 4.94408e+006 4.9498e+006 and if I add &VERSION=1.1.1, or if I try the GetMap with all the parameters needed (BBOX, etc.) the browser (IE 8 and Chrome) ask me to download the mapserv.exe ! Any other suggestion to debug the WMS service? Thanks a lot, Kiks -- View this message in context: http://n2.nabble.com/Blank-image-result-after-the-call-http-localhost-mapserver-mapserv-exe-map-ecw-map-mode-map-tp4596732p4597157.html 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@lists.osgeo.org
Kiks wrote: Hi, I'm new to Mapserver, and I'm next to view my first raster image in the browser, but I still have some problems: My MapServer runs under IIS: I've installed the tool version (FWTools2.4.6) and it seems to be ok. From the browser I try this, but the response is a blank page. http://localhost/mapserver/mapserv.exe?map=ecw.map&mode=map This is the content of my mapfile (ecw.map): MAP NAME Ortofoto STATUS ON SIZE 602 589 EXTENT 1546119.5 4943633.5 1552879.5 4950247.5 UNITS METERS OUTPUTFORMAT NAME jpeg DRIVER "GD/JPEG" MIMETYPE "image/jpeg" IMAGEMODE RGB EXTENSION "jpg" END CONFIG "PROJ_LIB" "C:\Programmi\FWTools2.4.6\proj_lib" PROJECTION "init=epsg:3003" END LAYER NAME "ecw" TYPE RASTER STATUS ON TRANSFORM FALSE DATA "c:\tematismi\197120.ecw" EXTENT 1546119.5 4943633.5 1552879.5 4950247.5 PROJECTION "init=epsg:3003" END END # Layer END # Map File if I ask for capabilities http://localhost/mapserver/mapserv.exe?map=ecw.map&SERVICE=WMS&REQUEST=GetCapabilities the response is this: WMS Ortofoto 2048 2048 text/xml image/jpeg image/gif image/png image/png; mode=24bit image/vnd.wap.wbmp image/tiff image/svg+xml text/plain application/vnd.ogc.gml text/xml image/jpeg image/gif image/png image/png; mode=24bit image/vnd.wap.wbmp text/xml XML INIMAGE BLANK Ortofoto Ortofoto Ortofoto EPSG:3003 9.58154 9.66746 44.6433 44.7033 ecw ecw EPSG:3003 9.58154 9.66746 44.6433 44.7033 The problem is that I don't know how to debug and understand where I'm wrong. The extents of the ecw file is correct, I don't know about the projection, but I think there is non reason to make conversion of any type. Hello Kiks, Welcome to the MapServer community :) You should always start by using the shp2img commandline utility that comes with MapServer, to make sure that a map image is produced. http://www.mapserver.org/utilities/shp2img.html You can use the second or third examples to get some more information. Also, if you have only one layer you can remove all projection objects. If you are worried that your problem is that one data file, try another simple test with a shapefile and see if you can create a map image with shp2img. Hope this helps a little. -jeff -- Jeff McKenna MapServer 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
mapserver-users@lists.osgeo.org
Hi, It is unnecessary to have EXTENT at LAYER level, but the reason for your problem is good old STATUS. Set the layer STATUS to DEFAULT and have a new try. You should see an image, and while still in good mood read the explanation from http://www.mapserver.org/faq.html#what-does-status-mean-in-a-layer It is also a good habit to include all the WMS parameters in the requests at least when learning and testing, in this case SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities. Mapserver does answer without VERSION and defaults to 1.1.1 then, but not all WMS servers behave that way. Same is true with CaseSensitivity, standard says that parameter values are case sensitive and while servers usually are not so strict it is better to make proper requests first and do things in a lazy and faster to type way later. You had it right, no trouble with that. -Jukka Rahkonen- > -Alkuperäinen viesti- > Lähettäjä: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Kiks > Lähetetty: 19. helmikuuta 2010 10:59 > Vastaanottaja: mapserver-users@lists.osgeo.org > Aihe: [mapserver-users] Blank image result after the call > http://localhost/mapserver/mapserv.exe?map=ecw.map&mode=map > > > Hi, I'm new to Mapserver, and I'm next to view my first > raster image in the > browser, but I still have some problems: > > My MapServer runs under IIS: I've installed the tool version > (FWTools2.4.6) > and it seems to be ok. > > >From the browser I try this, but the response is a blank page. > http://localhost/mapserver/mapserv.exe?map=ecw.map&mode=map > > This is the content of my mapfile (ecw.map): > > MAP >NAME Ortofoto >STATUS ON >SIZE 602 589 >EXTENT 1546119.5 4943633.5 1552879.5 4950247.5 >UNITS METERS >OUTPUTFORMAT > NAME jpeg > DRIVER "GD/JPEG" > MIMETYPE "image/jpeg" > IMAGEMODE RGB > EXTENSION "jpg" >END >CONFIG "PROJ_LIB" "C:\Programmi\FWTools2.4.6\proj_lib" >PROJECTION >"init=epsg:3003" >END >LAYER > NAME "ecw" > TYPE RASTER > STATUS ON > TRANSFORM FALSE > DATA "c:\tematismi\197120.ecw" > EXTENT 1546119.5 4943633.5 1552879.5 4950247.5 > PROJECTION > "init=epsg:3003" > END >END # Layer > END # Map File > > > if I ask for capabilities > > http://localhost/mapserver/mapserv.exe?map=ecw.map&SERVICE=WMS > &REQUEST=GetCapabilities > > the response is this: > > WMS Ortofoto 2048 2048 text/xml image/jpeg image/gif > image/png image/png; > mode=24bit image/vnd.wap.wbmp image/tiff image/svg+xml text/plain > application/vnd.ogc.gml text/xml image/jpeg image/gif > image/png image/png; > mode=24bit image/vnd.wap.wbmp text/xml XML INIMAGE BLANK > Ortofoto Ortofoto > Ortofoto EPSG:3003 9.58154 9.66746 44.6433 44.7033 ecw ecw > EPSG:3003 9.58154 > 9.66746 44.6433 44.7033 > > The problem is that I don't know how to debug and understand where I'm > wrong. > The extents of the ecw file is correct, I don't know about > the projection, > but I think there is non reason to make conversion of any type. > > Thanks to everyone that has any suggestion. > > Kiks > -- > View this message in context: > http://n2.nabble.com/Blank-image-result-after-the-call-http-lo > calhost-mapserver-mapserv-exe-map-ecw-map-mode-map-tp4596732p4 > 596732.html > 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 mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
mapserver-users@lists.osgeo.org
Hi, I'm new to Mapserver, and I'm next to view my first raster image in the browser, but I still have some problems: My MapServer runs under IIS: I've installed the tool version (FWTools2.4.6) and it seems to be ok. >From the browser I try this, but the response is a blank page. http://localhost/mapserver/mapserv.exe?map=ecw.map&mode=map This is the content of my mapfile (ecw.map): MAP NAME Ortofoto STATUS ON SIZE 602 589 EXTENT 1546119.5 4943633.5 1552879.5 4950247.5 UNITS METERS OUTPUTFORMAT NAME jpeg DRIVER "GD/JPEG" MIMETYPE "image/jpeg" IMAGEMODE RGB EXTENSION "jpg" END CONFIG "PROJ_LIB" "C:\Programmi\FWTools2.4.6\proj_lib" PROJECTION "init=epsg:3003" END LAYER NAME "ecw" TYPE RASTER STATUS ON TRANSFORM FALSE DATA "c:\tematismi\197120.ecw" EXTENT 1546119.5 4943633.5 1552879.5 4950247.5 PROJECTION "init=epsg:3003" END END # Layer END # Map File if I ask for capabilities http://localhost/mapserver/mapserv.exe?map=ecw.map&SERVICE=WMS&REQUEST=GetCapabilities the response is this: WMS Ortofoto 2048 2048 text/xml image/jpeg image/gif image/png image/png; mode=24bit image/vnd.wap.wbmp image/tiff image/svg+xml text/plain application/vnd.ogc.gml text/xml image/jpeg image/gif image/png image/png; mode=24bit image/vnd.wap.wbmp text/xml XML INIMAGE BLANK Ortofoto Ortofoto Ortofoto EPSG:3003 9.58154 9.66746 44.6433 44.7033 ecw ecw EPSG:3003 9.58154 9.66746 44.6433 44.7033 The problem is that I don't know how to debug and understand where I'm wrong. The extents of the ecw file is correct, I don't know about the projection, but I think there is non reason to make conversion of any type. Thanks to everyone that has any suggestion. Kiks -- View this message in context: http://n2.nabble.com/Blank-image-result-after-the-call-http-localhost-mapserver-mapserv-exe-map-ecw-map-mode-map-tp4596732p4596732.html 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] failing in updateFromString
hello I want to change color of contour map according to another map that lies beneath of contour map. Otherwise contours cannot be discerned. And I thought I might be able to change of lines' color using "layer.updateFromString("COLOR 245 13 60");" but it failed. what might the alternative solutions be ? regards ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users