Re: [mapserver-users] Best way to do a batch reprojection (on windows)
On Aug 7, 2013, at 2:47 PM, Mark Korver mwkor...@gmail.com wrote: If you are serving to many, and are not doing cached tiled requests, On a tangential note, tiling is so trivially easy that you should always be tiling. TileCache takes about 10 mins to set up, and is worth every one of those 10 mins. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Error on mapserver
On Jul 10, 2013, at 7:15 AM, ciska...@tiscali.it ciska...@tiscali.it wrote: Warning: ms_newMapObj(): [MapServer Error]: msLoadMap(): First token must be MAP, this doesn't look like a mapfile.\n in http://www.mapserver.org/introduction.html#introduction -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] mapserver-users Digest, Vol 65, Issue 54
Dear MapServer admin, Could you please drop the responder's email from the mailing list temporarily, until the responder returns on Aug 5? Many thanks, On Jun 28, 2013, at 8:43 AM, s...@planyukon.ca wrote: Sorry I missed you, but I am on parental leave/holiday/training until August 5th. Urgent YLUPC business can be sent to the YLUPC director at r...@planyukon.ca. ___ 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] Creating lower aeriel image cache from the best resolution tiles
Yesterday at SOTMUS here in SF, Dane Springmeyer (Maobox) demonstrated something they call overzooming that might be worth investigating. It seems to solve the kind of problem Thomas is articulating. -- Puneet Kishor Policy Coordinator for Science and Data Creative Commons On Jun 9, 2013, at 9:14 AM, thomas bonfort thomas.bonf...@gmail.com wrote: Jukka, No this is not considered, and you'll have to be really persuasive to make this happen as I do not see any advantage of adding this :) The reason is that in order to create e.g. the tile for level 0 for the first time, you'll have to downsample (and maybe previously seed) the full z=21 level (and all the intermediate ones). regards, thomas On 9 June 2013 18:02, Rahkonen Jukka jukka.rahko...@mmmtike.fi wrote: Hi, Have you been considering to seed the cache for aerial or satellite image layers in opposite order compered to the normal Z0, Z1, Z2... so that only the best resolution Z(max) tiles (or perhaps also Z(max-1) were requested from the WMS? The lower resolution tiles could me created by combining and resamplint tiles from the tiles of the higher zoom level in groups of 4. This should be much faster than asking lower level images from the WMS, especially if the WMS is a remote one and connection is slow. If resampling from Z+1 tiles yields to artifacts I feel that quality by resampling from Z+2 would normally be good and speed migh be still fantastic. -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 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Problem with mapserver python mapscript
On May 14, 2013, at 8:57 AM, boesiii boes...@yahoo.com wrote: I have mapserver setup and working on Ubuntu 12.04 and I need to be able to use python mapscript so that I can use Tilecache. You do not need to use any MapScript to use TileCache. They are two separate things. TileCache uses Python cgi in its basic set up and that works just fine with MapServer cgi. I have a fairly compute intensive mapping application that is running happily with the above arrangement. -- Puneet Kishor Policy Coordinator for Science and Data Creative Commons ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Problem with mapserver python mapscript
On May 14, 2013, at 10:24 AM, boesiii boes...@yahoo.com wrote: When I try to test tilecache on Firefox using: http://localhost/tilecache-2.11/tilecache.cgi?LAYERS=basicSERVICE=WMS%20VERSION=1.1.1REQUEST=GetMapSRS=EPSG:4326BBOX=-180,-90,0,90%20WIDTH=256HEIGHT=256 The output on my screen shows the contents of tilecache.cgi, see below: #!/usr/bin python from TileCache import Service, cgiHandler, cfgfiles if __name__ == '__main__': svc = Service.load(*cfgfiles) cgiHandler(svc) You need set up your web server to handle cgi. Check your web server documentation. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] zoomable slider (looking) map from Mapserver
With Brent in sentiments. Integration of d3 with OL and Leaflet would go a long way to expanding our arsenal of mapping and viz tools. -- Puneet Kishor Policy Coordinator for Science and Data Creative Commons On Apr 9, 2013, at 8:52 AM, Brent Fraser bfra...@geoanalytic.com wrote: Bob, I'm not sure I've successfully visualized your solution, but I do appreciate your problem. While the web mapping community has come up with decent set of concepts and tools for spatially navigating data (pan, zoom, etc), we seem to be lacking a standard, intuitive (?) set of tools for temporally exploring data with a strong geospatial connection. Some of the temporal concepts stolen from geography that we'll have to deal with: event extents, event resolution/density, temporal scale (especially with respect to animation),... I think the eventual solution will be JavaScript-based, maybe nearly the size of OpenLayers effort. I'm leaning towards having separate panel (like we tend to have for the legend, etc) for time navigation. For layout and interaction ideas, have a look at the D3 examples (https://github.com/mbostock/d3/wiki/Gallery), particularly the CrossFilter (http://square.github.com/crossfilter/) example. Sorry, no solution; just encouragement... Best Regards, Brent Fraser On 4/9/2013 7:48 AM, Basques, Bob (CI-StPaul) wrote: All, Ok, granted weird title for a posting. I have a little reporting project that I’m thinking about related to GPS tracking. Bouncing the idea off of folks here in the hopes that someone may have tried this somewhere else or maybe has a better way. I need to generate a slider control for handling sorting through the GPS data for individual vehicles on a daily basis. The idea is to build a rapid, visually oriented, lookup system for the data. To begin with, I would like to start the process by querying for the data for a single GPS ID for a 24 hour period, generate a time based slider control that can be used to pick a point in time, and then have a slippy map (OpenLayers) auto zoom to that location, once a location has been decided on. I found an example on the Openlayers site for the slippy map part, I have a service (yet to build) that can grab the location data by time increments of 24 hours, but the slider part is looking like it might be a bit intensive if built in a standard way. The data for the GPS devices can come in all sorts of time resolutions, some are based on 15 – 20 sec updating, while others are using 3 sec update increments. The resulting 24hr dataset can be somewhat sizeable as a result. Here is my weird idea. Make the Slider into a MapServer map call that is aggregated at certain time increments (Map tile pyramid levels, only in a single direction, left/right) if the slider is zoomed more resolution of time appears for picking the location in the slippy map. The slider becomes a real wide but not very tall map but only for displaying, and picking by the user a new time increment. This approach should therefore compensate for browser view size as well as density of time data, by making an appropriately sized, scaled tile on demand. It should also be adaptable in the future to starting out with larger time increments to show where GPS activity was, and then to zoom in on that time increment for detailed analysis. Ok, I’m ready, tell me it’s a stupid way to go . . . Bobb ___ 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 mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Combined spatial and attribute query
On Feb 8, 2013, at 8:01 AM, Bistrais, Bob bob.bistr...@maine.gov wrote: Does anyone have advice on the best or most efficient way to query data, involving both a spatial and an attribute query. I need to query several layers, selecting based on an area, then select from that selection based on an attribute value. It would be OK to query by the attribute first, then spatial. This is a very generic, broad question that would have very specific case-by-case answers. It all depends on your query and, more importantly, your indexes. Why don't you just time both strategies and then figure out which one you could tune further. Depending on the attributes, you could possibly have more latitude playing around with the various indexes instead of just the spatial index. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Rendering Hindi Characters
On Jan 23, 2013, at 12:17 PM, Stephen Woodbridge wood...@swoodbridge.com wrote: On 1/23/2013 2:20 PM, Peter Mallen wrote: Hello Everyone, I am having issues rendering certain Hindi characters. I am using UTF-8 encoding. When attempting to display the following Hindi character in MapServer: र्ट It is rendered in MapServer as the following two characters: र् ट I believe these characters form what is called a conjunct consonant, of which there appear to be thousands of and most of them do not render using MapServer. Also, It appears that MapServer is having an issue displaying these conjunct consonants and wants to display these characters separately rather than to form them as one combined character. Here is a link describing more about the Devanagari alphabet: http://www.omniglot.com/writing/devanagari.htm Can anyone please help with this? Thank You, Peter Mallen Hi Peter, I can not speak to this specific problem but I can give you and overview. Mapserver uses fribidi library for rending this data and I know from working with Arabic that a lot depends on the font you are using, in additional to the capabilities and version of fribidi library. Isn't fribidi specifically for bidirectional languages? Hindi is strictly LTR. This kind of question is probably best asked on the fribidi list as they will know more about what is supported or not for any given language and they might be able to point you to a better font. http://www.fribidi.org/ You should probably make sure you are using a recent version of the library like 0.19.2 or better and be aware the 0.19.5 was released in Dec 2012. Peter, I forget where you and I left our off-list conversation re. the issues you were having with rendering Devnagari. Did you try feeding MapServer the correct Unicode characters? Hope you figure this out. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Rendering Hindi Characters
(adding the list back to cc so brains better than mine may help) On Jan 23, 2013, at 3:47 PM, Peter Mallen peter.mal...@airborne.aero wrote: Hi Puneet, I have passed the codes you have provided into MapServer (U+0930 U+094D U+091F ) and it displays the characters separately, not as one character. This is how Map Server displays it: र् ट hmmm... well, then this is definitely above my pay grade. Seems like you are doing the right thing, but my guess is MapServer's Unicode implementation is not working properly. I don't see any mention of Unicode on mapserver docs page. The only potentially relevant bit I see is (http://www.mapserver.org/installation/unix.html#obtaining-the-necessary-software) that libgd should be compiled against the iconv library which provides full support for Unicode. On my MBA I get $ ~ gdlib-config --libs -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng -lz -liconv Thank You, Peter Mallen -Original Message- From: Mr. Puneet Kishor [mailto:punk.k...@gmail.com] Sent: Wednesday, January 23, 2013 3:36 PM To: Peter Mallen Subject: Re: [mapserver-users] Rendering Hindi Characters On Jan 23, 2013, at 3:00 PM, Peter Mallen peter.mal...@airborne.aero wrote: Hi Puneet, I did try feeding MapServer the correct Unicode characters, and it did fix the characters using what I believe is called the Reph symbol (ि) but I could not get the conjunct consonants to display correctly. I have no idea what the above means ;-), but, did you try passing U+0930 U+094D U+091F to MapServer? See http://www.unicode.org/charts/PDF/U0900.pdf U+0930 - र - r U+094D - ् - halves the previously typed r 091F - ट - thick t U+sound Also, I have posted on the fribidi list and I believe it does only help with bidirectional languages, but I could be wrong. Thank You, Peter Mallen -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet Kishor Sent: Wednesday, January 23, 2013 12:27 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Rendering Hindi Characters On Jan 23, 2013, at 12:17 PM, Stephen Woodbridge wood...@swoodbridge.com wrote: On 1/23/2013 2:20 PM, Peter Mallen wrote: Hello Everyone, I am having issues rendering certain Hindi characters. I am using UTF-8 encoding. When attempting to display the following Hindi character in MapServer: र्ट It is rendered in MapServer as the following two characters: र् ट I believe these characters form what is called a conjunct consonant, of which there appear to be thousands of and most of them do not render using MapServer. Also, It appears that MapServer is having an issue displaying these conjunct consonants and wants to display these characters separately rather than to form them as one combined character. Here is a link describing more about the Devanagari alphabet: http://www.omniglot.com/writing/devanagari.htm Can anyone please help with this? Thank You, Peter Mallen Hi Peter, I can not speak to this specific problem but I can give you and overview. Mapserver uses fribidi library for rending this data and I know from working with Arabic that a lot depends on the font you are using, in additional to the capabilities and version of fribidi library. Isn't fribidi specifically for bidirectional languages? Hindi is strictly LTR. This kind of question is probably best asked on the fribidi list as they will know more about what is supported or not for any given language and they might be able to point you to a better font. http://www.fribidi.org/ You should probably make sure you are using a recent version of the library like 0.19.2 or better and be aware the 0.19.5 was released in Dec 2012. Peter, I forget where you and I left our off-list conversation re. the issues you were having with rendering Devnagari. Did you try feeding MapServer the correct Unicode characters? Hope you figure this out. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Rendering Hindi Characters
Peter, My guru in all things Hindi fonts tells me that the problem lies at the level where encodings are converted into font renderings. Apparently, र् ट is a perfectly correct alternate rendering of the unicode, just not Correct (with a capital C). I have no idea where this happens with MapServer. Thankfully I've never had to create a map with Hindi labels (I would be curious to learn, perhaps off-list, who wants to see maps with Hindi labels), but I too would like to see this resolved. Hope someone knowledgable chimes in. On Jan 23, 2013, at 3:58 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: (adding the list back to cc so brains better than mine may help) On Jan 23, 2013, at 3:47 PM, Peter Mallen peter.mal...@airborne.aero wrote: Hi Puneet, I have passed the codes you have provided into MapServer (U+0930 U+094D U+091F ) and it displays the characters separately, not as one character. This is how Map Server displays it: र् ट hmmm... well, then this is definitely above my pay grade. Seems like you are doing the right thing, but my guess is MapServer's Unicode implementation is not working properly. I don't see any mention of Unicode on mapserver docs page. The only potentially relevant bit I see is (http://www.mapserver.org/installation/unix.html#obtaining-the-necessary-software) that libgd should be compiled against the iconv library which provides full support for Unicode. On my MBA I get $ ~ gdlib-config --libs -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng -lz -liconv Thank You, Peter Mallen -Original Message- From: Mr. Puneet Kishor [mailto:punk.k...@gmail.com] Sent: Wednesday, January 23, 2013 3:36 PM To: Peter Mallen Subject: Re: [mapserver-users] Rendering Hindi Characters On Jan 23, 2013, at 3:00 PM, Peter Mallen peter.mal...@airborne.aero wrote: Hi Puneet, I did try feeding MapServer the correct Unicode characters, and it did fix the characters using what I believe is called the Reph symbol (ि) but I could not get the conjunct consonants to display correctly. I have no idea what the above means ;-), but, did you try passing U+0930 U+094D U+091F to MapServer? See http://www.unicode.org/charts/PDF/U0900.pdf U+0930 - र - r U+094D - ् - halves the previously typed r 091F - ट - thick t U+sound Also, I have posted on the fribidi list and I believe it does only help with bidirectional languages, but I could be wrong. Thank You, Peter Mallen -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Mr. Puneet Kishor Sent: Wednesday, January 23, 2013 12:27 PM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Rendering Hindi Characters On Jan 23, 2013, at 12:17 PM, Stephen Woodbridge wood...@swoodbridge.com wrote: On 1/23/2013 2:20 PM, Peter Mallen wrote: Hello Everyone, I am having issues rendering certain Hindi characters. I am using UTF-8 encoding. When attempting to display the following Hindi character in MapServer: र्ट It is rendered in MapServer as the following two characters: र् ट I believe these characters form what is called a conjunct consonant, of which there appear to be thousands of and most of them do not render using MapServer. Also, It appears that MapServer is having an issue displaying these conjunct consonants and wants to display these characters separately rather than to form them as one combined character. Here is a link describing more about the Devanagari alphabet: http://www.omniglot.com/writing/devanagari.htm Can anyone please help with this? Thank You, Peter Mallen Hi Peter, I can not speak to this specific problem but I can give you and overview. Mapserver uses fribidi library for rending this data and I know from working with Arabic that a lot depends on the font you are using, in additional to the capabilities and version of fribidi library. Isn't fribidi specifically for bidirectional languages? Hindi is strictly LTR. This kind of question is probably best asked on the fribidi list as they will know more about what is supported or not for any given language and they might be able to point you to a better font. http://www.fribidi.org/ You should probably make sure you are using a recent version of the library like 0.19.2 or better and be aware the 0.19.5 was released in Dec 2012. Peter, I forget where you and I left our off-list conversation re. the issues you were having with rendering Devnagari. Did you try feeding MapServer the correct Unicode characters? Hope you figure this out. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Hindi and Thai text rendering (thomas bonfort)
On Dec 18, 2012, at 10:53 AM, Ian Walberg ian.walb...@airborne.aero wrote: Some more info, this issue has the same symptoms as we have. The initial description and the correct.png and wrong.png show the same rendering issue we are seeing. http://code.google.com/p/android/issues/detail?id=4153 We are still investigating this but at the moment do not even know what those parts of these characters are called so it's tricky to find information. Can anyone on the list read these characters? .. Yes, I can, but I am not sure what you are asking. I will be happy to help you on/off list. -- Puneet Kishor Science and Data Policy at Creative Commons ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver useful for ordinary sites or not?
On Dec 5, 2012, at 9:40 AM, Saka Royban sakaroy...@yahoo.com wrote: Hi guys After a lot of effort to use CGI mapserver in my own site and finally leaving hope to find a solution, i came here to ask whether maserver is useful just for dedicated servers or VPSs really? I (and as it sounds, most of users) have just bought some space from a host provider (i.e Linux) with a CGI-bin directory which as my host provider says is able to run CGI applications written in perl and C/C++. I have searched a lot but as it appears no one has been successful to run CGI mapserver in its CGI-bin folder. Am i right? You are not right. MapServer is surprisingly easy to set up and get working, at least for basic and mid-complexity use cases. CGI mapserver is useful just when shell access is available? Should i switch to Mapscript? Or maybe, buy a windows host with CGI capability? Unless you figure out what you are doing wrong, you can't set it right. Why don't you post your issues here in detail (how you are setting things up, have you followed the tutorial, etc.) along with the errors you are getting (general description as well as specific error messages. I am sure one of us will be able to help you. Your help would nicely be appreciated. I'm really got stuck and confused. Yup, frustration is a common feeling when things don't work, but really, no need to give up. You can do it, we can help -- Puneet Kishor Science and Data Policy at Creative Commons ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver useful for ordinary sites or not?
On Dec 5, 2012, at 10:48 AM, Saka Royban sakaroy...@yahoo.com wrote: Hi Stephen It's CentOS and i've extracted that file from Enterprise Linux GIS. I ONLY have cPanel in front myself. How can i run that command? If you don't have shell access, you can ask your web host to install it for you. Most decent web hosting providers will do it for you. If they don't, you should consider moving to one who will. Sorry but i really don't know. Thanks - Original Message - From: Stephen Woodbridge wood...@swoodbridge.com To: mapserver-users@lists.osgeo.org Cc: Sent: Wednesday, December 5, 2012 10:01 PM Subject: Re: [mapserver-users] Mapserver useful for ordinary sites or not? It is probably failing because of missing dependency. Try this from the command line: /path/to/cgi-bin/mapserver -v This will give a more useful error message you can read. That said, extracting the binary and copying it to the cgi-bin is not going to work in most cases because the whole point of package systems like rpm it to find and install the dependencies. What version of linux is installed on your host? There is probably a one line command that we can give you to install mapserver the correct way. -Steve W On 12/5/2012 1:16 PM, Saka Royban wrote: Thanks for your answer After lots of try, i found that i can extract mapserver binary from rpm using 7zip. I put that executable file to cgi-bin and call it via address bar but no success, just 500 Internal Server Error. (I know mapserver has some dependencies but in spite of that it everything was right it should display a nice error) Contacting with guys in host provider, they pointed me to http://mapserver.org/installation/unix.html#installation and finally told me there is no shell access to run this commands. I'm familiar with structure of mapserver cause of working with MS4W in my own computer. In addition, i've checked CGI-bin directory by running some perl script and everything is O.K. They really provide CGI capability. Now, i don't know what can i do more. (I'm not familiar with Linux, although i know what running a shell command means. I've been around computer since DOS age) Thanks in advance for helpful advices. Regards - Original Message - From: Mr. Puneet Kishor punk.k...@gmail.com To: MapServer OSGEO mapserver-users@lists.osgeo.org Cc: Sent: Wednesday, December 5, 2012 9:24 PM Subject: Re: [mapserver-users] Mapserver useful for ordinary sites or not? On Dec 5, 2012, at 9:40 AM, Saka Royban sakaroy...@yahoo.com mailto:sakaroy...@yahoo.com wrote: Hi guys After a lot of effort to use CGI mapserver in my own site and finally leaving hope to find a solution, i came here to ask whether maserver is useful just for dedicated servers or VPSs really? I (and as it sounds, most of users) have just bought some space from a host provider (i.e Linux) with a CGI-bin directory which as my host provider says is able to run CGI applications written in perl and C/C++. I have searched a lot but as it appears no one has been successful to run CGI mapserver in its CGI-bin folder. Am i right? You are not right. MapServer is surprisingly easy to set up and get working, at least for basic and mid-complexity use cases. CGI mapserver is useful just when shell access is available? Should i switch to Mapscript? Or maybe, buy a windows host with CGI capability? Unless you figure out what you are doing wrong, you can't set it right. Why don't you post your issues here in detail (how you are setting things up, have you followed the tutorial, etc.) along with the errors you are getting (general description as well as specific error messages. I am sure one of us will be able to help you. Your help would nicely be appreciated. I'm really got stuck and confused. Yup, frustration is a common feeling when things don't work, but really, no need to give up. You can do it, we can help -- Puneet Kishor Science and Data Policy at Creative Commons ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] [mapserver-dev] MapServer 6.2 released
As my work focuses more and more on the outer envelope of science and data, this reminds me more and more of how much we all owe to the work you guys do at the core. Much gratitude and respect. -- Puneet Kishor Science and Data Policy at Creative Commons On Nov 14, 2012, at 7:15 AM, Lime, Steve D (DNR) steve.l...@state.mn.us wrote: And on GIS Day no less… nice timing. Fabulous work by all those that contributed code. A special shout out to Thomas for handling the release manager role. Thanks everyone! Steve From: mapserver-dev-boun...@lists.osgeo.org [mailto:mapserver-dev-boun...@lists.osgeo.org] On Behalf Of thomas bonfort Sent: Wednesday, November 14, 2012 9:03 AM To: MapServer Dev Mailing List; MapserverList OSGEO; osgeo-discuss (disc...@lists.osgeo.org) Subject: [mapserver-dev] MapServer 6.2 released The MapServer team is pleased to announce the release of MapServer 6.2, along with the joint release of tinyOWS 1.1.0 and MapCache 1.0.0. Details of the new features, migration instructions, and download links can be found on the dedicated announcement page at http://www.mapserver.org/development/announce/6-2.html . cheers, The MapServer PSC ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PerlMapscript on Windows (Helmut Seidel M.A.)
On Nov 14, 2012, at 12:34 PM, lfi...@medinaco.org wrote: Date: Wed, 14 Nov 2012 19:20:48 +0100 From: Helmut Seidel M.A. i...@knowhow-la.de To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] PerlMapscript on Windows Message-ID: 50a3e100.5020...@knowhow-la.de Content-Type: text/plain; charset=ISO-8859-15; format=flowed Hello everybody, I've just started on Mapserver again - I normaly use (opensuse 12.2-/ ubuntu 12.04-) Linux and and would like to use perl scripting. On both Linuxes it is no problem to install Perl Mapscript but as far as I've seen MS4W and OSGEO don't come with Perl Mapscript. As my Scripts have to run on Windows I wonder whether there is an easy way to install it or does it mean compiling for Windows? Is there some kind of howto for installing PerlMapscript? Thanks very much In the source directory mapscript/perl the README file explains the compilation process. I've never tried on Windows however and don't know if it will work. (Hi Lowell). I am pretty sure it won't work as compiling it requires SWIG, and, of course, a compiler. So, someone has to make the module (or dll or whatever it is called on Windows) and provide it. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WFS fails if table name includes a dot character
On Oct 9, 2012, at 7:51 AM, Rahkonen Jukka jukka.rahko...@mmmtike.fi wrote: Hi, It may be an odd idea to use dots in table/feature type names, but because I made such a test and faced a problem so I report it here. Source table is in PostGIS and its name is dot.test. WFS DescribeFeatureType leads to following error [Tue Oct 9 10:56:02 2012].214191 msPostGISLayerGetItems(): Query error. Error (ERROR: schema dot does not exist LINE 1: select * from dot.test where false limit 0 ^ ) executing SQL: select * from dot.test where false limit 0 [Tue Oct 9 10:57:12 2012].923891 msPostGISLayerGetItems(): Query error. Error (ERROR: schema dot does not exist LINE 1: select * from dot.test where false limit 0 ^ ) executing SQL: select * from dot.test where false limit 0 -Jukka Rahkonen- ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users If using non-standard characters, double quote the entity name. So, try SELECT * FROM dot.test WHERE ... To be completely unambiguous, prefix the schema name. So, if the table is in schema foo, try SELECT * FROM foo.dot.test WHERE ... -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] MapServer and shapefile
On Oct 4, 2012, at 10:56 PM, Fabio Brolese fabiobrolese-fo...@yahoo.it wrote: Trying using shapefile as base layer I didn't find where to put my shapefile and to let them seen by MapServer. The examples say me to set the map file correctly but not where to save the shp files how to say to MapServer where thay are. Is there a directive in the main map file where to set the location of shp files like I set the log file path and etc. http://mapserver.org/mapfile/map.html MAP SHAPEPATH [filename] Path to the directory holding the shapefiles or tiles. There can be further subdirectories under SHAPEPATH. http://mapserver.org/mapfile/layer.html LAYER DATA [filename]|[sde parameters][postgis table/column][oracle table/column] Full filename of the spatial data to process. No file extension is necessary for shapefiles. Can be specified relative to the SHAPEPATH option from the Map Object. Da: Cristiano Sumariva sumar...@gmail.com A: Fabio Brolese fabiobrolese-fo...@yahoo.it Inviato: Martedì 2 Ottobre 2012 13:14 Oggetto: Re: [mapserver-users] MapServer and shapefile If your map vector is not huge, and processing time is not a problem - something greater then a few seconds for a tile - you can use a WMS layer as base. Just add isBaseLayer true to parameter options on layer. This should be minimal to change. At my sites I did not note WMS overhead on requests. You should know that OpenLayers is greed and will issue several concurrent requests to server. Processing spikes will happen. For larger sets you maybe at the need of some cache stuff. Consider using one in a programming language you know in case you need do maintenance in source code. Or if confortable with some, create your particular simple cache maybe an option. 2012/10/2 Fabio Brolese fabiobrolese-fo...@yahoo.it Yes, sorry, I was talking about OpenLayers. I understood and is like I did with all the layers I set pointing on PostGIS. I have also a base layer set as OpenLayers.Layer.TMS that load image tiles to show the city map. What we want to do is to change the base layer to read the city map from shapfile instead of reading image tiles. Do you know if there is a way to do what we want or do I have to reconsider my structure and consider and use it as OpenLayers.Layer.WMS? Fabio Da: Rahkonen Jukka jukka.rahko...@mmmtike.fi A: mapserver-users@lists.osgeo.org mapserver-users@lists.osgeo.org Inviato: Martedì 2 Ottobre 2012 9:05 Oggetto: Re: [mapserver-users] MapServer and shapefile Hi, Because you talk about base layer I think that you are perhaps going to show your map in OpenLayers. If that is the case then the answer is yes and this OpenLayers example shows how it can be done. http://dev.openlayers.org/releases/OpenLayers-2.12/examples/wms-untiled.html On the Mapserver side you must configure a WMS layer that is using shapefile as input data. http://www.mapserver.org/ogc/wms_server.html -Jukka Rahkonen- Fabio Brolese wrote: Hello everybody, after a long search on Google I'm here to ask you if it's possible to use a shapefile as base layer. Everything I found was on exporting to shapefile or drawing objects from shapefile but nothing saying that I can use it as base layer. Can anyone help me? TIA Fabio ___ 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 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] SQL Statement is truncuated at about 2000 bites
On Sep 10, 2012, at 9:22 AM, Rotenhan von, Wernher wernher.rotenhan...@suedzucker.de wrote: When I use long SQL statements in my data statement (mapserver map file) they are cut at about 2000 bites and thus can not be executed. Make a view, and then call the view. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Projection library error. no options found in 'init' file
I am, out of the blue, getting the following error [Mon Aug 13 15:55:37 2012].825787 msProcessProjection(): Projection library error. no options found in 'init' file What is it trying to tell me? This was working fine as of a few days ago, and I don't recall messing with it. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Projection library error. no options found in 'init' file
Never mind I upgraded macports, and that whacked my epsg file. Restored that, and am back in bidness. On Aug 13, 2012, at 4:03 PM, Puneet Kishor punk.k...@gmail.com wrote: I am, out of the blue, getting the following error [Mon Aug 13 15:55:37 2012].825787 msProcessProjection(): Projection library error. no options found in 'init' file What is it trying to tell me? This was working fine as of a few days ago, and I don't recall messing with it. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] MapServer vs ArcGIS server
On Jul 4, 2012, at 6:03 AM, Wang, Ya wrote: Mike: Thank you very much for the sharing. It is really great information. I have another question now. How does MapServer compare with ArcGIS server in terms of providing API or service layers to support the enthusiasm of the online development community? .. Why don't you summarize for us how and what ArcGIS Server provides in terms of API or service layers and how it supports the enthusiasm of its online development community? That knowledge would benefit several of us, I believe. Also, try asking the same question on the ArcGIS Server email list, if there is one, and then summarize the responses you get there. I would be very curious to read those. Finally, wrt MapServer's programming hooks and APIs, have you visited the docs at http://mapserver.org? Lots of great, entirely community developed information there. Remember, no one owns MapServer -- you and I and others and everyone owns it. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Curved Lines
On Jun 27, 2012, at 2:13 AM, juliap wrote: Hi all, I have the following layer of type line : LAYER NAME line STATUS ON TYPE LINE CONNECTIONTYPE OGR CONNECTION MSSQL:server=server;database=database;uid=id;pwd=pwd DATA SELECT geometry::STLineFromText('LINESTRING (' +CAST(Geo.STX AS VARCHAR(54)) +' ' +CAST(Geo.STY AS VARCHAR(54)) +', ' +CAST(Geo.STX AS VARCHAR(54)) +' ' +CAST(Geo.STY AS VARCHAR(54)) +')' ,4326) FROM column WHERE DATEDIFF(mi, CreatedON, CURRENT_TIMESTAMP) ='%x%' CLASS STYLE WIDTH 3 SIZE 1 COLOR 0 0 128 END # end of style END # end of class PROJECTION init=epsg:4326 END # end of projection END # end of layer I was wondering how to get a curved line from this data. I tried using angle and gap, but I don't see any changes. Any suggestions? Your understanding of geometry is a bit off here. In a query result set, each row is a feature, and a line feature would be made up of two or points; a curved line feature, of course, would be made up of three or more points. What you are getting in the result set above is a bunch of features, each of which are a point repeated twice. I think what you really want is to create a single line feature from all these points. So, you would probably do some kind of an aggregate on these points. I don't know the functions available in SQL Server, but there must be an analog for Postgres's aggregate functions. You want to collect all the points and make a line feature from them, and then pass that to MapServer to draw. You could make a view that does all this, and then call the view from MapServer. Hope this helps. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Curved Lines
On Jun 27, 2012, at 8:17 PM, Rahkonen Jukka wrote: Hi, The question, if I understand is correctly, is relevant. In EPSG:4326 shortest distance between two points is better expressed as a curve than as a straight linestring. However, Mapserver does not support curves of any kind. Interesting spin; didn't think of that. However, note that, as Brent pointed out, the OP is SELECTing the same coords twice, so, in effect, they are two coincident points of line length zero. You may find some workaround from GDAL. Ogr2ogr is having a segmentize option for this purpose. It does not support real curves either, but it creates intermediate points so that linestrings are shorter and thus follow the curve better. See http://gdal.org/ogr2ogr.html -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Mr. Puneet Kishor Lähetetty: 27. kesäkuuta 2012 17:39 Vastaanottaja: juliap Kopio: mapserver-users@lists.osgeo.org Aihe: Re: [mapserver-users] Curved Lines On Jun 27, 2012, at 2:13 AM, juliap wrote: Hi all, I have the following layer of type line : LAYER NAME line STATUS ON TYPE LINE CONNECTIONTYPE OGR CONNECTION MSSQL:server=server;database=database;uid=id;pwd=pwd DATA SELECT geometry::STLineFromText('LINESTRING (' +CAST(Geo.STX AS VARCHAR(54)) +' ' +CAST(Geo.STY AS VARCHAR(54)) +', ' +CAST(Geo.STX AS VARCHAR(54)) +' ' +CAST(Geo.STY AS VARCHAR(54)) +')' ,4326) FROM column WHERE DATEDIFF(mi, CreatedON, CURRENT_TIMESTAMP) ='%x%' CLASS STYLE WIDTH 3 SIZE 1 COLOR 0 0 128 END # end of style END # end of class PROJECTION init=epsg:4326 END # end of projection END # end of layer I was wondering how to get a curved line from this data. I tried using angle and gap, but I don't see any changes. Any suggestions? Your understanding of geometry is a bit off here. In a query result set, each row is a feature, and a line feature would be made up of two or points; a curved line feature, of course, would be made up of three or more points. What you are getting in the result set above is a bunch of features, each of which are a point repeated twice. I think what you really want is to create a single line feature from all these points. So, you would probably do some kind of an aggregate on these points. I don't know the functions available in SQL Server, but there must be an analog for Postgres's aggregate functions. You want to collect all the points and make a line feature from them, and then pass that to MapServer to draw. You could make a view that does all this, and then call the view from MapServer. Hope this helps. -- Puneet Kishor ___ 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 mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Regular expression error
On Jun 12, 2012, at 10:11 AM, Lime, Steve D (DNR) steve.l...@state.mn.us wrote: ogc_fid' '^[0-9]{1-5}$' You did mean '^[0-9]{1,5}$' Not the comma not the dash in the quantifier (a minimum of one up to a maximum of 5, or however many you desire, digits) ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Failed to connect to github
works just fine $git clone https://github.com/mapserver/mapserver.git Cloning into 'mapserver'... remote: Counting objects: 45832, done. remote: Compressing objects: 100% (11217/11217), done. remote: Total 45832 (delta 34576), reused 45785 (delta 34530) Receiving objects: 100% (45832/45832), 15.24 MiB | 1.56 MiB/s, done. Resolving deltas: 100% (34576/34576), done. On Jun 3, 2012, at 2:54 PM, Andrea Peri wrote: Hi, thx for response. I try your sintax, but it don't seem work anymore. :( * Failed connect to github.com:8080; Operation now in progress * Expire cleared * Closing connection #0 error: Failed connect to github.com:8080; Operation now in progress while accessing https://github.com/mapserver/mapserver.git/info/refs fatal: HTTP request failed 2012/6/3 Thomas Gratier osgeo.mailingl...@gmail.com Hello, This below will be better :) git clone https://github.com/mapserver/mapserver.git mapserver-svn Regards ThomasG -- - Andrea Peri . . . . . . . . . qwerty àèìòù - ___ 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] variable substitution
So, http://mapserver.org/mapfile/variable_sub.html details how I can do variable substitution using either cookies or CGI params. My problem is slightly different, and I am hoping one of you wizards must have solved it already so you could help. I have mapfiles on my development machine with one set of path names. These mapfiles, along with the rest of the application, are pushed to a git repo, and then pulled down to the production server where, unfortunately, the path names are different. Short of maintaining two sets of mapfiles, how can I do a variable substitution in the path name so everything works. -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] error accessing PostGIS 2 layer
I migrated my data to PostGIS 2, and now I am getting the following error (using the same mapfile as with PostGIS 1.5.3) msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR: function geomfromtext(unknown, integer) does not exist LINE 1: ...e_geom FROM trees.range) a_view where the_geom GeomFromTe... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. The offending query in the mapfile is DATA the_geom FROM (SELECT gid, species_id, species_color, the_geom FROM trees.range) a_view USING UNIQUE gid USING srid=4326 So, it seems the MapServer is using that line to construct its own query, and that query is not compliant with PostGIS 2. Suggestions? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] error accessing PostGIS 2 layer
On May 17, 2012, at 2:20 PM, Donald Kerr wrote: Run one of the .sql files in \PostgreSQL\9.1\share\contrib\postgis-2.0 to restore legacy funtions to PostGIS 2 e.g. legacy.sql. legacy_minimal.sql worked for me with my set up. phew! thanks! legacy_minimal.sql did it. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Puneet Kishor Sent: 17 May 2012 20:06 To: mapserver Subject: [mapserver-users] error accessing PostGIS 2 layer I migrated my data to PostGIS 2, and now I am getting the following error (using the same mapfile as with PostGIS 1.5.3) msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR: function geomfromtext(unknown, integer) does not exist LINE 1: ...e_geom FROM trees.range) a_view where the_geom GeomFromTe... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. The offending query in the mapfile is DATA the_geom FROM (SELECT gid, species_id, species_color, the_geom FROM trees.range) a_view USING UNIQUE gid USING srid=4326 So, it seems the MapServer is using that line to construct its own query, and that query is not compliant with PostGIS 2. Suggestions? -- Puneet Kishor___ 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] line symbol decoration is flipped, how do I ensure the correct orientation
I am trying my hand at MapServer symbols/styles. Using the following definition SYMBOL NAME rarrow TYPE vector FILLED false POINTS 0 0 4 0 2 -1 END END SYMBOL NAME larrow TYPE vector FILLED false POINTS 4 0 0 0 2 1 END END CLASS NAME Strike-slip fault right lateral EXPRESSION 30 STYLE COLOR 0 0 0 WIDTH 1 END STYLE COLOR 0 0 0 SYMBOL rarrow SIZE 4 GAP -60 OFFSET 0 -4 END STYLE COLOR 255 0 0 SYMBOL larrow SIZE 4 GAP -60 OFFSET 0 6 END END I get the following http://dl.dropbox.com/u/3526821/slip_strike.png The green box shows the correct symbol. The red box has the symbol flipped. Why? How can I correct this? -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] elevation profile
The elevation profile widget is finally implemented at http://earth-base.org/geomaps Click on the fourth button from the top on the left, then draw a line on the map to see the profile. As with all my apps, the values themselves can be retrieved by querying for them directly from the browser or from the command line. For example http://earth-base.org/geomaps/elevation.json?linestring=LINESTRING(-118.706+37.933%2C-109.477+42.494) This one is dedicated to Steve Woodbridge, Brent Wood and David Fawcett. .. -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: handling features that cross the date line
bumpety bump. The following page discusses the issue, but I am not sure what the resolution is. I'd preferably solve this without having to edit the lines. Suggestions? On Apr 30, 2012, at 8:49 PM, Puneet Kishor wrote: What is the recommended way of handling such features? I have a bunch of lines (held in Postgis) that cross the date line, and the WMS tiles drawn by MapServer get all messed up. What is the easiest way to get them to draw correctly? Thanks. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] handling features that cross the date line
What is the recommended way of handling such features? I have a bunch of lines (held in Postgis) that cross the date line, and the WMS tiles drawn by MapServer get all messed up. What is the easiest way to get them to draw correctly? Thanks. -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Really slow map creation from POSTGIS DB
On Apr 28, 2012, at 8:20 AM, Stephen Woodbridge wood...@swoodbridge.com wrote: On 4/28/2012 8:44 AM, Matt McClelland wrote: Hi All I have a set of contours in a SHP file If I point my map file to the SHP file I can generate a WMS image in under 1 second Shp file is just shy of 200MB I then use shp2pgsql to load the same dataset into the DB I added an index for the_geom And am requesting the data in the mapfile using the same EPSG The map draws correclty but is now taking about 30secs when using the DB. Any ideas on how to make it faster. Simplify the data for the that zoom level. If you are all the way zoomed out and drawing all the data, then the shapefile will be fastest. An index does not help if you are drawing all the data as you need to do a full table scan anyway to get all the records. It is simply faster to read 200MB from disk than from the database because the database has to fetch the same data and may have to jump through some hoops to get it out of extended storage, then it has to encode the data and send it over the connection and the client has to decode the data. Do you really need all the resolution of the data at this scale? If not create another column and simplify the geometry into that column and set up your mapfile to query the simplified data at this zoom and to query the detailed data as you zoom in. All of the above is great advice. Additionally, implement a tilecache server; why redraw an image if it has already been drawn. That said, while a db is going to be slower than the file system in many cases, there are many reasons why your db is performing so slowly. Thirty times slow is too much, and 30s for a query, no matter what query, is wrong. Benchmark your entire stack to find bottlenecks... Is the query itself taking that long? Is something else going wrong? Is the exact query that MapServer is performing actually using your indexes? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] elevation profile
Any suggestions on how something like this could be implemented using MapServer? http://viewer.nationalmap.gov/example/elevation_profile.html My front-end is OpenLayers, and the backend data are from SRTM. I'd like to click on the map and create a line, and get back the elevation numbers for that line. I only want the elevation numbers as I can optionally construct the profile via a variety of ways. I am assuming I could send a line WKT, but how would I query for the values using MapServer? Fwiw, http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/examples/elevationCanvas.html seems to use a canvas implementation that doesn't seem to be available in my standard-issue OL 2.11. Calling `this.layer.getPixelDataForViewPortPx` croaks with not a function message. In any case, I don't really want the RGB values under the mouse. I want the actual height values. Thanks in advance for any suggestions, -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] elevation profile
On Apr 26, 2012, at 7:20 PM, Stephen Woodbridge wrote: On 4/26/2012 7:35 PM, Puneet Kishor wrote: Any suggestions on how something like this could be implemented using MapServer? http://viewer.nationalmap.gov/example/elevation_profile.html My front-end is OpenLayers, and the backend data are from SRTM. I'd like to click on the map and create a line, and get back the elevation numbers for that line. I only want the elevation numbers as I can optionally construct the profile via a variety of ways. I am assuming I could send a line WKT, but how would I query for the values using MapServer? Fwiw, http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/examples/elevationCanvas.html seems to use a canvas implementation that doesn't seem to be available in my standard-issue OL 2.11. Calling `this.layer.getPixelDataForViewPortPx` croaks with not a function message. In any case, I don't really want the RGB values under the mouse. I want the actual height values. Thanks in advance for any suggestions, Hi Puneet, I have done this in the past and there are a bunch of moving parts. Here is what I did. 1. got a copy of NED2 data for the US. 2. create a gdal .vrt file to pull all the files into a single virtual file 3. wrote a simple C fcgi program to take an x,y and get the elevation from the the NED2 data. http://imaptools.com:8080/cgi-bin/getElevation.fcgi?lat=32.6628646lon=-86.8800962 4. I used pgRouting to compute a route and then took the route geometry and added sample point along the edges where needed, and hit the fcgi service to convert the points to elevations and then plotted the elevations against the their length along the line that the x,y represented. I also think I may have wrote an app where you could pass the route polyline to it an it would generate an image of the elevation plot. 5. Then wired it into the web page as an ajax call of as a image url that gets updated. Thanks for the details, Steve. All this is way more complicated that I was envisioning. And, PostGIS 2 is out of the question, for now, at least. Could you send me that gdal .vrt file? I'd like to look at it. Perhaps that will give me some other ideas on how to approach this. Many thanks, -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Inefficient rendering of layer
On Mar 27, 2012, at 12:17 PM, juliap wrote: SELECT geom , VotingFor FROM dbo.[BF_PROV_ELECTORAL_DIVISION] AS elec WITH (INDEX(ogr_geom_sidx)) JOIN dbo.[Survey] ON GeoL.STWithin(geom) = 1 WHERE PartyVotingFor = ( SELECT TOP 1 [VotingFor] FROM dbo.[BF_PROV_ELECTORAL_DIVISION] AS elec2 WITH (INDEX(ogr_geom_sidx)) JOIN dbo.[Survey] ON GeoL.STWithin(geom) = 1 WHERE VotingFor = '4' AND elec.ID = elec2.ID GROUP BY VotingFor ORDER BY COUNT(VotingFor)DESC You should analyze that query directly against the database, that is, not via a mapfile query, to figure out where it is taking time. Perhaps it is looping unnecessarily, perhaps it is not using the indexes where you expect them to... only EXPLAIN ANALYZE will tell for sure. Once you have the query running quick, it will be quick in MapServer as well. -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: Inefficient rendering of layer
First, I have no idea who you are asking, but since, at least as far as I can tell, I was the only one who replied to you, I am assuming you are asking me. My advice -- when responding, please include the entire email so the context of the conversation is obvious to everyone. And, no, not everyone uses nabble to view the message in context. We simply use our own email programs. On Mar 27, 2012, at 12:49 PM, juliap wrote: I am not an SQL expert . Do you know any other alternative? Alternative to what? All you have to do is type your entire query with the words EXPLAIN ANALYZE prefixed to it. Your database will spit out a message, a query plan, describing how it will go about actually executing that query. Post the entire output to this list, and someone might be able to help you further. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Setup advice please?
Just walked into this conversation so my response may be half-assed, but... On Mar 2, 2012, at 7:26 PM, pcr...@pcreso.com wrote: Cheers Steve. I don't think this changes the answer much... whether mapcache, tilecache or mapproxy is used, the time to set up a working server with 50Gb of geotiffs I would have thought would be pretty similar. So: can anyone experienced in this area suggest what sort of time is reasonable to expect a competent team to set this up in a professional way, with reasonable supporting docs, etc? Remembering we have a supported server to work with. What do you mean by time... to set up a server? Fwiw, I downloaded, configured, and had Tilecache working in less than 30 mins. The cache is not pre-seeded. It builds up as it goes. Thanks, Brent Wood --- On Sat, 3/3/12, Lime, Steve D (DNR) steve.l...@state.mn.us wrote: From: Lime, Steve D (DNR) steve.l...@state.mn.us Subject: RE: [mapserver-users] Setup advice please? To: pcr...@pcreso.com pcr...@pcreso.com, Corey Carpenter fruitwe...@gmail.com Cc: mapserver-users@lists.osgeo.org mapserver-users@lists.osgeo.org Date: Saturday, March 3, 2012, 1:15 PM MapServer 6.2 isn't ready for production use, however, MapCache is. I've been pairing it and 6.0.2 for production use for months... Just another opinion. -Steve From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of pcr...@pcreso.com [pcr...@pcreso.com] Sent: Friday, March 02, 2012 2:09 PM To: Corey Carpenter Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Setup advice please? Hi Corey, Thanks for the suggestion. At this stage the requirement is for a stable production system. Mapserver 6.2 mapcache are not, still being under development. I realise that this does not preclude the software running robustly, but it will not be an acceptable solution in this case. Mapserver 6.01, as the latest stable release, is the required platform. Hence my suggestion of Tilecache MapProxy as suitable applications, which are available as binary packages ready to install. Thanks, Brent Wood --- On Sat, 3/3/12, Corey Carpenter fruitwe...@gmail.com wrote: From: Corey Carpenter fruitwe...@gmail.com Subject: Re: [mapserver-users] Setup advice please? To: pcr...@pcreso.com Cc: mapserver-users@lists.osgeo.org Date: Saturday, March 3, 2012, 8:40 AM Unless I read your question incorrectly, this is the main function of mapcache. You will need to use a fairly new version of mapserver 6.2 / trunk. You will be able to seed your cache, so the tiles you define are available on the first request. I have used tilecache and other methods, but I have no experience with mapcache. On Fri, Mar 2, 2012 at 1:10 PM, pcr...@pcreso.com/mc/compose?to=pcr...@pcreso.com wrote: Hi, Hopefully someone here can help. I have about 50Gb of high resolution aerial photos (geotiffs) to set up as a cached WMS service. We have a mapserver setup ready to use, with backups, etc. already sorted. The dataset is competely static. I'd like to set up MapProxy or Tilecache as a tiled WMS service for an OpenLayers front end, and possible other public use. I'm happy with a dynamically populated cache, rather than a pre-filled one, so the cache is built up as it is used. Can anyone experienced in this area suggest what sort of time is reasonable to expect a competent team to set this up in a professional way, with reasonable supporting docs, etc? Remembering we have a supported server to work with. It has been asked for by a small local environmental interest group with zero funds, and I need to get a reasonable commercial cost for such an exercise to start with. Thanks, Brent Wood .. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Setup advice please?
It is my expert opinion that, with documentation and all, tilecache will take 35 mins. Any more and either the person doesn't know what he is doing, or is hoping to take the client for a ride. On Mar 2, 2012, at 9:22 PM, pcr...@pcreso.com wrote: Hi Puneet, Yep, a simple one off 50Gb image dataset to be configured then the cache populated dynamically. I'd prefer MapProxy, or Mapcache, over Tilecache, to be able to support GetFeature requests, but in this instance that will not be needed anyway. That's about my take on it, maybe a couple of hours, but I've just been quoted 3 days by a support team to do this, at NZ$170/hr. (current exch rate is around .77, so maybe $2600US??? for the job) I'm not a professional at this, but do such things as a prototyping playing exercise at home... a formal installation will need documenting, etc, to a production server standard, so perhaps a few more hours, but that cost seems excessive. Hence my question here, to get an expert opinion of what such a setup should cost. Ideally a few such opinions to give me a robust sample size to go back with :-) I've also asked another provider for a cost. My guess is they will be considerably cheaper. --- On Sat, 3/3/12, Puneet Kishor punk.k...@gmail.com wrote: From: Puneet Kishor punk.k...@gmail.com Subject: Re: [mapserver-users] Setup advice please? To: mapserver mapserver-users@lists.osgeo.org Date: Saturday, March 3, 2012, 3:15 PM Just walked into this conversation so my response may be half-assed, but... On Mar 2, 2012, at 7:26 PM, pcr...@pcreso.com wrote: Cheers Steve. I don't think this changes the answer much... whether mapcache, tilecache or mapproxy is used, the time to set up a working server with 50Gb of geotiffs I would have thought would be pretty similar. So: can anyone experienced in this area suggest what sort of time is reasonable to expect a competent team to set this up in a professional way, with reasonable supporting docs, etc? Remembering we have a supported server to work with. What do you mean by time... to set up a server? Fwiw, I downloaded, configured, and had Tilecache working in less than 30 mins. The cache is not pre-seeded. It builds up as it goes. Thanks, Brent Wood --- On Sat, 3/3/12, Lime, Steve D (DNR) steve.l...@state.mn.us wrote: From: Lime, Steve D (DNR) steve.l...@state.mn.us Subject: RE: [mapserver-users] Setup advice please? To: pcr...@pcreso.com pcr...@pcreso.com, Corey Carpenter fruitwe...@gmail.com Cc: mapserver-users@lists.osgeo.org mapserver-users@lists.osgeo.org Date: Saturday, March 3, 2012, 1:15 PM MapServer 6.2 isn't ready for production use, however, MapCache is. I've been pairing it and 6.0.2 for production use for months... Just another opinion. -Steve From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of pcr...@pcreso.com [pcr...@pcreso.com] Sent: Friday, March 02, 2012 2:09 PM To: Corey Carpenter Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Setup advice please? Hi Corey, Thanks for the suggestion. At this stage the requirement is for a stable production system. Mapserver 6.2 mapcache are not, still being under development. I realise that this does not preclude the software running robustly, but it will not be an acceptable solution in this case. Mapserver 6.01, as the latest stable release, is the required platform. Hence my suggestion of Tilecache MapProxy as suitable applications, which are available as binary packages ready to install. Thanks, Brent Wood --- On Sat, 3/3/12, Corey Carpenter fruitwe...@gmail.com wrote: From: Corey Carpenter fruitwe...@gmail.com Subject: Re: [mapserver-users] Setup advice please? To: pcr...@pcreso.com Cc: mapserver-users@lists.osgeo.org Date: Saturday, March 3, 2012, 8:40 AM Unless I read your question incorrectly, this is the main function of mapcache. You will need to use a fairly new version of mapserver 6.2 / trunk. You will be able to seed your cache, so the tiles you define are available on the first request. I have used tilecache and other methods, but I have no experience with mapcache. On Fri, Mar 2, 2012 at 1:10 PM, pcr...@pcreso.com/mc/compose?to=pcr...@pcreso.com wrote: Hi, Hopefully someone here can help. I have about 50Gb of high resolution aerial photos (geotiffs) to set up as a cached WMS service. We have a mapserver setup ready to use, with backups, etc. already sorted. The dataset is competely static. I'd like to set up MapProxy or Tilecache as a tiled WMS service for an OpenLayers front end, and possible other public use. I'm happy with a dynamically populated cache, rather than a pre-filled one, so
Re: [mapserver-users] WMS for netcdf [SEC=UNCLASSIFIED]
On Feb 27, 2012, at 10:29 PM, Kathleen Hirst k.hi...@bom.gov.au wrote: Dear List, I have a NetCDF file with contains over 150 timesteps. I can create a WMS for each timestep using PROCESSING BANDS=1, which means I have to define over 150 layers. I was hoping to only define the layer once and pass a variable for the time or the band number. Does anyone have any ideas? Kathleen, I wrote the following reply, and then realized that you may not be asking for this. Have you seen http://mapserver.org/ogc/wcs_format.html? For completeness, I will leave my original response as well. Kathleen, Neither have I done this before nor do I know the answer, but I *am* interested in how you solve it since I have interest in munging a bunch of netCDF data. I am wondering, couldn't you use the standard variable substitution as Mapserver supports that for stuff like layer names and class names? Something like (do check the exact syntax) PROCESSING BANDS=%band% and then past in the band via the query string ?band=1 http://mapserver.org/mapfile/variable_sub.html -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] from kml styles to mapserver layer classification
I have a kml with a bunch of styles to color polygons. Is there a quick/easy way to extract them and convert them to MapServer layer classification rules? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: from kml styles to mapserver layer classification
On Feb 20, 2012, at 4:44 PM, Puneet Kishor wrote: I have a kml with a bunch of styles to color polygons. Is there a quick/easy way to extract them and convert them to MapServer layer classification rules? the above actually turned out to be a lot easier than I thought... about 4 lines of Perl. Now, I have a table with geometry, and colors for each feature. CREATE TABLE t (attr, hex_color, the_geom); How can I color the polys in the layer with the hex_color values? Looking at the map file docs, I came up with something like so LAYER NAME foo DATA the_geom FROM (SELECT gid, rgb(hex_color) AS rgb_color, the_geom FROM t) tmp USING UNIQUE gid USING srid=4326 STATUS ON TYPE POLYGON CLASS STYLE COLOR [rgb_color] OUTLINECOLOR 68 68 68 END END END END where rgb() converts hex_color to a string of RGB triplets. So, 00 becomes 0 0 0. Is the above correct? For now, it doesn't seem to be working for me. Many tia, -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: from kml styles to mapserver layer classification
Hi Richard, On Feb 20, 2012, at 9:21 PM, Richard Greenwood wrote: On Mon, Feb 20, 2012 at 8:05 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: How can I color the polys in the layer with the hex_color values? COLOR #ff So, I can use the hex values directly. Cool. But, will the following be sufficient in the map file? LAYER NAME foo DATA the_geom FROM (SELECT gid, hex_color, the_geom FROM t) tmp USING UNIQUE gid USING srid=4326 STATUS ON TYPE POLYGON CLASS STYLE COLOR [hex_color] END END END END -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: from kml styles to mapserver layer classification
Mike (and Richard), Thanks for the advice, but I didn't have to use gdal. As I wrote in another email, 5 or so lines of Perl code extracted the hex color values and inserted them in the Postgres table. From there, it was just a matter of knowing the correct map file syntax. Richard's suggestion of prefixing the # sign was spot on, which I added right in the Pg column. Then, the CLASS STYLE shown below worked really well. Many thanks all. On Feb 20, 2012, at 9:27 PM, Smith, Michael ERDC-CRREL-NH wrote: Puneet, A very recent version of gdal, last couple of weeks, can convert KML styles into OGR style strings. MapServer can use those OGR Style strings with the AUTO style option. Mike -- Michael Smith US Army Corps Remote Sensing GIS/Center On 2/20/12 10:23 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: Hi Richard, On Feb 20, 2012, at 9:21 PM, Richard Greenwood wrote: On Mon, Feb 20, 2012 at 8:05 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: How can I color the polys in the layer with the hex_color values? COLOR #ff So, I can use the hex values directly. Cool. But, will the following be sufficient in the map file? LAYER NAME foo DATA the_geom FROM (SELECT gid, hex_color, the_geom FROM t) tmp USING UNIQUE gid USING srid=4326 STATUS ON TYPE POLYGON CLASS STYLE COLOR [hex_color] END END END END ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] dynamically changing data path and calculating scales
I have a layer like so that works very well (snipped for brevity) LAYER TYPE RASTER DATA path/to/data/my.img PROCESSING SCALE=-24.403,-1.483 CLASS STYLE COLORRANGE 46 154 88 251 255 128 DATARANGE -24 0 END END END Now, I want to dynamically change the path/to/data via a web query. Basically, I have img files for different months, and I want the user to be able to choose a specific month and have MapServer deliver that data. So, for January, I want path/to/1/my.img and for November it would be path/to/11/my.img. Additionally, that SCALE=-24.403,-1.483 above... well, I used one of them gdal utils to determine that, but I would like to do that automagically. Needless to say, SCALE=AUTO does not work. Suggestions? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] dynamically changing data path and calculating scales
On Feb 17, 2012, at 2:34 PM, Smith, Michael ERDC-CRREL-NH wrote: Punnet You could use runtime substitution for this. DATA path/to/%month%/my.img Beautiful. Many thanks. Now the next part about figuring out the SCALE automatically? On 2/17/12 3:25 PM, Puneet Kishor punk.k...@gmail.com wrote: I have a layer like so that works very well (snipped for brevity) LAYER TYPE RASTER DATA path/to/data/my.img PROCESSING SCALE=-24.403,-1.483 CLASS STYLE COLORRANGE 46 154 88 251 255 128 DATARANGE -24 0 END END END Now, I want to dynamically change the path/to/data via a web query. Basically, I have img files for different months, and I want the user to be able to choose a specific month and have MapServer deliver that data. So, for January, I want path/to/1/my.img and for November it would be path/to/11/my.img. Additionally, that SCALE=-24.403,-1.483 above... well, I used one of them gdal utils to determine that, but I would like to do that automagically. Needless to say, SCALE=AUTO does not work. Suggestions? -- Puneet Kishor___ 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] Trouble connecting to PostGIS
On Feb 13, 2012, at 3:35 PM, Bistrais, Bob wrote: Thanks Brent. The postgis user SHOULD have access to the table, as that is the table's owner. Coordinate system is in the map file under Projection. Here is what the debug log showed me (Metwp100Poly is the actual name of the table, and MAINE is the layer name): [Mon Feb 13 16:31:32 2012].453000 CGI Request 1 on process 1300 [Mon Feb 13 16:31:32 2012].687000 msPOSTGISLayerRetrievePGVersion(): Query error. Error executing POSTGIS statement (msPOSTGISLayerRetrievePGVersion():select substring(version() from 12 for (position('on' in version()) - 13)) [Mon Feb 13 16:31:32 2012].687000 prepare_database(): Query error. Error declaring cursor: ERROR: relation metwp100poly does not exist .. The error above is telling you that it can't even find the said table. Can you SELECT from this table successfully in PgAdmin? Is it in a different schema than public, and perhaps that schema is not in the searchpath? Does the postgisuser have access to this table? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Resolved: Mapserver install - Mac OS X and safari
On Jan 18, 2012, at 1:13 PM, M Badar wrote: Thanks again to everyone who provided input. The gist of the problem was related to a conflict between the version of apache I had installed and the version which is shipped with OS X. Listed below are the steps I followed to eliminate the problem: 1. Completely uninstall the apache version shipped with OS X; You did the single most possibly wrong thing with #1 above. Never, never touch the stuff that comes with the system if for no other reason than you just don't have to. 2. Ran 'find' to search for http occurrences on the filesystem: find / -name '*http*' -print; 3. Deleted the following file to stop OS X from starting apache automatically: /System/Library/LaunchDaemons/org.apache.httpd.plist Good lord. All you had to do was to go to System Preferences.. and turn off web sharing. If you really wanted to do it the difficult way, you could have done a `launchctl unload` (http://ss64.com/osx/launchctl.html) 4. Start apache manually with 'apachectl' /usr/local/apache2/bin/apachectl start 5. Access the mapserver URL as follows: http://localhost/cgi-bin/mapserv 6. Success - the following was displayed by Safari: No query information to decode. QUERY_STRING is set, but empty. 7. Let the fun begin! Although I'm not sure which of the steps above actually fixed the problem, I believe it was steps 1 and 3 which were the critical parts of the solution. I hope it works out for you... good luck. Take care, Mike Badar # # Original post. # Thanks, everyone. With /etc/hosts set to: 127.0.0.1 localhost localhost and accessing the URL: http://localhost.com/cgi-bin/mapserv I get the error: # safari can't open the page http://localhost.com/cgi-bin/mapserv; because the server # unexpectedly dropped the connection. and when the URL is accessed this way (leaving /etc/hosts as shown above): http://localhost/cgi-bin/mapserv I get the error: Not Found The requested URL /cgi-bin/mapserv was not found on this server. At this point I'm 90% sure the problem lies between safari and apache. Maybe it's time for a reference manual on apache. Does anyone have any titles they would like to recommend? Mike Greetings, New user to the list. I am installing mapserver on my MacBook Pro. The installation has progressed without error until I attempt to call the 'mapserv' cgi executable from safari; it returns the following error after running the final check as described in the documentation: # Page 40, MapServer Documentation, Release 6.0.1; 4.1.8 Installation - The basic install. # This is the final test to ensure mapserver is installed and functioning correctly. # When attempting to access the test URL, safari returns the following error: # Test URL: http://localhost.com/cgi-bin/mapserv # Safari error: # safari can't open the page http://localhost.com/cgi-bin/mapserv; because the server # unexpectedly dropped the connection. Mapserver version: 6.0.1 Mac OS X version: 10.6.8 Safari version: 5.1.2 My suspicion is the error is related to how mapserver and apache are communicating; however, not being apache literate, I don't know where to begin diagnosing the connection problem. I ran a syntax check on the httpd.conf file and it returned the following: Michael-Badars-MacBook-Pro:bin bobby$ apachectl -t httpd: Could not reliably determine the server's fully qualified domain name, using Michael-Badars-MacBook-Pro.local for ServerName Syntax OK Michael-Badars-MacBook-Pro:bin bobby$ Listed below are details regarding my installation. Thanks in advance for any help you can provide. Mike Badar # # Map Server 6.0.1 configure script. # # Author: Mike Badar # Date: 29 December, 2011 # Version: 3 ./configure \ --with-curl-config=/usr/local/bin/curl-config \ --with-gdal=/usr/local/bin/gdal-config\ --with-geos=/usr/local/bin/geos-config\ --with-ogr=/usr/local/bin/gdal-config \ --with-postgis=/usr/local/pgsql/bin/pg_config \ --with-xml2-config=/usr/local/bin/xml2-config \ \ --with-agg=/usr/local \ --with-freetype=/usr/local\ --with-gd=/usr/local \ --with-httpd=/usr/local/apache2/bin/httpd \ --with-jpeg=/usr/local\ --with-proj=/usr/local\ --with-tiff=/usr/local\ \ --with-wfsclient
Re: [mapserver-users] Mapserver install - Mac OS X and safari
On Jan 16, 2012, at 7:06 PM, M Badar wrote: Thanks, everyone. With /etc/hosts set to: 127.0.0.1 localhost localhost You are doing it all wrong. You shouldn't have to mess with /etc/hosts at all, definitely not with regards to the localhost entry. In fact, it says very clearly ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost and accessing the URL: http://localhost.com/cgi-bin/mapserv I get the error: # safari can't open the page http://localhost.com/cgi-bin/mapserv; because the server # unexpectedly dropped the connection. localhost.com is an actual private domain, not the loopback interface of your own computer. and when the URL is accessed this way (leaving /etc/hosts as shown above): http://localhost/cgi-bin/mapserv I get the error: Not Found The requested URL /cgi-bin/mapserv was not found on this server. At this point I'm 90% sure the problem lies between safari and apache. Maybe it's time for a reference manual on apache. Does anyone have any titles they would like to recommend? The apache docs at http://httpd.apache.org is pretty good. But, since you are using Mac OS X, you can simply use apache that comes with it. Just make sure the ScriptAlias directory is set to the cgi-bin directory you are hoping to serve mapserv from. However, if you want to use your own installed apache (it seems that is what you are using because you provided /usr/local/apache2 to your mapserv config), configure it properly. Its config file is at /usr/local/apache2/conf/httpd.conf Just make sure that your Mac's built in apache is not also running (go to System Preferences... Sharing... Web Sharing). You can't have two apaches running at the same time, well, at least not glommed on the same default port 80. Hope this helps. Mike On Mon, Jan 16, 2012 at 4:14 PM, John Cartwright john.c.cartwri...@comcast.net wrote: Did you try just http://localhost/cgi-bin/mapserv; ? --john On Jan 16, 2012, at 1:11 PM, M Badar wrote: Greetings, New user to the list. I am installing mapserver on my MacBook Pro. The installation has progressed without error until I attempt to call the 'mapserv' cgi executable from safari; it returns the following error after running the final check as described in the documentation: # Page 40, MapServer Documentation, Release 6.0.1; 4.1.8 Installation - The basic install. # This is the final test to ensure mapserver is installed and functioning correctly. # When attempting to access the test URL, safari returns the following error: # Test URL: http://localhost.com/cgi-bin/mapserv # Safari error: # safari can't open the page http://localhost.com/cgi-bin/mapserv; because the server # unexpectedly dropped the connection. Mapserver version: 6.0.1 Mac OS X version: 10.6.8 Safari version: 5.1.2 My suspicion is the error is related to how mapserver and apache are communicating; however, not being apache literate, I don't know where to begin diagnosing the connection problem. I ran a syntax check on the httpd.conf file and it returned the following: Michael-Badars-MacBook-Pro:bin bobby$ apachectl -t httpd: Could not reliably determine the server's fully qualified domain name, using Michael-Badars-MacBook-Pro.local for ServerName Syntax OK Michael-Badars-MacBook-Pro:bin bobby$ The above error is returned regardless if I am connected to the internet via a wireless or hardwired connection. Listed below are details regarding my installation. Thanks in advance for any help you can provide. Mike Badar # # Map Server 6.0.1 configure script. # # Author: Mike Badar # Date: 29 December, 2011 # Version: 3 ./configure \ --with-curl-config=/usr/local/bin/curl-config \ --with-gdal=/usr/local/bin/gdal-config\ --with-geos=/usr/local/bin/geos-config\ --with-ogr=/usr/local/bin/gdal-config \ --with-postgis=/usr/local/pgsql/bin/pg_config \ --with-xml2-config=/usr/local/bin/xml2-config \ \ --with-agg=/usr/local \ --with-freetype=/usr/local\ --with-gd=/usr/local \ --with-httpd=/usr/local/apache2/bin/httpd \ --with-jpeg=/usr/local\ --with-proj=/usr/local\ --with-tiff=/usr/local\ \
Re: [mapserver-users] time enabled WMS with video/ elements instead of img/ elements
Tim, (top posting because I have a more generic response) I have tackled this very much like you did with multiple images and opacity, etc. I too considered a movie, but the problem with a movie is that you can't zoom in. The images are geo-referenced, so you can zoom in and out and pan and drag. I was using OpenLayers, so I created a scrubber (a jQuery slider) and tied it to layer loading and unloading. I would query for an image and draw it only if the user moved slider to request a specific image. It was not very smooth, but it did work. You can decrease the weight of the images by using GIFs, at least, that is what I did. I remember I had 100 images (one for each year for a century's worth of model run) and the performance was quite good. I did pre-calculate the images at different zoom levels -- I believe there were 12 zoom levels, so I generated 1200 images and then used OL's layer image type. Wish it were possible to zoom, pan, drag a movie as if it were a map. On Jan 11, 2012, at 8:10 PM, Tim-Hinnerk Heuer wrote: Hi, Interested in HTML5 + MapServer and visualisation, read on. Happy new year to you all! I'm working on a rather interesting project at the moment where we need to map data over time. We tried experimenting with having one layer for each time unit and essentially overlaying them, manipulating their opacity to have a mini movie, but we noticed that the downloads of all the images become quite significant (61MB for a test extent!). I then implemented a proof of concept page (HTML5) where I took an extent's images and concatenated them in a webm video over time and then played all the videos at the same time, giving me a nice visualisation of that area at a relatively low cost (2.3MB per that extent) and the advantage of streaming. I have already written a script that generates all the videos, so I have invested considerable amounts of time into this. It would be great now if I could use the Apache module mapcache to serve up these videos listening and responding to WMS requests. So, all I need to change about mapcache is to serve a .webm file with MIME type video/webm instead of a .png file at the given extent. I guess I could write something in PHP or even with MapScript to serve up those files, but A) I don't know how mapcache finds the right image for an extent and B) Although I know C, my knowledge of it is a bit rusty and I don't know the interface(s) for writing Apache modules in C, let alone a plugin for mapcache I'm keen on learning, but if someone knows where in the code I would have to look for this change/feature enhancement it would be really helpful. Has something like that been done already or is in experiment/planning? If you could give me some hints of how to approach this in the quickest way possible I would be very grateful. Of course this is a project which needs to be done quickly but I want to do it anyway, because it's fun. Thanks for reading and hopefully you have an answer! Regards, Tim ___ 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] simplify problem
On Dec 29, 2011, at 7:49 AM, ahlah ahti.laht...@pp.inet.fi wrote: Hi, I'm trying to use ST_Simplify function of Postgis in Mapserver This data source works fine in my mapfile of Mapserver: DATA 'geom_3067 from lines using srid=3067 using unique id' ST_Simplify query works fine inside Postgis: select ST_Simplify(geom_3067,100) from lines; But when I'm trying to use simplify function like this in mapfile, mapserver throws error: DATA 'ST_Simplify(geom_3067,100) from lines using srid=3067 using unique id' Try using a column alias like so DATA 'ST_Simplify(geom_3067, 100) geom FROM lines USING srid=3067 USING UNIQUE id' msDrawMap(): Image handling error. Failed to draw layer named 'grid'. msPostGISLayerWhichShapes(): Query error. Error (ERROR: column ST_Simplify(geom_3067,100) does not exist LINE 1: ...status,encode(AsBinary(force_collection(force_2d(ST_Simpli... ^ This is the query sent by mapserver: select status,encode(AsBinary(force_collection(force_2d(ST_Simplify(geom_3067,100))),'NDR'),'hex') as geom,id from lines where ST_Simplify(geom_3067,100) GeomFromText('POLYGON((365203 7272028.2777498,365203 7661628.2777498,724803 7661628.2777498,724803 7272028.2777498,365203 7272028.2777498))',3067) It seems that mapserver handles ST_Simplify(geom_3067,100) like a database column. Is there something wrong in my syntax? Thanks in advance AL -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/simplify-problem-tp7135648p7135648.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
Re: [mapserver-users] Re: simplify problem
On Dec 29, 2011, at 8:14 AM, ahlah ahti.laht...@pp.inet.fi wrote: Hi, DATA 'ST_Simplify(geom_3067, 100) geom FROM lines USING srid=3067 USING UNIQUE id' still getting error: msDrawMap(): Image handling error. Failed to draw layer named 'grid'. msPostGISLayerWhichShapes(): Query error. Error (ERROR: syntax error at or near geom LINE 1: ...id from lines where ST_Simplify(geom_3067, 1000) geom Ge... Dunno man. Guessing in the wind again... Create a view in Pg using a column alias as above, then use the view in the map file. That should do it. Mind it, I haven't looked at the actual syntax of your query I am on an iPad here. ^ ) executing query: select status,encode(AsBinary(force_collection(force_2d(ST_Simplify(geom_3067, 1000) geom)),'NDR'),'hex') as geom,id from lines where ST_Simplify(geom_3067, 1000) geom GeomFromText('POLYGON((455103 7369428.2777498,455103 7564228.2777498,634903 7564228.2777498,634903 7369428.2777498,455103 7369428.2777498))',3067) AL -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/simplify-problem-tp7135648p7135710.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
Re: [mapserver-users] Re: gradient display of raster DEM data (John Callahan)
On Nov 21, 2011, at 8:09 AM, Mark Volz wrote: John, I was able to get datarange and classrange to work. However I found a couple issues: 1) I had to include an expression for the raster range. - This may have been fixed in newer versions of MS. At least with ms 6.0.1 I didn't have to use any expression directive. Just colorrange and datarange did the trick. 2) I was getting unwanted black areas on my map. - I was using PC256 (to make the image smaller), I had to revert to RGB, which has more colors. Mapserver did not report an error when I was using PC256. CLASS EXPRESSION ([pixel] = 1030 AND [pixel] 1133) STYLE COLORRANGE 176 240 232 255 255 179 DATARANGE 1030 1133 END END #class Mark Volz GIS Specialist ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: displaying ERDAS .img files with mapserver
On Nov 10, 2011, at 2:48 PM, Puneet Kishor wrote: Additionally, my rendered image is grayscale. How can I apply a color ramp to this image? For example, instead of from white to black, I would like it to be from white to red or black to yellow (or whatever). Is there a way to do this without having to specify a color value for each of the 256 pixels? A few days ago I asked the above question, but got no reply. Then, yesterday I saw the following email On Nov 17, 2011, at 2:00 PM, Mark Volz wrote: Hello, I recently found a post http://www.osgeo.org/pipermail/mapserver-users/2011-October/070461.html that shows how add a nice DEM gradient in a map. I was wondering if it would be possible to display a gradient based on the current extent of the map. This would be very similar to how you can use the current display extent in ArcGIS when the symbology type is set to stretched. In other words, I would like the color ramp to be based of the current extent. which led me to http://www.osgeo.org/pipermail/mapserver-users/2011-October/070461.html where I learned about COLORRANGE and DATARANGE. I used those keywords and now I have a color ramp, and although I can guess the meaning of the syntax from the usage, I really don't have any official documentation on those directives. The interesting thing is, the thread referenced in the link above has the following comment On Fri, Oct 14, 2011 at 5:49 PM, Smith, Michael ERDC-CRREL-NH Michael.Smith at usace.army.milmailto:Michael.Smith at usace.army.mil wrote: John The DATARANGE / COLORRANGE keywords will be fully documented by 6.2 but they have been present in MapServer for years (since 4.6 or so). Really! Have those directives really been unavailable since version 4.6, but won't be officially available until 6.2 (assuming that the existence of documentation implies official availability). -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] a question re. gdallocationinfo
dunno if this is the right place to ask, but Frank W. hangs around here, so here goes... I am quite enjoying querying some of my raster datasets via gdallocationinfo. Works quite well, which makes me want to do the following -- 1. Have gdallocationinfo be aware of the NODATA value in the data set so it returns something predictable such as NO DATA or or whatver. 2. Currently gdallocationinfo queries only a point. I would like it to query a polygon, and return summary info for the area... perhaps statistics, a histogram, and the like. Any suggestions on how either of the above could be accomplished? Many thanks, -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: displaying ERDAS .img files with mapserver
On Nov 9, 2011, at 5:43 PM, Puneet Kishor wrote: I am looking for some recent tutes on rendering ERDAS .img files. A bit of the background: I inherited these data as an ArcMap .mdb dataset which has metadata.xml, a few other sundry files, and inside a directory with .idb extension, many more folders, each containing a .img file, and a corresponding .rrd and .xml file. A simple layer definition like so allows me to get the tiles displaying in the browser (via OpenLayers) -- LAYER NAMElyr TYPERASTER DATAfoo.img PROCESSING SCALE=AUTO STATUS ON OFFSITE 0 0 0 END But, the tiles don't make for a continuous image. I can see the tile boundaries. Besides correcting that, I would also like to be able to apply different color ramps, and, finally, I would like to be able to query either single pixel values (click on the map and get the underlying value), or some kind of stats on pixels in an area. Would appreciate any tutorials/write-ups if anyone has done this. I solved the above by specifying a PROCESSING directive with appropriate min and max values, and now I get a nicely rendered image. However, I get the following in the ms logs -- [Thu Nov 10 12:45:43 2011].545705 LoadGDALImage(layer): NODATA value -3.40282e+38 in GDAL file or PROCESSING directive largely ignored. Not yet fully supported for unclassified scaled data. The NODATA value is excluded from auto-scaling min/max computation, but will not be transparent. In this particular dataset, the NODATA value is -3.40282e+38. It well might be different in a different dataset. I am assuming MapServer is carping because I could have set NODATA value somewhere, but didn't, because I don't know how to do that. How do I prevent this error message? Additionally, my rendered image is grayscale. How can I apply a color ramp to this image? For example, instead of from white to black, I would like it to be from white to red or black to yellow (or whatever). Is there a way to do this without having to specify a color value for each of the 256 pixels? -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] displaying ERDAS .img files with mapserver
I am looking for some recent tutes on rendering ERDAS .img files. A bit of the background: I inherited these data as an ArcMap .mdb dataset which has metadata.xml, a few other sundry files, and inside a directory with .idb extension, many more folders, each containing a .img file, and a corresponding .rrd and .xml file. A simple layer definition like so allows me to get the tiles displaying in the browser (via OpenLayers) -- LAYER NAMElyr TYPERASTER DATAfoo.img PROCESSING SCALE=AUTO STATUS ON OFFSITE 0 0 0 END But, the tiles don't make for a continuous image. I can see the tile boundaries. Besides correcting that, I would also like to be able to apply different color ramps, and, finally, I would like to be able to query either single pixel values (click on the map and get the underlying value), or some kind of stats on pixels in an area. Would appreciate any tutorials/write-ups if anyone has done this. Many thanks, -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] OpenLayers JSONP getFeatureInfo
David, On Nov 3, 2011, at 2:17 PM, Fawcett, David (MPCA) wrote: I posted a similar question to the OpenLayers list, but know that there isn't complete overlap. Can anyone point me to an example that uses JSONP to get around the same origin policy when making a getFeatureInfo request from OpenLayers to MapServer? Not a direct answer to your question, but two alternative approaches that might work rather well (I used getFeatureInfo only briefly, but then gave up on it) -- 1. Use something like jQuery (my Js weapon of choice) to construct an ajax query. A JSONP query requires just one additional letter P. 2. Use a proxy. Remember, a few days ago I was asking about how to specify different classes in the browser address bar (in the URI) and use that to specify which classes are rendered by MapServer? I solved that by using a proxy... just a couple of lines of Perl, and that was solved. A bonus hint -- if your data are in Pg, don't even bother with getFeatureInfo. Just query the db directly and return the data as JSON (or, JSONP, in this case). -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] showing certain classes selected via cgi
(I thought I had asked this question and received and answer, but can't find it now... maybe I just dreamed it and never did ask. Here goes...) I have a map with a layer with 100s of classes. I want to send a class name via the URI, and get back a map of only that class. So, the following will return the map with all the classes http://server/map and, the following will return the map with only foo and bar classes http://server/map?classes=foo,bar The above URI pattern is just a suggestion. How can I achieve the above? One thought comes is to split the layer with 100s of classes into 100s of layers each with one class. In any case, what is the advised way forward? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] MS template file extensions
Nikos, I was wrong. Only certain extensions may be used for mapserver templates. See the following email from Steve Lime from Sep 11 where he wrote (in response to my query) -- Issue 1: only certain extensions can be used for templates. I believe .js is legal but .json is not. We could change that in future releases. Could you file a ticket? On Oct 27, 2011, at 3:16 AM, ni...@maich.gr wrote: Thanx all for the response, I have tried your suggestions (e.g .mtt extension) and I get an Content-type: text/html msReturnPage(): Web application error. Malformed template name (IUNG.mtt). I'm using ms 5.3-dev from the FW win dist. Maybe I'm using the wrong terminology here wrt templates. These are not my query templates but my main application html page the template that gets defined in the web section of the mapfile... e.g # 5 web IUNG web footer templates/IUNG_footer.html header templates/IUNG_header.html imagepath /var/www/html/IUNG/tmp/ imageurl /IUNG/tmp/ template IUNG.mtt end # END WEB hope this helps to help me ;-) regards, ___ 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] Re: showing certain classes selected via cgi
Seems like I *can* do the following per the docs at http://mapserver.org/cgi/runsub.html (more below) On Oct 27, 2011, at 8:56 AM, Puneet Kishor wrote: (I thought I had asked this question and received and answer, but can't find it now... maybe I just dreamed it and never did ask. Here goes...) I have a map with a layer with 100s of classes. I want to send a class name via the URI, and get back a map of only that class. So, the following will return the map with all the classes http://server/map and, the following will return the map with only foo and bar classes http://server/map?classes=foo,bar The above URI pattern is just a suggestion. How can I achieve the above? One thought comes is to split the layer with 100s of classes into 100s of layers each with one class. In any case, what is the advised way forward? So, I tried the following CONNECTION host=localhost port=5432 dbname=macromap user=postgres password=postgres CONNECTIONTYPE POSTGIS PROCESSING CLOSE_CONNECTION=DEFER DATA the_geom FROM table USING UNIQUE gid USING srid=4326 FILTER class_name = '%class%' METADATA 'class_name_validation_pattern' '^[A-Za-z]+$' END And, requested the map at http://server/cgi-bin/app?mode=maplayers=layerclass=Foo but got the following error -- select interval_name,encode(ST_AsBinary(ST_Force_2D(the_geoms),'NDR'),'hex') as geom, gid from table where the_geom GeomFromText('POLYGON((-180.150250417362 -90,-180.150250417362 90,180.150250417362 90,180.150250417362 -90,-180.150250417362 -90))',4326) and (class_name = '%class%') So, %class% didn't get interpolated into the requested value. What am I doing wrong? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: showing certain classes selected via cgi
Gah! nevermind. It was once again my misunderstanding of the docs. On Oct 27, 2011, at 10:34 AM, Puneet Kishor wrote: Seems like I *can* do the following per the docs at http://mapserver.org/cgi/runsub.html (more below) On Oct 27, 2011, at 8:56 AM, Puneet Kishor wrote: (I thought I had asked this question and received and answer, but can't find it now... maybe I just dreamed it and never did ask. Here goes...) I have a map with a layer with 100s of classes. I want to send a class name via the URI, and get back a map of only that class. So, the following will return the map with all the classes http://server/map and, the following will return the map with only foo and bar classes http://server/map?classes=foo,bar The above URI pattern is just a suggestion. How can I achieve the above? One thought comes is to split the layer with 100s of classes into 100s of layers each with one class. In any case, what is the advised way forward? So, I tried the following CONNECTION host=localhost port=5432 dbname=macromap user=postgres password=postgres CONNECTIONTYPE POSTGIS PROCESSING CLOSE_CONNECTION=DEFER DATA the_geom FROM table USING UNIQUE gid USING srid=4326 FILTER class_name = '%class%' METADATA 'class_name_validation_pattern' '^[A-Za-z]+$' END And, requested the map at http://server/cgi-bin/app?mode=maplayers=layerclass=Foo but got the following error -- select interval_name,encode(ST_AsBinary(ST_Force_2D(the_geoms),'NDR'),'hex') as geom, gid from table where the_geom GeomFromText('POLYGON((-180.150250417362 -90,-180.150250417362 90,180.150250417362 90,180.150250417362 -90,-180.150250417362 -90))',4326) and (class_name = '%class%') So, %class% didn't get interpolated into the requested value. What am I doing wrong? -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] default values if not provided in the URL
the fine manual says http://mapserver.org/cgi/runsub.html Since version 5.6, you can provide a default value for any substitution parameter, that will be applied if the parameter was not found in the url. You do this by providing special entries inside the layer metadata : METADATA 'default_sound' 'yes' 'default_nseats' '5' 'default_multimedia' 'yes' END In this example, the mapfile will be created as if the url contained “sound=yesnseats=5multimedia=yes” Right then. Except, I want *all* my classes to be drawn if no class has been provided. And, if one or more classes have been provided, then I want only those to be drawn. So, http://server/mapfile?mode=map should return a map with all the 100+ classes in a layer. And http://server/mapfile?mode=mapclasses=Foo,Bar (or some other variation of the above) should return a map with only the requested classes in the layer. I can't think of anyway of doing the above without resorting to scripting, and I still have had no luck with WMS returned from Perl MapScripting. Suggestions. -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] default values if not provided in the URL
David, On Oct 27, 2011, at 11:19 AM, Fawcett, David (MPCA) wrote: Two hackish thoughts: 1. Utilize a pair of mapfiles. The first one has all of the classes on by default. The second one has all of the class with STATUS OFF. On the client side, you determine if you have any class args and route the request to the appropriate mapfile. If the client has a request with class args, you append one of these for each class 'map.layer[0].class[3]=status on' (specifying the correct layer and class index values) The mapserver request is being made in a number of ways. If there is control on the client side, then, yes, different map files can be requested. http://server/mapall returns all the classes, and http://server/mapfew?class=Foo,Bar returns only Foo and Bar However, the same URI is to be reused in other client apps as well (such as OL), so the ability to choose which map file to request is limited. In any case, for a number of external reasons, the URI is supposed to be unique, so http://server/mapall and http://server/mapfew violate that principle, however, http://server/mapthem (defaulting to 'class=All') and http://server/mapthem?class=Foo,Bar do not violate that uniqueness principle. Alright, moving on ... If you only had a few classes, you could easily manage this with one mapfile (without running up against the character limits on GET requests) I said earlier that I have 100s of classes. I was wrong. Turns out I have 49 classes in this map file. However, in another map file I do have almost 700 classes. The use case is either the user gets all, or is able to specify one or two to filter and show only those. 2. What are you really trying to do? It seem like classes are for selecting and symbolizing/formatting data for output. Do you really want to filter out the data using a filter at the layer level. If you can avoid running all of your data through the expressions for each class, it should perform better too. Dunno how else to explain but with the following text -- the table (aka a layer) has a column called classes and these classes map to specific colors stored in another column. I want to be able to return a map as per the URI rules above. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Puneet Kishor Sent: Thursday, October 27, 2011 10:50 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] default values if not provided in the URL the fine manual says http://mapserver.org/cgi/runsub.html Since version 5.6, you can provide a default value for any substitution parameter, that will be applied if the parameter was not found in the url. You do this by providing special entries inside the layer metadata : METADATA 'default_sound' 'yes' 'default_nseats' '5' 'default_multimedia' 'yes' END In this example, the mapfile will be created as if the url contained sound=yesnseats=5multimedia=yes Right then. Except, I want *all* my classes to be drawn if no class has been provided. And, if one or more classes have been provided, then I want only those to be drawn. So, http://server/mapfile?mode=map should return a map with all the 100+ classes in a layer. And http://server/mapfile?mode=mapclasses=Foo,Bar (or some other variation of the above) should return a map with only the requested classes in the layer. I can't think of anyway of doing the above without resorting to scripting, and I still have had no luck with WMS returned from Perl MapScripting. Suggestions. -- Puneet Kishor___ 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] default values if not provided in the URL
On Oct 27, 2011, at 11:22 AM, Smith, Michael ERDC-CRREL-NH wrote: Punnet, What I do in the situations where I want to default to all or allow some filtered access is METADATA default_classes 1=1 END So the dummy condition is passed when no filter is specified. Believe it or not, I thought up of the above solution myself but discarded it because I understood the text in the documents to mean the following -- FILTER class = '%class%' will be applied if a class is provided. However, if no class is provided, and if the following is provided METADATA default_class 1=1 END Then the filter will become class = '1=1', which is, of course not correct. And, I just checked the logs with the above mods, and my suspicion was proven correct. My log file shows ms croaking with the following select class,encode(ST_AsBinary(ST_Force_2D(the_geoms),'NDR'),'hex') as geom,gid from table where the_geoms GeomFromText('POLYGON((-180.150250417362 -90,-180.150250417362 90,180.150250417362 90,180.150250417362 -90,-180.150250417362 -90))',4326) and (class = '1=1') Obviously, I do not want class = '1=1' On 10/27/11 8:49 AM, Puneet Kishor punk.k...@gmail.com wrote: the fine manual says http://mapserver.org/cgi/runsub.html Since version 5.6, you can provide a default value for any substitution parameter, that will be applied if the parameter was not found in the url. You do this by providing special entries inside the layer metadata : METADATA 'default_sound' 'yes' 'default_nseats' '5' 'default_multimedia' 'yes' END In this example, the mapfile will be created as if the url contained ³sound=yesnseats=5multimedia=yes² Right then. Except, I want *all* my classes to be drawn if no class has been provided. And, if one or more classes have been provided, then I want only those to be drawn. So, http://server/mapfile?mode=map should return a map with all the 100+ classes in a layer. And http://server/mapfile?mode=mapclasses=Foo,Bar (or some other variation of the above) should return a map with only the requested classes in the layer. I can't think of anyway of doing the above without resorting to scripting, and I still have had no luck with WMS returned from Perl MapScripting. Suggestions. -- Puneet Kishor___ 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] default values if not provided in the URL
On Oct 27, 2011, at 12:07 PM, Smith, Michael ERDC-CRREL-NH wrote: I guess I get around that by passing class=1 as my filter so I can pass 1=1 as the default Hmmm... I didn't understand the above at all, but... If you want to set a default that gets all, perhaps you could use a like filter FILTER Class like %class% And a default of % The suggestion above works quite well. Here is what I did FILTER class LIKE '%%class%%' METADATA 'class_validation_pattern' '^[a-zA-Z ]+$' 'default_class' '%' END So, now I can do http://server/app and get everything. Or, request http://server/app?class=Foo and get a map with just Foo. Now, the next problem to solve is to allow giving multiple class(es) as in http://server/app?class=Foo,Bar,Baz The only way I can think is to modify the filter like so FILTER class IN (%class%) which will allow me to pass values via http://server/app?class='Foo','Bar' but then I won't be able to get all the class(es). Besides, gosh, that URI looks super ugly. Thoughts? Maybe the cgi interface is malleable only to a degree. After that I have to start thinking of other ways of solving this. So, here is what I am thinking -- insert a proxy in between. That would allow me to let the user formulate queries any which way I want, and then reformat those queries to the way mapserver expect them. Of course, this proxy would have to sit between mapserver and the rest of the apps, which in my world includes OpenLayers. Would love any directions and suggestions to tackle this. On 10/27/11 9:56 AM, Puneet Kishor punk.k...@gmail.com wrote: On Oct 27, 2011, at 11:22 AM, Smith, Michael ERDC-CRREL-NH wrote: Punnet, What I do in the situations where I want to default to all or allow some filtered access is METADATA default_classes 1=1 END So the dummy condition is passed when no filter is specified. Believe it or not, I thought up of the above solution myself but discarded it because I understood the text in the documents to mean the following -- FILTER class = '%class%' will be applied if a class is provided. However, if no class is provided, and if the following is provided METADATA default_class 1=1 END Then the filter will become class = '1=1', which is, of course not correct. And, I just checked the logs with the above mods, and my suspicion was proven correct. My log file shows ms croaking with the following select class,encode(ST_AsBinary(ST_Force_2D(the_geoms),'NDR'),'hex') as geom,gid from table where the_geoms GeomFromText('POLYGON((-180.150250417362 -90,-180.150250417362 90,180.150250417362 90,180.150250417362 -90,-180.150250417362 -90))',4326) and (class = '1=1') Obviously, I do not want class = '1=1' On 10/27/11 8:49 AM, Puneet Kishor punk.k...@gmail.com wrote: the fine manual says http://mapserver.org/cgi/runsub.html Since version 5.6, you can provide a default value for any substitution parameter, that will be applied if the parameter was not found in the url. You do this by providing special entries inside the layer metadata : METADATA 'default_sound' 'yes' 'default_nseats' '5' 'default_multimedia' 'yes' END In this example, the mapfile will be created as if the url contained ³sound=yesnseats=5multimedia=yes² Right then. Except, I want *all* my classes to be drawn if no class has been provided. And, if one or more classes have been provided, then I want only those to be drawn. So, http://server/mapfile?mode=map should return a map with all the 100+ classes in a layer. And http://server/mapfile?mode=mapclasses=Foo,Bar (or some other variation of the above) should return a map with only the requested classes in the layer. I can't think of anyway of doing the above without resorting to scripting, and I still have had no luck with WMS returned from Perl MapScripting. Suggestions. -- Puneet Kishor___ 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] default styles?
I apply the same OUTLINECOLOR to all my CLASSes. If I could apply the OUTLINECOLOR as a default style, I would save 50 or so lines in my map file (I have 50 or so classes in this one). It doesn't seem to be possible, per the fine manual, but just want to confirm. Perhaps there is a way... -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] MS template file extensions
On Oct 26, 2011, at 8:33 AM, ni...@maich.gr wrote: Hello, Is there a way to allow ms templates with an arbitrary file extension? I see support in the template doc's for html, xml, jso... WHat if someone wanted to use a jsp page a php page or a tml page as a template to gain server substitutin as well? I believe there is no restriction (I use .mtt for map server template). You can choose whatever extension you like, or even have no extension if you wish. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] ticket for 'trimlast'?
On Oct 20, 2011, at 4:06 PM, Fawcett, David (MPCA) wrote: I also can't get trimlast=',' to remove the trailing comma in a json formatted query result. [resultset layer=stations] { stations: [ [feature trimlast=','] { name: [NAME], stationId: [STATION_ID }, [/feature] ] } [/resultset] http://lists.osgeo.org/pipermail/mapserver-users/2011-September/070298.html I searched for a trac ticket, but didn't see one. I will file one if someone can confirm that this is still a real issue and that a ticket doesn't exist. I can confirm that I experienced it as well. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] problem with MapServer as WMS client
On Oct 16, 2011, at 3:00 PM, Rahkonen Jukka wrote: Hi, Have you tried to do it like it is suggested in the documentation http://mapserver.org/ogc/wms_client.html? LAYER NAME country_bounds TYPE RASTER STATUS ON CONNECTION http://demo.mapserver.org/cgi-bin/wms?; CONNECTIONTYPE WMS METADATA wms_srs EPSG:4326 wms_namecountry_bounds wms_server_version 1.1.1 wms_format image/gif END END Thus no PROJECTION for the layer and only EPSG:4326 in wms_srs. EPSG:900913 must be included in the MAP level wms_srs but that should be enough. That was it. Thanks no PROJECTION for the layer, and only EPSG:4326 in wms_srs. Additionally, I was too smart for my own good and had set the TYPE to POLYGON. I guess it should be RASTER because, from the perspective of MapServer, it is getting back an image, no? Including name of the remote mapfile into CONNECTION string is OK. Perhaps addind DEBUG 5 into your WMS layer definition writes the request into log file but I do not know. Try and see if it helps. I did bump the DEBUG level to 5, but that doesn't show the WMS calls. At least you can run some local proxy like Fiddled and let it log the web traffic. In that case you will need to add wms_proxy_host and wms_proxy_port into layer metadata. -Jukka Rahkonen- Lähettäjä: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] k#228;ytt#228;j#228;n Puneet Kishor [punk.k...@gmail.com] puolesta Lähetetty: 16. lokakuuta 2011 2:57 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: [mapserver-users] problem with MapServer as WMS client I am going from OpenLayers to MapServer acting as a WMS client to a remote server. OL is requesting SRS 900913, and the remote server is sending data in 4326, and I want to send it back to OL in 900913. My layer definition is like so LAYER NAME foo TYPE POLYGON STATUS ON CONNECTION http://server/cgi-bin/mapserv?map=mapfile.map; CONNECTIONTYPE WMS PROJECTION init=epsg:4326 END METADATA wms_srs EPSG:900913 EPSG:4326 wms_namefoo wms_server_version 1.1.1 wms_format image/png wms_enable_request * wms_extent -180 -90 180 90 END END I am getting the following error msWMSLoadGetMapParams(): WMS server error. Invalid SRS given: SRS must be valid for all requested layers. I have three questions: 1. The docs at http://mapserver.org/ogc/wms_client.html state that the connection should not have any query params, but I don't see any options to pass the map file name. Is it ok the way I am doing it above? 2. How do I get around the above error? 3. Is there a way I can see the actual request that MapServer is making to the remote server, perhaps in the error.log? -- Puneet Kishor___ 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] problem with MapServer as WMS client
I am going from OpenLayers to MapServer acting as a WMS client to a remote server. OL is requesting SRS 900913, and the remote server is sending data in 4326, and I want to send it back to OL in 900913. My layer definition is like so LAYER NAME foo TYPE POLYGON STATUS ON CONNECTION http://server/cgi-bin/mapserv?map=mapfile.map; CONNECTIONTYPE WMS PROJECTION init=epsg:4326 END METADATA wms_srs EPSG:900913 EPSG:4326 wms_namefoo wms_server_version 1.1.1 wms_format image/png wms_enable_request * wms_extent -180 -90 180 90 END END I am getting the following error msWMSLoadGetMapParams(): WMS server error. Invalid SRS given: SRS must be valid for all requested layers. I have three questions: 1. The docs at http://mapserver.org/ogc/wms_client.html state that the connection should not have any query params, but I don't see any options to pass the map file name. Is it ok the way I am doing it above? 2. How do I get around the above error? 3. Is there a way I can see the actual request that MapServer is making to the remote server, perhaps in the error.log? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Perl MapScript WMS
I am trying to revisit serving WMS and WFS with Perl MapScript and MapServer 6.0.1. If there is anyone who is successfully doing this, please contact me. Many thanks, -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] output template trimlast doesn't work
On Sep 27, 2011, at 6:15 PM, jjwang wrote: This is my template file. The *trimlast=','* statement doesn't work. Any idea on this? // mapserver template [resultset layer=pd] [ [feature trimlast=','] { id: [id], description: [description], venue: [venue], year: [year] }, [/feature] ] [/resultset] I experienced the same. -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Parameter substitution problem
On Sep 29, 2011, at 8:22 AM, Asad Ullah wrote: Steve, Thanks very much for your help. Adding quote did not change anything. However, if I change file name from, for example, OMI-Aura_L3-OMCLDRRclpWMSNRT_20110922.png to OMI_OMCLDRRclpWMSNRT_20110922.png and do the substitution as: /cgi-bin/mapserv.cgi?map_layer[OMI_CP]=DATA+OMI_OMCLDRRclpWMSNRT_+ amsreDate + .png It would work. Where the validation block is same as: VALIDATION 'DATA' '^OMI_.*\.png$' END So, do you think the problem is with validation definition? Could it be the dashes (-) in the problematic file name? Thanks, Asad -Original Message- From: Steve Lime [mailto:sdl...@gmail.com] Sent: Wednesday, September 28, 2011 11:27 PM To: Asad Ullah; mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Parameter substitution problem What happens if you quote the variable in the CGI call, that is: /cgi-bin/mapserv.cgi?map_layer[OMI_CP]=DATA+'OMI-Aura_L3-OMCLDRRclpWMSNRT_+ amsreDate + .png' Note the single quotes in the DATA value... I'll try to whip up local test case. Steve On Tue, Sep 27, 2011 at 4:28 PM, Asad Ullah asad.ul...@sigmaspace.com wrote: Steve, DATA in the URL has quotes as: /cgi-bin/mapserv.cgi?map_layer[OMI_CP]=DATA+OMI-Aura_L3-OMCLDRRclpWMSNRT_+ amsreDate + .png I unquoted the value in mapfile but there was no error. Any more suggestion? Thanks, Asad From: Steve Lime [mailto:sdl...@gmail.com] Sent: Friday, September 23, 2011 4:55 AM To: Asad Ullah Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Parameter substitution problem My guess is the validation is correct but the syntax of the URL parameter is is wrong in that the value passed for DATA is not quoted. If you unquote the default value in your mapfile does that result in a error? That would be an easy way to test the need for quotes. One last idea, while map_layer... should work, try map.layer... instead as you variable name. If you're really are just replacing the date part you could do that by doing a runtime sub... DATA OMI-Aura_L3-OMCLDRRclpWMSNRT_%date%.png VALIDATION date 'regex' END And then you pass date as a CGI variable. Steve On Thursday, September 22, 2011, Asad Ullah asad.ul...@sigmaspace.com wrote: List, I am trying to substitute DATA parameter in my mapfile with a call from Openlayers as follow: map_layer[OMI_CP]=DATA+OMI-Aura_L3-OMCLDRRclpWMSNRT_+ amsreDate + .png The mapfile is: LAYER NAME OMI_CP TYPE RASTER STATUS DEFAULT OFFSITE 0 0 0 PROJECTION init=epsg:4326 END DATA OMI-Aura_L3-OMCLDRRclpWMSNRT_20110922.png VALIDATION 'DATA' '^OMI_.*\.png$' END The call should change the date part (20110922) of the png filename but it is not doing it. Can anyone point to what I am doing wrong here? Thanks, Asad ___ 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] arrow head doesn't draw at the end
On Sep 28, 2011, at 3:11 AM, Havard Tveite wrote: GEOMTRANSFORM end only works for the lines of a line layer. Is your layer a line layer? Sigh. No, my layer is a POINT layer. Where on this page [http://mapserver.org/mapfile/style.html] is it documented that GEOMTRANSFORM is only for LINE layers? I could be wrong, but nowhere do I see that mentioned. In other words, is GEOMTRANSFORM simply not working at all because my layer is a POINT layer? That would explain why the symbol is not being produced at the end point of the symbol, even though I have specified GEOMTRANSFORM end Thanks Håvard. I will lose GEOMTRANSFORM from that STYLE definition. Håvard On 9/27/2011 4:48 PM, Puneet Kishor wrote: On Sep 27, 2011, at 2:18 AM, Havard Tveite wrote: Have you seen: http://mapserver.org/mapfile/symbology/construction.html#changing-the-center-of-a-point-symbol Yup, seen and read it from end to end until my eyes glazed. Perhaps it is clear as crystal to the rest of the world, but I can't fathom anything there applicable to me. I am facing four problems -- 1. As I mentioned below, per the docs, I am supposed to be able to declare ANGLE AUTO in my STYLE definition. That simply does not work for me. I *have* to declare the angle the same as the angle of the stem of the arrow ANGLE [az] in order to get arrow heads headed in the same direction as the arrow stems. 2. From the docs on GEOMTRANSFORM, end: produces the last point of the geometry. When used with ANGLE AUTO, it can for instance be used to render an arrowhead. Well, no... it is *not* producing the *last point of the geometry* as I understand it. Instead, it is producing the middle point of the geometry. And it sure as as I can see is not working with ANGLE AUTO (see #1 above). 3. I have tried several variations on my arrow head to try shift its center, but I am failing to translate the information in the above document to be able to do it correctly. 4. Perhaps most important: the length of the arrow is varying based on [rate]. In other words, I want only the stem to be shorter or longer, but the arrow head to be the same size, and to be at the end of the stem always. In fact, there are instances in which [rate] could be equal to zero. In those instances I don't want any arrow to be drawn at all. *** In other words, I want an arrow stem to be as long as the varying [rate], and if the stem has a length greater than zero then and only then do I want an arrow head at the end of the stem pointing in the same direction as the stem. *** I even tried using a truetype font symbol, but I get no image at all but no error as well. I even tried using a SYMBOL of TYPE pixmap pointing to an image of an arrow. I realize that if I could make that work, it would still be unsatisfactory because as MapServer would scale my arrow image, it would make the attached arrow head also larger, and that would look ugly. In any case, I couldn't get that to work as well... no image at all, but no error as well. Could be my compilation of MapServer was buggy, but I didn't see any compilation time errors, and other than the above oddities, it works quite well. $./mapserv -v MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE I would love to know if my *** objective *** above can be accomplished with MapServer. If not, I would look at other workaround. I am currently rendering arrows using OpenLayers vector layer... it works quite well, but is slow... MapServer is much faster, and could be cached, hence my desire to use MapServer. Thanks. Håvard Tveite On 9/27/2011 4:12 AM, Puneet Kishor wrote: My arrows look like so instead of with declarations like so SYMBOL NAME vert-line TYPE vector POINTS 0 1 0 0 END END SYMBOL NAME up TYPE vector POINTS 0 1 0.5 0 1 1 END END CLASS STYLE SYMBOL 'vert-line' ANGLE [az] SIZE [rate] COLOR 0 0 0 WIDTH 1 END STYLE SYMBOL up ANGLE [az] SIZE 5 GEOMTRANSFORM end COLOR 0 0 0 END END But, at least the arrow heads are aligned correctly. Because, if I use ANGLE auto as prescribed in the docs instead of ANGLE [az] as shown above, my arrows draw like so --^--. The heads are always pointed up, and are in the middle. Suggestions? -- Håvard Tveite Department of Mathematical Sciences and Technology, UMB Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt
Re: [mapserver-users] arrow head doesn't draw at the end
Hi luis, Thanks for helping out. I will try OVERLAYSYMBOL, but from the docs it seems it is no different that using two stacked symbols. I did try GAP, but that doesn't help at all. As I mentioned below, I am drawing these points, not unlike the recent thread started by Brent on drawing wind barbs. Except, in my case, these are GPS sensor readings. The reading values are always 0 or more (actually, they are close to 0, but let's say, the really tiny ones are identifiable). The readings have two values... rate and azimuth. The length of the arrows has to be drawn proportional to the rate, and arrows have to be pointed toward the azimuth. First, I don't want arrows on the 0 (or, close to 0) readings but I still want to show them. So, I've decided I will just select them out and draw them as a separate layer with just dots. Easy. Now, the ones that are to be drawn with an arrow: the problem I am facing is that I want the arrow head at the end of the arrow stem that is of a non-predictable length. Even though the docs imply that I can achieve this with GEOMTRANSFORM, I have failed to do so. And, of course, just now I learned that perhaps that could be because GEOMSTRANSFORM applies *only* to LINE layers. Seems to me the *only* reasonable way to achieve this would be to have a GEOMTRANSFORM kind of capability for POINT layers as well, so that the last (or first or whatever... the specified) point of the symbol geometry could be decorated with another symbol. I am open to all kinds of suggestions at this point. On Sep 28, 2011, at 3:04 AM, luis peinado wrote: Hi, just trying to help. I used some trick with arrows than maybe can help you with some variation. I use mapserver-5.X and the way it worked for me was a LINE type layer using a normal class (continous line) with an OVERLAYSYMBOL, using a character. Maybe changin some parameters like GAP may be useful to you. This is my class on a TYPE LINE layer CLASS NAME capa_tub SYMBOL continous SIZE 2 COLOR 6 79 167 OVERLAYSYMBOL arrow OVERLAYSIZE 30 OVERLAYCOLOR 6 79 167 END And my continous and arrow are SYMBOL NAME arrow TYPE TRUETYPE FONT arial CHARACTER '#62;' FILLED true ANTIALIAS true GAP -100 END SYMBOL NAME continous TYPE ELLIPSE POINTS 1 1 END END Hope it helps. Lluís 2011/9/27 Puneet Kishor punk.k...@gmail.com On Sep 27, 2011, at 2:18 AM, Havard Tveite wrote: Have you seen: http://mapserver.org/mapfile/symbology/construction.html#changing-the-center-of-a-point-symbol Yup, seen and read it from end to end until my eyes glazed. Perhaps it is clear as crystal to the rest of the world, but I can't fathom anything there applicable to me. I am facing four problems -- 1. As I mentioned below, per the docs, I am supposed to be able to declare ANGLE AUTO in my STYLE definition. That simply does not work for me. I *have* to declare the angle the same as the angle of the stem of the arrow ANGLE [az] in order to get arrow heads headed in the same direction as the arrow stems. 2. From the docs on GEOMTRANSFORM, end: produces the last point of the geometry. When used with ANGLE AUTO, it can for instance be used to render an arrowhead. Well, no... it is *not* producing the *last point of the geometry* as I understand it. Instead, it is producing the middle point of the geometry. And it sure as as I can see is not working with ANGLE AUTO (see #1 above). 3. I have tried several variations on my arrow head to try shift its center, but I am failing to translate the information in the above document to be able to do it correctly. 4. Perhaps most important: the length of the arrow is varying based on [rate]. In other words, I want only the stem to be shorter or longer, but the arrow head to be the same size, and to be at the end of the stem always. In fact, there are instances in which [rate] could be equal to zero. In those instances I don't want any arrow to be drawn at all. *** In other words, I want an arrow stem to be as long as the varying [rate], and if the stem has a length greater than zero then and only then do I want an arrow head at the end of the stem pointing in the same direction as the stem. *** I even tried using a truetype font symbol, but I get no image at all but no error as well. I even tried using a SYMBOL of TYPE pixmap pointing to an image of an arrow. I realize that if I could make that work, it would still be unsatisfactory because as MapServer would scale my arrow image, it would make the attached arrow head also larger, and that would look ugly. In any case, I couldn't get that to work as well... no image at all, but no error as well. Could be my compilation of MapServer was buggy, but I didn't see any compilation time errors, and other than the above oddities, it works quite well. $./mapserv -v MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
Re: [mapserver-users] arrow head doesn't draw at the end
Hi Thomas, On Sep 28, 2011, at 8:15 AM, thomas bonfort wrote: On Wed, Sep 28, 2011 at 15:09, Mr. Puneet Kishor punk.k...@gmail.com wrote: Hi luis, Thanks for helping out. I will try OVERLAYSYMBOL, but from the docs it seems it is no different that using two stacked symbols. I did try GAP, but that doesn't help at all. As I mentioned below, I am drawing these points, not unlike the recent thread started by Brent on drawing wind barbs. Except, in my case, these are GPS sensor readings. The reading values are always 0 or more (actually, they are close to 0, but let's say, the really tiny ones are identifiable). The readings have two values... rate and azimuth. The length of the arrows has to be drawn proportional to the rate, and arrows have to be pointed toward the azimuth. First, I don't want arrows on the 0 (or, close to 0) readings but I still want to show them. So, I've decided I will just select them out and draw them as a separate layer with just dots. Easy. Now, the ones that are to be drawn with an arrow: the problem I am facing is that I want the arrow head at the end of the arrow stem that is of a non-predictable length. Even though the docs imply that I can achieve this with GEOMTRANSFORM, I have failed to do so. And, of course, just now I learned that perhaps that could be because GEOMSTRANSFORM applies *only* to LINE layers. The docs have *never* implied that, even if you might have wanted them to. end: produces the last point of the geometry: the last point of a point geometry is the point itself, which is what is happening. Now it makes crystal clear sense. Nevertheless, consider that until as of this moment, I did take the docs to imply that the geometry in this case was the geometry of the symbol. When I say imply, I am not accusing anyone of misleading. I am asserting that the way a truth has been stated in the document can and has appeared as another truth to someone else. Just changing the docs to what you explained above would be fantastic. Additionally, per Havard, GEOMTRANSFORM apparently doesn't even apply to POINTs. Which now makes sense, since a point geometry's start, middle and end are exactly the same. However, again, stating this in the docs would be super helpful. Seems to me the *only* reasonable way to achieve this would be to have a GEOMTRANSFORM kind of capability for POINT layers as well, so that the last (or first or whatever... the specified) point of the symbol geometry could be decorated with another symbol. again, geomtransform applies to the underlying feature, not the symbol you are rendering on top of the feature. geomtransform will not help in your case. as paul suggested, you need to classify your data with a different symbol depending on your [rate], and use the azimuth for the orientation. Hmmm I am trying to figure out which Paul suggested where in this thread. Perhaps you are referring to the wind barb thread. In any case, I am not sure what you mean by classify your data with a different symbol depending on your [rate]. The way I am understanding that sentence is that I should have an actual different symbol for every different rate. Well, that will not only not work for me, it would defeat the purpose of all this automation. I have ~3000 points, each with a different rate. I can't possibly have 3000 symbols. Not just that, these rates change on a daily basis. Background -- these are readings from almost 3000 stations around the world reporting the rates daily. I get new values on a daily basis, so every day I would have a different map. (actually, it is a lot more complicated than that, but that is a good depiction of the problem). Many thanks again for your assistance, but I hope the above clarifies the issues. I am open to all kinds of suggestions at this point. On Sep 28, 2011, at 3:04 AM, luis peinado wrote: Hi, just trying to help. I used some trick with arrows than maybe can help you with some variation. I use mapserver-5.X and the way it worked for me was a LINE type layer using a normal class (continous line) with an OVERLAYSYMBOL, using a character. Maybe changin some parameters like GAP may be useful to you. This is my class on a TYPE LINE layer CLASS NAME capa_tub SYMBOL continous SIZE 2 COLOR 6 79 167 OVERLAYSYMBOL arrow OVERLAYSIZE 30 OVERLAYCOLOR 6 79 167 END And my continous and arrow are SYMBOL NAME arrow TYPE TRUETYPE FONT arial CHARACTER '#62;' FILLED true ANTIALIAS true GAP -100 END SYMBOL NAME continous TYPE ELLIPSE POINTS 1 1 END END Hope it helps. Lluís 2011/9/27 Puneet Kishor punk.k...@gmail.com On Sep 27, 2011, at 2:18 AM, Havard Tveite wrote: Have you seen: http://mapserver.org/mapfile/symbology/construction.html#changing-the-center-of-a-point-symbol Yup, seen and read it from end to end until my eyes glazed. Perhaps it is clear as crystal
Re: [mapserver-users] arrow head doesn't draw at the end
On Sep 28, 2011, at 8:32 AM, Mr. Puneet Kishor wrote: .. On 9/27/2011 4:12 AM, Puneet Kishor wrote: My arrows look like so instead of with declarations like so SYMBOL NAME vert-line TYPE vector POINTS 0 1 0 0 END END SYMBOL NAME up TYPE vector POINTS 0 1 0.5 0 1 1 END END CLASS STYLE SYMBOL 'vert-line' ANGLE [az] SIZE [rate] COLOR 0 0 0 WIDTH 1 END STYLE SYMBOL up ANGLE [az] SIZE 5 GEOMTRANSFORM end COLOR 0 0 0 END END But, at least the arrow heads are aligned correctly. Because, if I use ANGLE auto as prescribed in the docs instead of ANGLE [az] as shown above, my arrows draw like so --^--. The heads are always pointed up, and are in the middle. Suggestions? Time to show my full hand -- - go to http://mumbai.geology.wisc.edu/geoplates/ - zoom out two clicks so the entire world is visible - click on the round grey button with the arrow pointing NW in the top left (just below the blue pan/zoom buttons) - now click once on the map, say, on North America The GPS readings load as arrow symbols. This is an OpenLayers vector layer, each point being drawn using an external graphic. The problem is speed. Not only does it take a perceptible time to load, when it has loaded, the entire map is very sluggish repainting as you pan and zoom. Now, go to http://mumbai.geology.wisc.edu/test/gps_vecs.html where I have the same layer being loaded by MapServer. It is much quicker, but, most important, since these are images, the map is really responsive. Of course, the markers are no good. My style definition is as shown below. Of course, I can use the same externalGraphic with MapServer as the one I used with OpenLayers. But that also doesn't produce much joy. The markers get drawn really tiny, for some reason. -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] passing cgi query params to wms layers
On Sep 26, 2011, at 11:22 PM, Mr. Puneet Kishor wrote: On Sep 26, 2011, at 11:04 PM, Stephen Woodbridge wrote: On 9/26/2011 10:29 PM, Puneet Kishor wrote: I am using OpenLayers as the front-end, requesting a WMS layer from MapServer that is getting data from Pg. My DATA statement is like so DATA the_geom FROM (SELECT gid, pc, the_geom FROM table) t USING UNIQUE gid USING srid=4326 FILTER pc = 'na' The above works fine. However, I would like to send the value of pc from OpenLayers (that is another problem that I am experiencing; I have asked on OL list on how to send query params to WMS layers, but if any of you know the solution, I would welcome that). In any case, I thought (naively), that I could change my FILTER statement like so FILTER pc = '[pc]' I tried sending a WMS query directly to test the above like so [http://server/cgi-bin/app?.. blah ..pc=na] but no joy. Forcing a query error showed me that MapServer was executing the following select .. from (..) t where the_geom GeomFromText(..) and (pc = '[pc]') How can I dynamically supply MapServer a filter value? Does this doc answer your question? http://mapserver.org/cgi/runsub.html Yes it does. I had not seen that doc (hence, I was naively trying [var] kinda sub) So, it seems I can't use Perl compatible regexps inside the map file for runtime substitution. For example, the following fails 'pc_validation_pattern' '^\w\w$' with msValidateParameter(): Regular expression error. Parameter pattern validation failed. But the following works 'pc_validation_pattern' '^[a-zA-Z][a-zA-Z]$' Is there a compile time switch to make MapServer Perl-savvy? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] arrow head doesn't draw at the end
My arrows look like so instead of with declarations like so SYMBOL NAME vert-line TYPE vector POINTS 0 1 0 0 END END SYMBOL NAME up TYPE vector POINTS 0 1 0.5 0 1 1 END END CLASS STYLE SYMBOL 'vert-line' ANGLE [az] SIZE [rate] COLOR 0 0 0 WIDTH 1 END STYLE SYMBOL up ANGLE [az] SIZE 5 GEOMTRANSFORM end COLOR 0 0 0 END END But, at least the arrow heads are aligned correctly. Because, if I use ANGLE auto as prescribed in the docs instead of ANGLE [az] as shown above, my arrows draw like so --^--. The heads are always pointed up, and are in the middle. Suggestions? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] passing cgi query params to wms layers
I am using OpenLayers as the front-end, requesting a WMS layer from MapServer that is getting data from Pg. My DATA statement is like so DATA the_geom FROM (SELECT gid, pc, the_geom FROM table) t USING UNIQUE gid USING srid=4326 FILTER pc = 'na' The above works fine. However, I would like to send the value of pc from OpenLayers (that is another problem that I am experiencing; I have asked on OL list on how to send query params to WMS layers, but if any of you know the solution, I would welcome that). In any case, I thought (naively), that I could change my FILTER statement like so FILTER pc = '[pc]' I tried sending a WMS query directly to test the above like so [http://server/cgi-bin/app?.. blah ..pc=na] but no joy. Forcing a query error showed me that MapServer was executing the following select .. from (..) t where the_geom GeomFromText(..) and (pc = '[pc]') How can I dynamically supply MapServer a filter value? -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] passing cgi query params to wms layers
On Sep 26, 2011, at 11:04 PM, Stephen Woodbridge wrote: On 9/26/2011 10:29 PM, Puneet Kishor wrote: I am using OpenLayers as the front-end, requesting a WMS layer from MapServer that is getting data from Pg. My DATA statement is like so DATA the_geom FROM (SELECT gid, pc, the_geom FROM table) t USING UNIQUE gid USING srid=4326 FILTER pc = 'na' The above works fine. However, I would like to send the value of pc from OpenLayers (that is another problem that I am experiencing; I have asked on OL list on how to send query params to WMS layers, but if any of you know the solution, I would welcome that). In any case, I thought (naively), that I could change my FILTER statement like so FILTER pc = '[pc]' I tried sending a WMS query directly to test the above like so [http://server/cgi-bin/app?.. blah ..pc=na] but no joy. Forcing a query error showed me that MapServer was executing the following select .. from (..) t where the_geom GeomFromText(..) and (pc = '[pc]') How can I dynamically supply MapServer a filter value? Does this doc answer your question? http://mapserver.org/cgi/runsub.html Yes it does. I had not seen that doc (hence, I was naively trying [var] kinda sub). Man, this is hairy shiiite. Maybe I should concentrate on trying to get WMS via MapScript working again so I can work within the more familiar and comfy environs of the Perl DBI. MapServer is fast as heck and basically joy to the world, but its Pg interface is a foreign world to me. This should help from the mapserver side of things. In the OpenLayers side of things you will need to propagate the parameter values into the base URL for the WMS request and get OpenLayers to propagate that change into the layer object. I see. Thanks for answering this, because this too had me stumped. The so called optional JS object that was supposed to pass arbitrary parameters to the OL layer constructor wasn't bringing any success. So, essentially, I should construct the base URL and then make my WMS layer as usual. If you expect the existing map to change when you change the values, then you will need to force OpenLayers to redraw the layer to request a new image or tiles based on the updated parameters. Yeah, of course. The idea is that the user clicks on the map, and based on the location of the click, a new map layer is generated. Hopefully I will have this all working soon and be able to show it to the world. Many thanks Steve (and you too Jukka). Puneet. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] WMS layers get canceled
I am unable to figure this out -- My app front is Google Maps API v3 with MapServer 6.0.1 $./mapserv -v MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE The app fires WMS requests that look like so in Firebug and Safari Web Inspector (one per tile) http://path/to/server/cgi-bin/app?version=1.1.1request=GetMapformat=image/pngTRANSPARENT=TRUEStyles=SRS=EPSG:4326Layers=lyrwidth=256height=256BBOX=-135,40.97989806962013,-90,66.51326044311185 The status code in Firebug is Aborted (Canceled in Safari Web Inspector). The ms_error file kicks in the following messages -- [Thu Sep 22 21:00:55 2011].347078 msWMSLoadGetMapParams(): enabling non-square pixels. [Thu Sep 22 21:00:55 2011].347608 msDrawMap(): kicking into non-square pixel preserving mode. [Thu Sep 22 21:00:55 2011].347615 msDrawMap(): rendering using outputformat named png24 (AGG/PNG). My .map file has the following incantation -- in the MAP section # PROJECTION init=epsg:4326 END WEB METADATA ows_enable_request * wms_abstract blah blah wms_accessconstraints none wms_title gpsvecs wms_onlineresource http://path/to/server/cgi-bin/gpsvecs?; wms_srs EPSG:4326 wms_keywordlist foo,bar wms_enable_request * END END in the LAYER section LAYER NAME lyr CONNECTION host=localhost port=5432 dbname=db user=user password=passwd CONNECTIONTYPE POSTGIS PROCESSING CLOSE_CONNECTION=DEFER DATA the_geom FROM (SELECT gid, a, b, the_geom FROM table) foo USING UNIQUE gid USING srid=4326 PROJECTION init=epsg:4326 END METADATA wms_srs EPSG:4326 wms_title lyr wms_abstract blah blah wms_keywordlist foo,bar wms_enable_request * wms_extent -180 -90 180 90 END Suggestions?___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: WMS layers get canceled
a bit more on this below -- On Sep 22, 2011, at 9:17 PM, Puneet Kishor wrote: I am unable to figure this out -- My app front is Google Maps API v3 with MapServer 6.0.1 $./mapserv -v MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE The app fires WMS requests that look like so in Firebug and Safari Web Inspector (one per tile) http://path/to/server/cgi-bin/app?version=1.1.1request=GetMapformat=image/pngTRANSPARENT=TRUEStyles=SRS=EPSG:4326Layers=lyrwidth=256height=256BBOX=-135,40.97989806962013,-90,66.51326044311185 The status code in Firebug is Aborted (Canceled in Safari Web Inspector). The ms_error file kicks in the following messages -- [Thu Sep 22 21:00:55 2011].347078 msWMSLoadGetMapParams(): enabling non-square pixels. [Thu Sep 22 21:00:55 2011].347608 msDrawMap(): kicking into non-square pixel preserving mode. [Thu Sep 22 21:00:55 2011].347615 msDrawMap(): rendering using outputformat named png24 (AGG/PNG). My .map file has the following incantation -- in the MAP section # PROJECTION init=epsg:4326 END WEB METADATA ows_enable_request * wms_abstract blah blah wms_accessconstraints none wms_title gpsvecs wms_onlineresource http://path/to/server/cgi-bin/gpsvecs?; wms_srs EPSG:4326 wms_keywordlist foo,bar wms_enable_request * END END in the LAYER section LAYER NAME lyr CONNECTION host=localhost port=5432 dbname=db user=user password=passwd CONNECTIONTYPE POSTGIS PROCESSING CLOSE_CONNECTION=DEFER DATA the_geom FROM (SELECT gid, a, b, the_geom FROM table) foo USING UNIQUE gid USING srid=4326 PROJECTION init=epsg:4326 END METADATA wms_srs EPSG:4326 wms_title lyr wms_abstract blah blah wms_keywordlist foo,bar wms_enable_request * wms_extent -180 -90 180 90 END Suggestions? Seems like when fired by Google Maps, MapServer doesn't return any Response Headers. If I take the same query and send it manually, I get the response headers, and I get a nice image back. Any idea what is going on? My guess is I am doing something wrong on the Gmaps side. Here is my relevant code var lyr = new google.maps.ImageMapType({ getTileUrl : function (tile, zoom) { return uri + layers= + name + mode=tiletilemode=gmaptile= + tile.x + + + tile.y + + + zoom; }, tileSize : new google.maps.Size(256, 256), isPng : false, opacity : 0.5, maxZoom : 22, minZoom : 1, alt : , name : name }); map.overlayMapTypes.push(lyr)___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] little whiskers on my arrows
I have a simple arrowhead defined like soSTYLE SYMBOL 'horiz-line' ANGLE [Az] SIZE [Rate] COLOR 255 255 255 WIDTH 1ENDSTYLE ANGLE [Az] GEOMTRANSFORM "end" SYMBOL "to" COLOR 255 255 255 WIDTH 8ENDSYMBOL NAME "horiz-line" TYPE vector POINTS0 01 0 ENDENDSYMBOL NAME "to" TYPE vector POINTS0 01 0.50 1 ENDENDI have attached two images: arr.png and arr_zoom.png. They show the problem. My arrows have little whiskers coming out from behind the arrowhead. How can I get a clean symbol?Puneet.___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] recommended tile caching mechanism with `mode=tile`
On Sep 17, 2011, at 11:43 PM, Daniel Morissette wrote: On 11-09-18 12:08 AM, Mr. Puneet Kishor wrote: I am using MapServer cgi with `mode=tile` with a Google Maps front-end, and am wondering what is a recommended tile cache server. Any suggestions from personal experience? MapServer MapCache of course! It is a fully featured, robust and fast tiling server. Only available in MapServer SVN trunk at the moment. http://mapserver.org/trunk/mapcache/ It was formerly known as Mod-Geocache until a few weeks ago... the website is in the process of being migrated to the above URL, but in the meantime you can still reach the old site: http://code.google.com/p/mod-geocache/ Very nice. I look forward to installing this; hopefully, it will be straightforward. A couple of questions -- 1. I was looking at mod_cache (mod_disk_cache and mod_mem_cache) yesterday and wondering if they could be used to cache the images. Is mod_geocache inspired/based on those modules? 2. Why wed this to Apache? By making it web-server agnostic, you open up the audience. Puneet. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] installing and configuring mapcache
installation mostly went well except for pixman. The install docs say, I should have the following incantation --with-pixman=[yes|no|/path/to/pkgconfig/pixman.pc] I installed pixman and have the following $ll /opt/local/include/pix* total 88 -rw-r--r-- 1 root admin 1739 Sep 18 11:35 pixman-version.h -rw-r--r-- 1 root admin 39608 Sep 18 11:35 pixman.h $ll /opt/local/lib/libpix* -rwxr-xr-x 1 root admin 474024 Sep 18 11:35 /opt/local/lib/libpixman-1.0.22.2.dylib* lrwxr-xr-x 1 root admin 24 Sep 18 11:35 /opt/local/lib/libpixman-1.0.dylib@ - libpixman-1.0.22.2.dylib -rw-r--r-- 1 root admin 550432 Sep 18 11:35 /opt/local/lib/libpixman-1.a lrwxr-xr-x 1 root admin 24 Sep 18 11:35 /opt/local/lib/libpixman-1.dylib@ - libpixman-1.0.22.2.dylib -rwxr-xr-x 1 root admin 866 Sep 18 11:35 /opt/local/lib/libpixman-1.la* I am not sure where I would find this pitman.pc. I tried configure-ing with `--with-pixman=/opt/local` but no luck. Suggestions on how I could include pixman? Anyway, in the meantime, I dropped pixman support and configured successfully. `make` and `sudo make install-module` added the module to my httpd.conf. But, now I am lost again. Per the docs --- Next, a geocache configuration is mapped to the server url with the following snippet IfModule geocache_module Directory /path/to/directory Order Allow,Deny Allow from all /Directory GeoCacheAlias /geocache /path/to/directory/geocache.xml /IfModule --- I can't really parse the above. What is the `path/to/directory` in Directory ...? I have the `geocache.xml` in my mapcache src tree; Should I place it somewhere special? Is this `path/to/directory` where the tiles are stored? And, finally, what should I do if I have the following mapserver URL where tile.x, tile.y and zoom are inserted dynamically? http://server/cgi-bin/mapcgi?layers=layermode=tiletilemode=mapcgitile=' + tile.x + '+' + tile.y + '+' + zoom ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] installing and configuring mapcache
On Sep 18, 2011, at 1:48 PM, thomas bonfort wrote: I am not sure where I would find this pitman.pc. I tried configure-ing with `--with-pixman=/opt/local` but no luck. Suggestions on how I could include pixman? /opt/local/lib/pkgconfig/pixman-1.pc Thanks, that worked, and compiled cleanly. And, finally, what should I do if I have the following mapserver URL where tile.x, tile.y and zoom are inserted dynamically? http://server/cgi-bin/mapcgi?layers=layermode=tiletilemode=mapcgitile=' + tile.x + '+' + tile.y + '+' + zoom you have to give the url to the *wms* service, not the tile one, i.e. http://server/cgi-bin/mapcgi?map=foo.map h... I am using Google Maps API v3, and haven't implemented a WMS tiling front-end and MapServer WMS backend that would support that. Which is why when I started the earlier thread inquiring about caching mechanisms, I specifically inquired for ones that supported MapServer's `mode=tile`, else I would have explored tilecache.org or geowebcache. So, now I would have to modify my frontend, and configure MapServer as WMS, before I can test mod-geocache. Will be a while, it seems. Puneet.___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] recommended tile caching mechanism with `mode=tile`
I am using MapServer cgi with `mode=tile` with a Google Maps front-end, and am wondering what is a recommended tile cache server. Any suggestions from personal experience? -- Puneet Kishor___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: interesting thread on JSON-ish output from MapServer
Partial solution (phew, for now), but other problems persist -- (cc-ing to Steve Lime and Rich Greenwood) On Sep 10, 2011, at 11:42 PM, Mr. Puneet Kishor wrote: [http://osgeo-org.1803224.n2.nabble.com/GeoJSON-output-from-MapServer-td3188987.html] If I call my template template.html I get the output, but I get mime type warning and a syntax error in parsing the output. The above is now partially solved. I still get the mime type incorrectly set, but the syntax error was my mistake. However, it is something worthy of being documented. I was making a JSONP (cross-domain) call. Hence, the response coming back should have been wrapped in the callback as an argument. Since I am stuck using CGI for now, I don't know if I can get MapServer to recognize the callback param that is randomly generated by jQuery, and use that in the template. So, I prescribed a custom callback, and used that in the template. Before (doesn't work with JSONP) - $.ajax({ url : url, type: GET, data: , dataType: jsonp, error : function() { alert(Error loading html document); }, success : function(r) { .. } }); // mapserver template {gid:[gid],unit:[unit_abbre],rock type:[rocktype],lithology:[lithology],min age:[min_age],max age:[max_age],interval:[interval_name]} After (works fine, note addition of jsonpCallback in the request) --- $.ajax({ url : url, type: GET, data: , dataType: jsonp, jsonpCallback: foo, error : function() { alert(Error loading html document); }, success : function(r) { .. } }); // mapserver template foo({gid:[gid],unit:[unit_abbre],rock type:[rocktype],lithology:[lithology],min age:[min_age],max age:[max_age],interval:[interval_name]}) One issue I have not solved -- if no result is found, MapServer sends back the following -- HTML HEADTITLEMapServer Message/TITLE/HEAD !-- MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT =SHAPEFILE -- BODY BGCOLOR=#FF msQueryByPoint(): Search returned no results. No matching record(s) found. /BODY/HTML Well, that gums up the works. I really want MapServer to just send an empty JSON structure, something like foo({}). Suggestions on how I can prevent this HTML message from MapServer, and force it to use the template instead? If I rename the template template.json MapServer complains that the name is malformed. This one is interesting. Per Steve Lime's email earlier today, Issue 1: only certain extensions can be used for templates. I believe .js is legal but .json is not. We could change that in future releases. Could you file a ticket? Yet, the docs at [http://mapserver.org/output/template_output.html] very clearly mention the use of .json as a file extension. I quote OUTPUTFORMAT NAME geojson DRIVER TEMPLATE FORMATOPTION FILE=myTemplate.json END Fwiw, I using `NAME geojson` as above in my `OUTPUTFORMAT` block, but I am returning just plain vanilla JSON. If I change the NAME to json, I get back an unprocessed template. If I rename the template template.js MapServer complains that it is Unable to access file .js being legal notwithstanding, the fact is, if I change my template.html to template.js, MapServer errors with the above complaint Unable to access file, whatever that means. Exactly the same file, same file mode, everything identical, just the name change. If I add `qformat=geojson` to my query (as shown in the link above), the output contains the template with the place holders, no substitutions with the values. This is even more bizarre -- per the email thread at [[http://osgeo-org.1803224.n2.nabble.com/GeoJSON-output-from-MapServer-td3188987.html], it seems from Steve's comment that `qformat=geojson` is a valid query param (although I don't see it documented anywhere). Yet, if I add that, I get an unprocessed template. What gives? ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] querying in mode=tile
On Sep 11, 2011, at 8:03 AM, Richard Greenwood wrote: On Sat, Sep 10, 2011 at 1:35 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: Now that I have mode=tile working with Google Maps API v3, I am on my way to implement querying like so 0. Bind an infowindow.close() to a click event listener on the map 1. Bind an infowindow.open() to a click event listener on the MapServer layer 2. Fill the infowindow content with the result from an Ajax query to MapServer 3. When the user clicks on the MapServer layer, the Ajax query is fired 4. MapServer responds with the query result as a JSON object 5. Fill the infowindow with the JSON result 6. Close any already open infowindow via #0 above 7. Open a new infowindow with the result Is the general approach outlined above sound? Any pointers to existing code samples for the above? Puneet, I'm doing pretty much that here: http://records.sublettewyo.com/mapserver/map.html I'm using jQuery in this example and putting the info into a jQuery dialog, however I have used a standard browser window in the past. Only thing is that I don't thinnk you really need step 0, simply replace the contents of the container with the new info. Yup, I don't have to worry about #0. Howerver, #1 above is problematic, and I don't have a resolution for it yet. Seems like in Google Maps API v3 I can't addListener to an ImageMapType overlay. See, I am adding a MapServer layer as ImageMapType overlay like so mapserverLayer : new google.maps.ImageMapType({ .. }) map.overlayMapTypes.insertAt(0, mapserverLayer); If I do the following -- google.maps.event.addListener(map, click, function (event) { } it works, however, the following doesn't work at all google.maps.event.addListener(mapserverLayer, click, function (event) { } Which is silly, isn't it? I don't want the entire map to be listening to the click events. I just want the MapServer layer to be doing so. Haven't yet found a resolution to this. Also, if your data is in PostGIS you can skip mapserver for attribute queries and do an info query against the PostGIS db via PHP or other server-side tool. Ok, I am very interested in the above, but I am not sure I understand you. For the most part, I want to click on the map, and find out more about what I clicked on. In order to do that query via Perl MapScript (I don't know PHP) and Pg, I would need to create the $mapObj. I am able to do that fine, but I don't know how to run MapServer in `mode=tile` via MapScript. This is the question I have asked a couple of times -- if I have a pure MapScript app (no map files involved at all, which is what I want), how no earth do I tell the app to use `mode=tile`? Puneet. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] bad query result crashes Perl
I query Pg to grab the data with which I construct LAYER CLASSes like so (nothing fancy). SELECT class_name, class_expression, class_color FROM table; A few of the rows in the result set come back with class_color = '' (I can easily avoid those, but that is not the point of this post). The bad color crashes mapscript.bundle which takes down Perl as well, which should never happen. I am using Perl 5.14.1 on Mac OS X Lion. $ perl -V Summary of my perl5 (revision 5 version 14 subversion 1) configuration: Platform: osname=darwin, osvers=11.0.1, archname=darwin-multi-2level uname='darwin lucknow.local 11.0.1 darwin kernel version 11.0.1: wed jun 29 19:53:22 pdt 2011; root:xnu-1699.23.2~1release_x86_64 x86_64 .. blah blah .. Here is the crash report Process: perl5.14 [247] Path:/opt/local/bin/perl5.14 Identifier: perl5.14 Version: ??? (???) Code Type: X86-64 (Native) Parent Process: perl5.14 [246] Date/Time: 2011-09-11 11:25:29.138 -0500 OS Version: Mac OS X 10.7.1 (11B2118) Report Version: 9 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x VM Regions Near 0: -- __TEXT 00010ca28000-00010cb6a000 [ 1288K] r-x/rwx SM=COW /opt/local/bin/perl5.14 Application Specific Information: objc[247]: garbage collection is OFF Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 mapscript.bundle0x00010cdd2e84 _wrap_styleObj_color_set + 596 -- Puneet Kishor ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: interesting thread on JSON-ish output from MapServer
On Sep 11, 2011, at 12:46 PM, Steve Lime wrote: Sent from my iPad On Sep 11, 2011, at 9:36 AM, Mr. Puneet Kishor punk.k...@gmail.com wrote: Partial solution (phew, for now), but other problems persist -- .. One issue I have not solved -- if no result is found, MapServer sends back the following -- HTML HEADTITLEMapServer Message/TITLE/HEAD !-- MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT =SHAPEFILE -- BODY BGCOLOR=#FF msQueryByPoint(): Search returned no results. No matching record(s) found. /BODY/HTML Well, that gums up the works. I really want MapServer to just send an empty JSON structure, something like foo({}). Suggestions on how I can prevent this HTML message from MapServer, and force it to use the template instead? Any suggestion for the above? That is, force MapServer to not send back an error message of the above kind. Instead, send back an empty JSON structure based on the template? Puneet.___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: interesting thread on JSON-ish output from MapServer
On Sep 11, 2011, at 4:18 PM, Steve Lime wrote: You could try the web object and the empty parameter. From TFM EMPTY [url] URL to forward users to if a query fails. If not defined the value for ERROR is used. H... I am not sure I want to forward the user to any URL. This is all Ajax, so I have to receive an empty data structure. I guess I could try exploiting the jQuery `$.ajax({ error: function() { popup an infowindow with regrets message } });` Sent from my iPad On Sep 11, 2011, at 1:33 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: On Sep 11, 2011, at 12:46 PM, Steve Lime wrote: Sent from my iPad On Sep 11, 2011, at 9:36 AM, Mr. Puneet Kishor punk.k...@gmail.com wrote: Partial solution (phew, for now), but other problems persist -- .. One issue I have not solved -- if no result is found, MapServer sends back the following -- HTML HEADTITLEMapServer Message/TITLE/HEAD !-- MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT =SHAPEFILE -- BODY BGCOLOR=#FF msQueryByPoint(): Search returned no results. No matching record(s) found. /BODY/HTML Well, that gums up the works. I really want MapServer to just send an empty JSON structure, something like foo({}). Suggestions on how I can prevent this HTML message from MapServer, and force it to use the template instead? Any suggestion for the above? That is, force MapServer to not send back an error message of the above kind. Instead, send back an empty JSON structure based on the template? Puneet. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] layer data sources more than one
On Sep 11, 2011, at 9:05 PM, JIAJIA WANG wrote: The data in the shapefile are suburb boundaries, but I got several shapefiles, one shapefile for one state. I want a map showing the whole country's suburb boundaries. That's can be done by defining several layers (one layer reads one shapefile) in one mapfile. But actually there are not conflicts between these shapefiles. So I want to know is there any way to define only one layer and read the data from all these shapefiles. I am pretty sure (but not 100%) that you can have only one data source per layer. That said, you could either combine all the shapefiles into a single countrywide shapefile, or you could create separate layers, and then create a layer group (I am pretty sure you can group the layers into one... its been a long time, and I am just coming back to MapServer, so check the docs). That way, all the different layers for different states will behave as if they are a single layer. From the docs -- GROUP [name] Name of a group that this layer belongs to. The group name can then be reference as a regular layer name in the template files, allowing to do things like turning on and off a group of layers at once. On Mon, Sep 12, 2011 at 11:17 AM, Mr. Puneet Kishor punk.k...@gmail.comwrote: On Sep 11, 2011, at 8:10 PM, jjwang wrote: Hi, I know that the DATA statement should be given a data source of the layer. What if the data comes from multi shapefiles? Can I give it a list of shapefiles and how to write it? Generally a LAYER maps to a shapefile or a table in a db. It is hard for me to imagine how one layer could have data from two or more shapefiles. Perhaps more explanation would help here. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] querying in mode=tile
On Sep 11, 2011, at 10:03 PM, Richard Greenwood wrote: On Sun, Sep 11, 2011 at 8:48 AM, Mr. Puneet Kishor punk.k...@gmail.com wrote: On Sep 11, 2011, at 8:03 AM, Richard Greenwood wrote: On Sat, Sep 10, 2011 at 1:35 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: Now that I have mode=tile working with Google Maps API v3, I am on my way to implement querying like so 0. Bind an infowindow.close() to a click event listener on the map 1. Bind an infowindow.open() to a click event listener on the MapServer layer 2. Fill the infowindow content with the result from an Ajax query to MapServer 3. When the user clicks on the MapServer layer, the Ajax query is fired 4. MapServer responds with the query result as a JSON object 5. Fill the infowindow with the JSON result 6. Close any already open infowindow via #0 above 7. Open a new infowindow with the result Is the general approach outlined above sound? Any pointers to existing code samples for the above? Puneet, I'm doing pretty much that here: http://records.sublettewyo.com/mapserver/map.html I'm using jQuery in this example and putting the info into a jQuery dialog, however I have used a standard browser window in the past. Only thing is that I don't thinnk you really need step 0, simply replace the contents of the container with the new info. Yup, I don't have to worry about #0. Howerver, #1 above is problematic, and I don't have a resolution for it yet. Seems like in Google Maps API v3 I can't addListener to an ImageMapType overlay. See, I am adding a MapServer layer as ImageMapType overlay like so mapserverLayer : new google.maps.ImageMapType({ .. }) map.overlayMapTypes.insertAt(0, mapserverLayer); If I do the following -- google.maps.event.addListener(map, click, function (event) { } it works, however, the following doesn't work at all google.maps.event.addListener(mapserverLayer, click, function (event) { } Which is silly, isn't it? I don't want the entire map to be listening to the click events. I just want the MapServer layer to be doing so. Haven't yet found a resolution to this. Also, if your data is in PostGIS you can skip mapserver for attribute queries and do an info query against the PostGIS db via PHP or other server-side tool. Ok, I am very interested in the above, but I am not sure I understand you. For the most part, I want to click on the map, and find out more about what I clicked on. In order to do that query via Perl MapScript (I don't know PHP) and Pg, I would need to create the $mapObj. I am able to do that fine, but I don't know how to run MapServer in `mode=tile` via MapScript. This is the question I have asked a couple of times -- if I have a pure MapScript app (no map files involved at all, which is what I want), how no earth do I tell the app to use `mode=tile`? Puneet. Puneet, I do not know how to bind an infowindow.open() to a click event listener on the MapServer layer (#1 above) because I do not use the Google API. But using Perl, PHP or whatever it is easy to query a PostGIS database, and even get GeoJSON back should you want to highlight the selected object on the map. I am using OpenLayers so I can easily convert the mouse click (or box) to a real-world coordinate(s). I pass the point or box to a PHP page which connects to a PostGIS db, does the query, and returns JSON. Does that help? I'm not sure that I understand everything that you're doing and maybe my approach is not appropriate in your case. I am assuming you are using OL with MapServer WMS. If I could get MapServer WMS (via MapScript) working, it would have been good, but after screwing around for a day and a half unsuccessfully, I gave up (for now). Then I tried `mode=tile` and it just worked. However, even that is not fully satisfactory as it is not via MapScript. Without MapScript I am severely hampered -- the complexity of the datasets makes for beastly map files. My map file with just one data source is already almost 9000 lines long. In fact, I generate the map file via MapScript, and then further tweak it by hand. Even with WMS or tile mode, I will have to implement some kind of tile caching either with tilecache or map proxy or some such to improve the performance. However, since I am not using MapScript (even though I would prefer to), I would have to implement both CGI and MapScript to do what you are suggesting above -- CGI to display the map and MapScript to do the query. For now, I have been able to get this clicky thing working -- I click on the map, do a `mode=query` and display the result in an infowindow. That part is working. Ideally, I would like to have a single technology -- MapScript to generate the maps that can be displayed via multiple front-ends -- OL, Gmaps, perhaps Leaflet, and MapScript to query the attributes via clicks and selects on the map. For now, I am
Re: [mapserver-users] querying in mode=tile
On Sep 11, 2011, at 10:52 PM, Richard Greenwood wrote: On Sun, Sep 11, 2011 at 9:37 PM, Mr. Puneet Kishor punk.k...@gmail.com wrote: However, since I am not using MapScript (even though I would prefer to), I would have to implement both CGI and MapScript to do what you are suggesting above -- CGI to display the map and MapScript to do the query. But my point was that you can do the query without mapserver at all if the data is in postgis. Use a server-side language such as Perl or PHP to pass the request to postgis, which can do a spatial query, and then Perl or PHP can format the result as JSON and return it to the page (via AJAX). On second reading, I now get what you are saying. Strange that it never occurred to me. Sounds very sensible, and I will implement it tomorrow. That way I can get away from CGI `mode=query` and its TEMPLATE-ing vagaries. Yes, my data are in Pg, so I can do all my querying with Perl. Wish I could do away with `mode=tile` and also get tiles back via MapScript. Then my solution would be complete. Thanks for this really useful hint (more like making me see the obvious that I was missing for some reason). Puneet.___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: mode=tile and MapScript
knock, knock... any suggestions on the MapScript syntax for setting `mode=tiletilemode=gmaptile={X}+{Y}+{Z}` were X, Y, Z are received as http query params? On Sep 8, 2011, at 10:23 PM, Mr. Puneet Kishor wrote: I am trying out mode=tile as detailed at [http://mapserver.org/output/tile_mode.html], and actually, it works great! Might be able to avoid the pains of WMS completely. However, it works great with MapServer CGI. What if I want to use MapScript? In other words, instead of var urlTemplate = 'http://localhost/cgi-bin/myapp?'; urlTemplate += 'layers=layer1 layer2'; urlTemplate += 'mode=tile'; urlTemplate += 'tilemode=gmap'; urlTemplate += 'tile={X}+{Y}+{Z}'; I have var urlTemplate = 'http://localhost/myapp.cgi?'; urlTemplate += 'tile={X}+{Y}+{Z}'; and I add mode=tile and tilemode=gmap on the server side. My question is -- one, will the above work? and, how do I pass mode=tile and tilemode=gmap and the tile={X}+{Y}+{Z} parameters to the program? I didn't see any MapScript documentation for these parameters. I need to translate a call such as [http://localhost/cgi-bin/myapp?layers=layer1mode=tiletilemode=gmaptile=30+46+7] into a MapScript request. Puneet. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] updating docs
I would like to contribute some of my experiences and revelations to the MapScript docs on the mapserver.org. How do I go about doing that?___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users