RE: [mapserver-users] mapserver vs mapscript: agg + transparency + quantize not working
Bug filed: http://trac.osgeo.org/mapserver/ticket/3201#preview Greets Gerben -Oorspronkelijk bericht- Van: Tiemens, Gerben Verzonden: Friday, November 06, 2009 11:41 AM Aan: Tiemens, Gerben CC: mapser all users; mapserver-...@lists.osgeo.org Onderwerp: RE: [mapserver-users] mapserver vs mapscript: agg + transparency + quantize not working Also imageObj.Write(stream) makes use of the msSaveImageBufferGD() Which results in the same error message Is there any other possibility to save the byteArray of an imageobj with renderer AGG or is this just a bug in mapscript C#? Greetings Gerben -Oorspronkelijk bericht- Van: Tiemens, Gerben Verzonden: Friday, November 06, 2009 9:30 AM Aan: Tiemens, Gerben CC: mapser all users; mapserver-...@lists.osgeo.org Onderwerp: RE: [mapserver-users] mapserver vs mapscript: agg + transparency + quantize not working Drilled down further to the problem. I use ImageObj.getBytes() to get the bytearray and then save the png in an other part of my code. However, the getBytes() method uses the msSaveImageBufferGD() even when my imageObj/mapObj uses an outputformat with AGG. This results in an error in the new beta (5.6.0 beta 5) with the message: - base{getBytes: General error message. Failed to get image buffer;msSaveImageBufferGD(): Image handling error. Unknown output image type driver: gd/.} System.Exception {System.ApplicationException} In previous versions the error was not given, but just went further with making a crippled image. Is there an other method to save the bytearray of an AGG image? Greetings Gerben -Oorspronkelijk bericht- Van: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Namens Tiemens, Gerben Verzonden: Thursday, November 05, 2009 9:01 PM Aan: Roger André CC: mapser all users Onderwerp: RE: [mapserver-users] mapserver vs mapscript: agg + transparency + quantize not working Thanks for your reply Roger André, But i specified my own outputformat in mapscript. When using this outputformat without the quantize options, the image comes out as wished and configured. (transparent and fullcolor) When using this outputformat with the quantize options on: -with the CGI mapserv.exe (and the saved mapfile from mapscript) the image is as configured. (transparent and all needed colors in a small png) -with mapscript, the mapobj.draw(), the image is crippled and not as wished.(not transparent, black lines are strange and labels are disapearing) It should be equal to CGI. I do'nt know why this difference between mapscript and mapserv.exe exists with the same configuration of mapfile. Has someone an idea? I tested this on MS4W 2.29 (mapserver 5.2.0) and MS4W 3.0 (mapserver 5.4.2) Greetings Gerben Van: Roger André [ran...@gmail.com] Verzonden: donderdag 5 november 2009 19:55 Aan: Tiemens, Gerben CC: mapser all users Onderwerp: Re: [mapserver-users] mapserver vs mapscript: agg + transparency + quantize not working Hi Tiemens, Not sure if this helps, but in some of the testing I did with Python mapscript, I specified the following in my code: map.selectOutputFormat(AGGPNG24) That seemed to do the trick for me. The script is inline below, in case it might help give context. Roger -- #! /usr/bin/python # mimic the Mapnik 'hello world' at # http://trac.mapnik.org/wiki/GettingStarted # based on example in Web Mapping Illustrated import mapscript # create a base mapfile map = mapscript.mapObj() map.selectOutputFormat(AGGPNG24) map.namehttp://map.name = CustomMap map.setSize(1000, 500) #map.setExtent(-180.0, -90.0, 180.0, 90.0) map.setExtent(-22, -36, 60, 38) map.imagecolor.setRGB(70,130,180) map.units = mapscript.MS_DD # set Web image params map.web.imagepath = /var/www/tmp/ map.web.imageurl = /tmp # create layer object layer = mapscript.layerObj(map) layer.namehttp://layer.name = countries #layer.type = mapscript.MS_LAYER_LINE layer.type = mapscript.MS_LAYER_POLYGON layer.status = mapscript.MS_DEFAULT layer.data = /home/randre/gis_data/unep/unep_coastlines.shp layer.template = template.html # create a class class1 = mapscript.classObj(layer) class1.namehttp://class1.name = Countries # create a style style = mapscript.styleObj(class1) style.outlinecolor.setRGB(125,125,125) style.width = 1 style.color.setRGB(240,240,240) #style.antialias = mapscript.MS_TRUE # write the map object into a map file #map.save(custom.map) # write out an image using these params mapimage = map.draw() mapimage.save(ms_world.png) -- On Thu, Nov 5, 2009 at 9:04 AM, Tiemens, Gerben gerben.tiem...@grontmij.nlmailto:gerben.tiem...@grontmij.nl wrote: I am busy writing a application with mapscript in C#. Currently I am facing the earlier mentioned problems of agg + transparent images + quantization. Is the new MS4W compiled with the quantization options? The image background is now Black. The labels are
[mapserver-users] SUA convert
Hey team I am using Mapserver to show some airspace, and the data comes in a standard format called SUA or OpenAir. Both a basic text files using LatLong and descriptives shapes, such as: TYPE=CTA/CTR TITLE=ADELAIDE TOPS=FL245 BASE=FL180 POINT=S353001 E1364920 POINT=S351526 E1373454 POINT=S351526 E1373454 ANTI-CLOCKWISE RADIUS=49.97 CENTRE=S345649 E1383128 TO=S354540 E1381803 POINT=S354540 E1381803 POINT=S362422 E1380512 POINT=S362422 E1380512 ANTI-CLOCKWISE RADIUS=89.95 CENTRE=S345649 E1383128 TO=S353001 E1364920 What would be the best (probably read here - easiest) way to display the data on mapserver? Which probably translates to - what is the easiest file format or tools to use to convert and display the data above? E.g. I could write some Perl/XSL to convert the files into KML - but is that the right format? Perhaps shape files? Or... hope above hope... maybe someone has done this already? or knows another way to show Airspace files? Thanks Scott ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: Use of palette file: Problems with changingcolors when tiling
Hi again! The mapfile we are using is about 10 000 lines of code so I have not attached that file. I can send the map file privatly, but I rather not put it on the mailing list. However, I have added the main map file, the palette file and the output format file. Espen 2009/11/7 Thomas Bonfort thomas.bonf...@camptocamp.com: Espen, please provide the complete mapfile and actual palette file that were used for the images you produced. looking at the code there's no reason another color should be picked if it was provided in the palette file, so either you're doing something wrong in your mapfile/palette combination, either there's a bug in the code somewhere. thomas www.camptocamp.com +33 5 16 57 01 02 On Sat, Nov 7, 2009 at 11:48, Espen Isaksen espen.isak...@gmail.com wrote: Is this the only way to make it work correctly? It seems a lot easier to extract all the RGB colors we use from the map file and add that to the palette file? That is what we have done now, and it will be a lot more work to actually extract the colors from all the different map images we then have to create(different colors going from mountain areas, forest areas down to urban areas). Espen 2009/11/6 Steve Lime steve.l...@dnr.state.mn.us: Correct. My palette creation process has been to: 1) create a master image that shows as many possible rendering outputs as possible as a 24-bit PNG. 2) use a tool to reduce the colors in that image to the desired number and create a 8-bit file. In my case I use PhotoShop and produce a gif. Here's a link to the one I used for our rec. compass app but after color reduction to 128 colors. http://maps.dnr.state.mn.us/compass/remove/compass_color_master.gif 3) extract a palette from the 8-bit image. I wrote a little perl script that processes gdalinfo output. 4) my outputformat block is like so: OUTPUTFORMAT NAME png DRIVER AGG/PNG MIMETYPE image/png IMAGEMODE RGB EXTENSION png FORMATOPTION INTERLACE=OFF FORMATOPTION PALETTE_FORCE=TRUE FORMATOPTION PALETTE=/mapserver/compass/compass.palette END I've not had problems with this method... It's possible there's a bug but it's going to be difficult to fix without a good test case. Steve On 11/6/2009 at 9:52 AM, in message a4cd3760911060752i609ad757g9872b8ff5a9b5...@mail.gmail.com, Espen Isaksen espen.isak...@gmail.com wrote: Sorry, this still creates trouble. And you have omitted FORMATOPTION PALETTE_FORCE=TRUE on this one. That means it does not use the palette file right? Espen 2009/11/6 Stephen Woodbridge wood...@swoodbridge.com: Espen, Try using this: OUTPUTFORMAT NAME agg DRIVER AGG/PNG MIMETYPE image/png IMAGEMODE RGB FORMATOPTION INTERLACE=false FORMATOPTION QUANTIZE_FORCE=ON FORMATOPTION QUANTIZE_DITHER=OFF FORMATOPTION QUANTIZE_COLORS=256 FORMATOPTION PALETTE=/data/maps/palette.txt END And see if it does what you want. Also note that I use ON and note TRUE as the value of QUANTIZE_FORCE, but I'm not sure if the matters or not. -Steve Espen Isaksen wrote: Yes, that is what we have been doing all along. I guess I never should have mentioned our testing with putting lots of colors in the palette file, as it just confuses people :-) So forget our testing, we have only put the colors we use in the mapfile once in the palette file(attached in the first mail), and the error in the color is like on the map I attached(first mail). Espen 2009/11/6 Thomas Bonfort thomas.bonf...@camptocamp.com: Stephen Woodbridge replied to this thread, and gave the correct usage of the palette file: set the same colors in your palette file as in your mapfile. regards, thomas www.camptocamp.com +33 5 16 57 01 02 On Fri, Nov 6, 2009 at 14:24, Espen Isaksen espen.isak...@gmail.com wrote: Justed wanted to bring this question into attention again since we did not get a solution to the problem, and we have not found one either. Could this possibly be a bug in Mapserver? Should we report it? Espen 2009/10/28 Espen Isaksen espen.isak...@gmail.com: Hi! We are testing out using a palette file in our outputformat to decrease file size in the png output. Most of the time this works great, but some times when we are tiling the data we get some errors. The color seem to shift to a similar color from one tile to another. We have added the colors we use in the map file in the palette.txt file. The documentation says it needs 256 colors in the map file, but we do not use that many colors right now. (we tried adding the same color more than one time, but that created other problems) I have attached a png file showing the problem across a lake. The color on the right side is the correct color and the color we have added to the palette file. The color on the left side of the lake is not something we have set. I have also added the
Re: [mapserver-users] SUA convert
Shapefiles tend to be faster for processing than KML, however, KML gives you the benefit (?) of being able to present your data in Google Earth. If you're just looking to display the data in Mapserver then I would definitely consider writing shapefiles. MapScript (Python, Perl, PHP, whatever) has the ability to write shapefiles pretty easily and in Python you can write the DBF file using dbfpy, in perl you can use DBD::Xbase. - Original Message From: Scott Penrose sco...@dd.com.au To: mapserver-users@lists.osgeo.org Sent: Mon, November 9, 2009 6:06:09 AM Subject: [mapserver-users] SUA convert Hey team I am using Mapserver to show some airspace, and the data comes in a standard format called SUA or OpenAir. Both a basic text files using LatLong and descriptives shapes, such as: TYPE=CTA/CTR TITLE=ADELAIDE TOPS=FL245 BASE=FL180 POINT=S353001 E1364920 POINT=S351526 E1373454 POINT=S351526 E1373454 ANTI-CLOCKWISE RADIUS=49.97 CENTRE=S345649 E1383128 TO=S354540 E1381803 POINT=S354540 E1381803 POINT=S362422 E1380512 POINT=S362422 E1380512 ANTI-CLOCKWISE RADIUS=89.95 CENTRE=S345649 E1383128 TO=S353001 E1364920 What would be the best (probably read here - easiest) way to display the data on mapserver? Which probably translates to - what is the easiest file format or tools to use to convert and display the data above? E.g. I could write some Perl/XSL to convert the files into KML - but is that the right format? Perhaps shape files? Or... hope above hope... maybe someone has done this already? or knows another way to show Airspace files? Thanks Scott ___ 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] Oracle spatial issue
Hi All, I am using some oracle spatial layers, getting this error while refreshing map for some of the layers Image handling error. Failed to draw layer named 'Landformarea'.;msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error: ORA-01002: fetch out of sequence . Query statement: SELECT OBJECTID_1, SURFACETYPE, GEOM FROM ALAIN.LANDFORMAREA WHERE SDO_FILTER( GEOM, MDSYS.SDO_GEOMETRY(2003, 32640, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(363076 .413,2679613.84,364442.736,2680338.91) ),'querytype=window') = 'TRUE' . Check your data statement. When does this 'fetch out of sequence' error is thrown by oracle. How can I resolve the issue. Appreciate help. Thanks Murty ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] mapfile web object error
Steve, I am trying to pass the error.html page and error massage as a string to Mapserver and redirect the mapfile on the fly. Below is the code that I assumed would work but doesn't, I get a Unknown Identifier error. Is this possible and if so what is wrong with my code string. input type=hidden name=map_web value=error /data/gis/www/html/error.html?message=[errmsg_esc]. Thanks, EW Steve Lime steve.l...@dnr.state.mn.us 11/6/2009 2:34 PM Your error HTML page is not a template, MapServer doesn't process it. Rather it just redirects users to it. As I mentioned you can customize the URL redirected to by passing additional information like the error message generated by MapServer. In your error page you'd have to use javascript or whatever to pluck that info off the query string and display it on your page. This is totally outside MapServer. If your error page was a PHP page you could do it there. Does that make sense? Steve On 11/6/2009 at 2:03 PM, in message 4af41e87.ced1.00d...@wapa.gov, Eric Weisbender weisb...@wapa.gov wrote: I think I understand, but in my error html page do I call it as a veriable like ... input type=text name=errmsg_esc value=[errmsg_esc] or input type=text name=message value=[message] or is there some other way to make it show up on the error.html page? EW Steve Lime steve.l...@dnr.state.mn.us 11/6/2009 11:36 AM It's basically the text you'd see in a standard error. You have the opportunity to wrap it in another look feel, somehow parse it and write your own or even add to it. Steve On 11/6/2009 at 11:47 AM, in message 4af3fed6.ced1.00d...@wapa.gov, Eric Weisbender weisb...@wapa.gov wrote: Steve, This is exactly what I am looking for. What would the html string look like to display it in my error page. Thanks a million. EW Steve Lime steve.l...@dnr.state.mn.us 11/6/2009 10:33 AM There ERROR parameter has no effect in mapscript unless you choose to do so yourself. In that environment you have total control over error messages. The CGI is a different story. In that environment the ERROR parameter is used. It's also treated like a template so you can pass the MapServer error buffer on to your default error page as an argument. For example you could do something like: WEB ... ERROR 'http://my.site.com/error.html?message=[errmsg_esc]' END and then in your page you could display the message or parse it to display a custom message. Is that what you're after? Steve On 11/6/2009 at 11:08 AM, in message 4af3f582.ced1.00d...@wapa.gov, Eric Weisbender weisb...@wapa.gov wrote: How can I include the default web error object message in my custom web error page. In the map file under the Web object there is a place to redirect/create your own error page. If you don't specify the error html page you get the standard mapserver error. This is in all versions of mapserver and it doesn't matter if you are running cgi or mapscript because it a map file web object definition. Any help would be appreciated. Thanks, EW ___ 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] Fwd: World Wind and Map Server
Does anyone in the MapServer Dev. community want to respond to this? I *think* the implication here is that a vanilla MapServer GetCapabilities request is not conforming to spec. Roger -- -- Forwarded message -- From: Tom Gaskins t...@tomgaskins.com Date: Sun, Nov 8, 2009 at 9:21 PM Subject: Re: World Wind and Map Server To: Roger André ran...@gmail.com Cc: David Collins paul.coll...@nasa.gov Roger, Thanks for clarifying, but I think I may still be confused. WMS defines two primary requests, GetCapabilities and GetMap. The first one requests the metadata associated with the server and each of the layers it serves. The second requests a map, always in the form of a raster. Reading your most recent mail, it seems you're expecting the GetCapabilities request to return a particular map. Is this correct? I'm also confused because the request you show that you'd like to specify to the demo's layer manager doesn't meet the definition of a valid WMS end point, which should be simply a host address and not contain a query string (elements after the question mark). The query string is exclusively for WMS parameters, which the WWJ demo fills in when sending the request. I've included the relevant text from the WMS spec below. I can understand that mapserver may have its own request protocol, but the demo you're using is meant to work with only conforming WMS servers. It's certainly possible for WWJ to visualize data from servers using other protocols, and many applications do that. We'd be more than happy to help you determine the best way to interact with mapserver. The demo you're trying to use, though, isn't intended to to that. Thanks, Tom *6.3.3 HTTP GET* A Web Map Service shall support the GET method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP GET requests is in fact only a URL prefix to which additional parameters are appended in order to construct a valid Operation request. A URL prefix is defined in accordance with IETF RFC 2396 as a string including, in order, the scheme (http or https), Internet Protocol hostname or numeric address, optional port number, path, mandatory question mark '?', and optional string comprising one or more server-specific parameters ending in an ampersand ''. The prefix defines the network address to which request messages are to be sent for a particular operation on a particular server. Each operation may have a different prefix. Each prefix is entirely at the discretion of the service provider. This International Standard defines how to construct a query part that is appended to the URL prefix in order to form a complete request message. Every WMS operation has several mandatory or optional request parameters. Each parameter has a defined name. Each parameter may have one or more legal values, which are either defined by this International Standard or are selected by the client based on service metadata. To formulate the query part of the URL, a client shall append the mandatory request parameters, and any desired optional parameters, as name/value pairs in the form name=value (parameter name, equals sign, parameter value, ampersand). The '' is a separator between name/value pairs, and is therefore optional after the last pair in the request string. When the HTTP GET method is used, the client-constructed query part is appended to the URL prefix defined by the server, and the resulting complete URL is invoked as defined by HTTP (IETF RFC 2616). Table 2 summarizes the components of an operation request URL when HTTP GET is used. *Table 2 — Structure of WMS request using HTTP GET* *6.3.4 HTTP POST* A Web Map Service may support the POST method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP POST requests is a complete URL (not merely a prefix as in the HTTP GET case) that is valid according to IETF RFC 2396 to which clients transmit request parameters in the body of the POST message. A WMS shall not require additional parameters to be appended to the URL in order to construct a valid target for the operation request. When POST is used, the request message is formulated as an XML document. *URL Component* *Description* http://host[:port]/path[?{name[=value]}]http://host%5B%3Aport%5D/path%5B?%7Bname%5B=value%5D%7D%5D URL prefix of service operation. [ ] denotes 0 or 1 occurrence of an optional part; {} denotes 0 or more occurrences. name=value One or more standard request parameter name/value pairs as defined for each operation by this International Standard. On Nov 8, 2009, at 12:29 PM, Roger André wrote: Hi Tom, Problem is pretty simple to describe actually. One of the executives at my company found this page, http://worldwind.arc.nasa.gov/java/demos/, and decided to try out the WMS Layer manager example, WMSLayerManager.jnlphttp://worldwind.arc.nasa.gov/java/demos/WMSLayerManager.jnlp. He liked the various layers that were available, and asked me if it would be possible to view some of
Re: [mapserver-users] Fwd: World Wind and Map Server
Hi, From a document at http://www.mapserver.org/ogc/wms_server.html#setting-up-a-wms-server-using-mapserver you can read this (and more): More About the Online Resource URL As mentioned in the section Setup a Mapfile / wms_onlineresource metadata above, the following Online Resource URL is perfectly valid for a MapServer WMS according to section 6.2.2 or the WMS 1.1.1 specification: http://my.host.com/cgi-bin/mapserv?map=mywms.map; However, some people will argue that the above URL contains mandatory vendor-specific parameters and that this is illegal. First we would like to point that map=... is not considered a vendor-specific parameter in this case since it is part of the Online Resource URL which is defined as an opaque string terminated by ? or (See WMS 1.1.1 section 6.2.2). I have never faced problems with having mapfile included in WMS url, even I usually clean it out. There can for sure be also other clients than World Wind which do not like this format. -Jukka Rahkonen- Roger André wrote: Does anyone in the MapServer Dev. community want to respond to this? I *think* the implication here is that a vanilla MapServer GetCapabilities request is not conforming to spec. Roger -- -- Forwarded message -- From: Tom Gaskins t...@tomgaskins.com Date: Sun, Nov 8, 2009 at 9:21 PM Subject: Re: World Wind and Map Server To: Roger André ran...@gmail.com Cc: David Collins paul.coll...@nasa.gov Roger, Thanks for clarifying, but I think I may still be confused. WMS defines two primary requests, GetCapabilities and GetMap. The first one requests the metadata associated with the server and each of the layers it serves. The second requests a map, always in the form of a raster. Reading your most recent mail, it seems you're expecting the GetCapabilities request to return a particular map. Is this correct? I'm also confused because the request you show that you'd like to specify to the demo's layer manager doesn't meet the definition of a valid WMS end point, which should be simply a host address and not contain a query string (elements after the question mark). The query string is exclusively for WMS parameters, which the WWJ demo fills in when sending the request. I've included the relevant text from the WMS spec below. I can understand that mapserver may have its own request protocol, but the demo you're using is meant to work with only conforming WMS servers. It's certainly possible for WWJ to visualize data from servers using other protocols, and many applications do that. We'd be more than happy to help you determine the best way to interact with mapserver. The demo you're trying to use, though, isn't intended to to that. Thanks, Tom *6.3.3 HTTP GET* A Web Map Service shall support the GET method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP GET requests is in fact only a URL prefix to which additional parameters are appended in order to construct a valid Operation request. A URL prefix is defined in accordance with IETF RFC 2396 as a string including, in order, the scheme (http or https), Internet Protocol hostname or numeric address, optional port number, path, mandatory question mark '?', and optional string comprising one or more server-specific parameters ending in an ampersand ''. The prefix defines the network address to which request messages are to be sent for a particular operation on a particular server. Each operation may have a different prefix. Each prefix is entirely at the discretion of the service provider. This International Standard defines how to construct a query part that is appended to the URL prefix in order to form a complete request message. Every WMS operation has several mandatory or optional request parameters. Each parameter has a defined name. Each parameter may have one or more legal values, which are either defined by this International Standard or are selected by the client based on service metadata. To formulate the query part of the URL, a client shall append the mandatory request parameters, and any desired optional parameters, as name/value pairs in the form name=value (parameter name, equals sign, parameter value, ampersand). The '' is a separator between name/value pairs, and is therefore optional after the last pair in the request string. When the HTTP GET method is used, the client-constructed query part is appended to the URL prefix defined by the server, and the resulting complete URL is invoked as defined by HTTP (IETF RFC 2616). Table 2 summarizes the components of an operation request URL when HTTP GET is used. *Table 2 - Structure of WMS request using HTTP GET* *6.3.4 HTTP POST* A Web Map Service may support the POST method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP POST requests is a complete URL (not merely a prefix as in the HTTP GET case) that is valid according to IETF RFC 2396 to which clients transmit request parameters in the body of the
Re: [mapserver-users] Fwd: World Wind and Map Server
Hi, it's a matter of properly setting up your service, since MAP is a vendor-specific parameter in this case. For instance using the MS_MAPFILE environment variable, so that clients don't need to use the MAP file parameter at all. Or you can do standard url rewrites with Apache. Best regards, Bart Roger André wrote: Does anyone in the MapServer Dev. community want to respond to this? I *think* the implication here is that a vanilla MapServer GetCapabilities request is not conforming to spec. Roger -- -- Forwarded message -- From: *Tom Gaskins* t...@tomgaskins.com mailto:t...@tomgaskins.com Date: Sun, Nov 8, 2009 at 9:21 PM Subject: Re: World Wind and Map Server To: Roger André ran...@gmail.com mailto:ran...@gmail.com Cc: David Collins paul.coll...@nasa.gov mailto:paul.coll...@nasa.gov Roger, Thanks for clarifying, but I think I may still be confused. WMS defines two primary requests, GetCapabilities and GetMap. The first one requests the metadata associated with the server and each of the layers it serves. The second requests a map, always in the form of a raster. Reading your most recent mail, it seems you're expecting the GetCapabilities request to return a particular map. Is this correct? I'm also confused because the request you show that you'd like to specify to the demo's layer manager doesn't meet the definition of a valid WMS end point, which should be simply a host address and not contain a query string (elements after the question mark). The query string is exclusively for WMS parameters, which the WWJ demo fills in when sending the request. I've included the relevant text from the WMS spec below. I can understand that mapserver may have its own request protocol, but the demo you're using is meant to work with only conforming WMS servers. It's certainly possible for WWJ to visualize data from servers using other protocols, and many applications do that. We'd be more than happy to help you determine the best way to interact with mapserver. The demo you're trying to use, though, isn't intended to to that. Thanks, Tom *6.3.3 HTTP GET* A Web Map Service shall support the GET method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP GET requests is in fact only a URL prefix to which additional parameters are appended in order to construct a valid Operation request. A URL prefix is defined in accordance with IETF RFC 2396 as a string including, in order, the scheme (http or https), Internet Protocol hostname or numeric address, optional port number, path, mandatory question mark '?', and optional string comprising one or more server-specific parameters ending in an ampersand ''. The prefix defines the network address to which request messages are to be sent for a particular operation on a particular server. Each operation may have a different prefix. Each prefix is entirely at the discretion of the service provider. This International Standard defines how to construct a query part that is appended to the URL prefix in order to form a complete request message. Every WMS operation has several mandatory or optional request parameters. Each parameter has a defined name. Each parameter may have one or more legal values, which are either defined by this International Standard or are selected by the client based on service metadata. To formulate the query part of the URL, a client shall append the mandatory request parameters, and any desired optional parameters, as name/value pairs in the form name=value (parameter name, equals sign, parameter value, ampersand). The '' is a separator between name/value pairs, and is therefore optional after the last pair in the request string. When the HTTP GET method is used, the client-constructed query part is appended to the URL prefix defined by the server, and the resulting complete URL is invoked as defined by HTTP (IETF RFC 2616). Table 2 summarizes the components of an operation request URL when HTTP GET is used. *Table 2 — Structure of WMS request using HTTP GET* *6.3.4 HTTP POST* A Web Map Service may support the POST method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP POST requests is a complete URL (not merely a prefix as in the HTTP GET case) that is valid according to IETF RFC 2396 to which clients transmit request parameters in the body of the POST message. A WMS shall not require additional parameters to be appended to the URL in order to construct a valid target for the operation request. When POST is used, the request message is formulated as an XML document. *URL Component* *Description* http://host[:port]/path[?{name[=value]}] http://host%5B%3Aport%5D/path%5B?%7Bname%5B=value%5D%7D%5D URL prefix of service operation. [ ] denotes 0 or 1 occurrence of an optional part; {} denotes 0 or more occurrences. name=value One or more standard request parameter name/value pairs as defined for each operation by
[mapserver-users] Fwd: World Wind and Map Server
-- Forwarded message -- From: Tom Gaskins t...@tomgaskins.com Date: Mon, Nov 9, 2009 at 9:52 AM Subject: Re: World Wind and Map Server To: Roger André ran...@gmail.com Cc: David Collins paul.coll...@nasa.gov Thanks Roger. On looking at this again this morning, the WMS spec does say that a server-specific query string may be part of the server prefix, although we've not encountered that before. It still sounds to me, however, that a map is expected to be returned from a GetCapabilities request. Nevertheless, we'll modify the relevant WWJ code to recognize the case of an existing query string in the server URL. That seems to be all you need to get past the problem Thanks, Tom On Nov 9, 2009, at 9:34 AM, Roger André wrote: HI Tom, I've forwarded your response to the MapServer list, as the implication is that MapServer may not be confirming to WMS spec in the structure of its GetCapabilities request. I can understand your confusion about the map mentioned in my message. This map has nothng to do with a GetMap request. MapServer uses the concept of a map document to define a specific project. These map documents contain all of the specifications and parameters to define the capabilities and/or appearance a specific MapServer WMS, WFS, WCS, etc. layer. Anyhow, thanks for the info, Roger -- On Sun, Nov 8, 2009 at 9:21 PM, Tom Gaskins t...@tomgaskins.com wrote: Roger, Thanks for clarifying, but I think I may still be confused. WMS defines two primary requests, GetCapabilities and GetMap. The first one requests the metadata associated with the server and each of the layers it serves. The second requests a map, always in the form of a raster. Reading your most recent mail, it seems you're expecting the GetCapabilities request to return a particular map. Is this correct? I'm also confused because the request you show that you'd like to specify to the demo's layer manager doesn't meet the definition of a valid WMS end point, which should be simply a host address and not contain a query string (elements after the question mark). The query string is exclusively for WMS parameters, which the WWJ demo fills in when sending the request. I've included the relevant text from the WMS spec below. I can understand that mapserver may have its own request protocol, but the demo you're using is meant to work with only conforming WMS servers. It's certainly possible for WWJ to visualize data from servers using other protocols, and many applications do that. We'd be more than happy to help you determine the best way to interact with mapserver. The demo you're trying to use, though, isn't intended to to that. Thanks, Tom *6.3.3 HTTP GET* A Web Map Service shall support the GET method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP GET requests is in fact only a URL prefix to which additional parameters are appended in order to construct a valid Operation request. A URL prefix is defined in accordance with IETF RFC 2396 as a string including, in order, the scheme (http or https), Internet Protocol hostname or numeric address, optional port number, path, mandatory question mark '?', and optional string comprising one or more server-specific parameters ending in an ampersand ''. The prefix defines the network address to which request messages are to be sent for a particular operation on a particular server. Each operation may have a different prefix. Each prefix is entirely at the discretion of the service provider. This International Standard defines how to construct a query part that is appended to the URL prefix in order to form a complete request message. Every WMS operation has several mandatory or optional request parameters. Each parameter has a defined name. Each parameter may have one or more legal values, which are either defined by this International Standard or are selected by the client based on service metadata. To formulate the query part of the URL, a client shall append the mandatory request parameters, and any desired optional parameters, as name/value pairs in the form name=value (parameter name, equals sign, parameter value, ampersand). The '' is a separator between name/value pairs, and is therefore optional after the last pair in the request string. When the HTTP GET method is used, the client-constructed query part is appended to the URL prefix defined by the server, and the resulting complete URL is invoked as defined by HTTP (IETF RFC 2616). Table 2 summarizes the components of an operation request URL when HTTP GET is used. *Table 2 — Structure of WMS request using HTTP GET* *6.3.4 HTTP POST* A Web Map Service may support the POST method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP POST requests is a complete URL (not merely a prefix as in the HTTP GET case) that is valid according to IETF RFC 2396 to which clients transmit request parameters in the body of
Re: [mapserver-users] Fwd: World Wind and Map Server
The beauty of open source! On 11/9/2009 at 12:41 PM, in message 9c2015090911091041u1148f583vff74da6854676...@mail.gmail.com, Roger André ran...@gmail.com wrote: -- Forwarded message -- From: Tom Gaskins t...@tomgaskins.com Date: Mon, Nov 9, 2009 at 9:52 AM Subject: Re: World Wind and Map Server To: Roger André ran...@gmail.com Cc: David Collins paul.coll...@nasa.gov Thanks Roger. On looking at this again this morning, the WMS spec does say that a server-specific query string may be part of the server prefix, although we've not encountered that before. It still sounds to me, however, that a map is expected to be returned from a GetCapabilities request. Nevertheless, we'll modify the relevant WWJ code to recognize the case of an existing query string in the server URL. That seems to be all you need to get past the problem Thanks, Tom On Nov 9, 2009, at 9:34 AM, Roger André wrote: HI Tom, I've forwarded your response to the MapServer list, as the implication is that MapServer may not be confirming to WMS spec in the structure of its GetCapabilities request. I can understand your confusion about the map mentioned in my message. This map has nothng to do with a GetMap request. MapServer uses the concept of a map document to define a specific project. These map documents contain all of the specifications and parameters to define the capabilities and/or appearance a specific MapServer WMS, WFS, WCS, etc. layer. Anyhow, thanks for the info, Roger -- On Sun, Nov 8, 2009 at 9:21 PM, Tom Gaskins t...@tomgaskins.com wrote: Roger, Thanks for clarifying, but I think I may still be confused. WMS defines two primary requests, GetCapabilities and GetMap. The first one requests the metadata associated with the server and each of the layers it serves. The second requests a map, always in the form of a raster. Reading your most recent mail, it seems you're expecting the GetCapabilities request to return a particular map. Is this correct? I'm also confused because the request you show that you'd like to specify to the demo's layer manager doesn't meet the definition of a valid WMS end point, which should be simply a host address and not contain a query string (elements after the question mark). The query string is exclusively for WMS parameters, which the WWJ demo fills in when sending the request. I've included the relevant text from the WMS spec below. I can understand that mapserver may have its own request protocol, but the demo you're using is meant to work with only conforming WMS servers. It's certainly possible for WWJ to visualize data from servers using other protocols, and many applications do that. We'd be more than happy to help you determine the best way to interact with mapserver. The demo you're trying to use, though, isn't intended to to that. Thanks, Tom *6.3.3 HTTP GET* A Web Map Service shall support the GET method of the HTTP protocol (IETF RFC 2616). An Online Resource URL intended for HTTP GET requests is in fact only a URL prefix to which additional parameters are appended in order to construct a valid Operation request. A URL prefix is defined in accordance with IETF RFC 2396 as a string including, in order, the scheme (http or https), Internet Protocol hostname or numeric address, optional port number, path, mandatory question mark '?', and optional string comprising one or more server-specific parameters ending in an ampersand ''. The prefix defines the network address to which request messages are to be sent for a particular operation on a particular server. Each operation may have a different prefix. Each prefix is entirely at the discretion of the service provider. This International Standard defines how to construct a query part that is appended to the URL prefix in order to form a complete request message. Every WMS operation has several mandatory or optional request parameters. Each parameter has a defined name. Each parameter may have one or more legal values, which are either defined by this International Standard or are selected by the client based on service metadata. To formulate the query part of the URL, a client shall append the mandatory request parameters, and any desired optional parameters, as name/value pairs in the form name=value (parameter name, equals sign, parameter value, ampersand). The '' is a separator between name/value pairs, and is therefore optional after the last pair in the request string. When the HTTP GET method is used, the client-constructed query part is appended to the URL prefix defined by the server, and the resulting complete URL is invoked as defined by HTTP (IETF RFC 2616). Table 2 summarizes the components of an operation request URL when HTTP GET is used. *Table 2 — Structure of WMS request using HTTP GET* *6.3.4 HTTP POST* A Web Map Service may support the POST method of the HTTP protocol (IETF RFC 2616). An Online Resource
[mapserver-users] Re: [mapserver-dev] Re: MS4W Beta 7 -- Python-Mapscript -- queryByRect strange behavior
Christian Jauvin wrote: if succ == MS_SUCCESS: n_res = layer.getNumResults() for j in range(n_res): res = layer.getResult(j) shp = layer.getFeature(res.shapeindex) features.append(shp) Note that starting with MapServer 5.6, when reading shapes out of a resultset, you should use the new layer.resultsGetShape() method instead of layer.getShape() or layer.getFeature(). Your script creates and queries inline features, and in this case the old method still works, but for PostGIS, Oracle and SDE data sources that is an important change to make. More info in the 5.6 migration guide (draft) at http://trac.osgeo.org/mapserver/browser/trunk/mapserver/MIGRATION_GUIDE.TXT Daniel -- Daniel Morissette http://www.mapgears.com/ ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] KML output
Hello I am asked to produce KML files from mapfiles, mostly as ground overlay. Researching into this, I've found two approaches, one PHP-MapScript based (http://sourceforge.net/projects/kmlmapserver), and C-based from a GSOC project. Is the latter one usable? Is http://trac.osgeo.org/mapserver/browser/sandbox/davidK the right sandbox? Has anybody made good or bad experiences with any of them? Regards, Peter -- Dott. Peter Hopfgartner R3 GIS Srl - GmbH Via Johann Kravogl-Str. 2 I-39012 Meran/Merano (BZ) Email: peter.hopfgart...@r3-gis.com Tel. : +39 0473 494949 Fax : +39 0473 069902 www : http://www.r3-gis.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] featurequery, TOLERANCE 0, find adjacent polygons?
Hi Ted: To answer your questions... 1) Yes, I believe so. Shapes that share an edge have a distance between them of 0 and are considered to intersect. MapServer doesn't have a means to easily detect adjacency as things sit now. 2) No, the code skips A if A is the selection layer. You could duplicate that layer in your mapfile though to get around that. Steve On 11/4/2009 at 10:31 AM, in message 1257352274593-3946385.p...@n2.nabble.com, Ted Spradley tsprad...@snoogems.com wrote: Hi, I want the user to select a polygon from the map, then return a hilited map of the selected polygon as well as the adjacent polygons along with a list of the names of each polygon. I have all of the parts of my desired query functioning independently, but not all in concert. featurequery: (layer A *must* be a polygon layer, version 5.4 supports LINE layers as well) - find the first geometry that intersects point x,y in layer A and use it to select geometries that intersect it in layer B - find the first geometry that intersects point x,y in layer A and use it to select geometries that intersect it in all other layers Two questions: 1. With mode=featurequery, does setting TOLERANCE 0 in polygon layer B return the adjacent polygons to the polygon return from layer A? 2. If I make a mode=featurequery with an img.x img.y against a polygon layer slayer=A, if I also specify qlayer=A will MapServer query layer A first to find the polygon containing the point, then query layer A again to find the intersecting (adjacent) polygons? Thanks, Ted S. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] KML output
You have 2 other options. 1) KML is not so complex that you couldn't just roll your own from any MapScript supported language. 2) Use the CGI and templates. I've used both approaches (and neither of the others). Couple of issues I've run into are: - with templates the shpxy tag doesn't allow you handle polygons with holes - templates aren't great with large data sets yet (e.g. thousands of features) since the necessary processing happens in-memory - compression, how to do kmz on-the-fly... I've used mod_deflate with both of the above with good success. The KML comes over the wire compressed and then is fed to Google Earth as uncompressed KML. On the plus side with templates since you trigger with standard MapServer queries you can return just about any set of features you want. Steve On 11/9/2009 at 1:12 PM, in message 4af8699e.3050...@r3-gis.com, Peter Hopfgartner peter.hopfgart...@r3-gis.com wrote: Hello I am asked to produce KML files from mapfiles, mostly as ground overlay. Researching into this, I've found two approaches, one PHP-MapScript based (http://sourceforge.net/projects/kmlmapserver), and C-based from a GSOC project. Is the latter one usable? Is http://trac.osgeo.org/mapserver/browser/sandbox/davidK the right sandbox? Has anybody made good or bad experiences with any of them? Regards, Peter ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Output to PDF with layers?
Hi, SkyJUMP (http://skyjumpgis.org) will soon support printing to layered PDF files, see example at http://www.ashsiii.com/downloads/SkyJUMP.pdf. Will something similar be possible with Mapserver one day? -Jukka Rahkonen- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: MS4W Beta 7 -- Python-Mapscript -- queryByRect strange behavior
[Really sorry if this message is duplicated: I kept receiving a bounce error from the ms-users list which I thought I had subscribed to, but in fact hadn't] Hi Daniel, Thanks for the note: of course I ran into the issue a little bit later (I simply had not reached yet the part of my program that deals with PostGIS layers), and I was quite happy to be aware of that! Now I really tried to figure how to upgrade my 5.6 code with the new query mechanism that you added in 5.6, but (1) I couldn't find enough documentation/example about the issue (I understand it is pretty new) and (2) couldn't make enough sense of what I read in the MS 5.6 C source that I downloaded. I cannot even figure out the exact arguments to the method (as they are not explictly stated in the SWIG generated code). If you would have time to provide a little example showing how it works, it would be greatly appreciated! Thanks, Christian On Mon, Nov 9, 2009 at 2:46 PM, Daniel Morissette dmorisse...@mapgears.com wrote: Christian Jauvin wrote: if succ == MS_SUCCESS: n_res = layer.getNumResults() for j in range(n_res): res = layer.getResult(j) shp = layer.getFeature(res.shapeindex) features.append(shp) Note that starting with MapServer 5.6, when reading shapes out of a resultset, you should use the new layer.resultsGetShape() method instead of layer.getShape() or layer.getFeature(). Your script creates and queries inline features, and in this case the old method still works, but for PostGIS, Oracle and SDE data sources that is an important change to make. More info in the 5.6 migration guide (draft) at http://trac.osgeo.org/mapserver/browser/trunk/mapserver/MIGRATION_GUIDE.TXT Daniel -- Daniel Morissette http://www.mapgears.com/ ___ MS4W-Users mailing list ms4w-us...@lists.maptools.org http://lists.maptools.org/mailman/listinfo/ms4w-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Output to PDF with layers?
We're headed towards Cairo for PDF output so if Cairo can produce layered PDFs then there's a chance MapServer will be able to. Steve On 11/9/2009 at 4:22 PM, in message cc197224ac75ce4db23f739b16891b86e34...@tikka.haapa.mmm.fi, Rahkonen Jukka jukka.rahko...@mmmtike.fi wrote: Hi, SkyJUMP (http://skyjumpgis.org) will soon support printing to layered PDF files, see example at http://www.ashsiii.com/downloads/SkyJUMP.pdf. Will something similar be possible with Mapserver one day? -Jukka Rahkonen- ___ 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