[mapserver-users] Different image for each point
Hello folks, We need to be able to display a different small image from each point in a data set, say along the lines of a thumbnail. From what I can see this could be done my defining each image as a symbol and then referencing that. However what we would like to be able to do is get the image file name as part of the query and display the image based on that. Is this possible? Thanks Ian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Different image for each point
On 8/23/2012 1:31 PM, Ian Walberg wrote: Hello folks, We need to be able to display a different small image from each point in a data set, say along the lines of a thumbnail. From what I can see this could be done my defining each image as a symbol and then referencing that. However what we would like to be able to do is get the image file name as part of the query and display the image based on that. Is this possible? I have done this by creating a column with the filename in it. You can then use the column as a symbol name or symbol path or as attribute column in wfs to OpenLayers that can then be used to point to a thumbnail directory of fullsize directory of images. LAYER NAME images TYPE POINT DATA myImagePoints CLASS STYLE SYMBOL (/path/to/thumbs/+'[FILENAME]') END END END Where column FILENAME has something like 'myimage.png' and to do this you are probably limited to gif, jpg, and png images only. svg will NOT work. -Steve W ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Different image for each point
I was just replying along the same lines... :) On Thu, Aug 23, 2012 at 8:21 PM, Stephen Woodbridge wood...@swoodbridge.com wrote: On 8/23/2012 1:31 PM, Ian Walberg wrote: Hello folks, We need to be able to display a different small image from each point in a data set, say along the lines of a thumbnail. From what I can see this could be done my defining each image as a symbol and then referencing that. However what we would like to be able to do is get the image file name as part of the query and display the image based on that. Is this possible? I have done this by creating a column with the filename in it. You can then use the column as a symbol name or symbol path or as attribute column in wfs to OpenLayers that can then be used to point to a thumbnail directory of fullsize directory of images. LAYER NAME images TYPE POINT DATA myImagePoints CLASS STYLE SYMBOL (/path/to/thumbs/+'[FILENAME]') END END END Where column FILENAME has something like 'myimage.png' and to do this you are probably limited to gif, jpg, and png images only. svg will NOT work. gif and png are the only options. jpeg is not. -- thomas -Steve W ___ 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] Different image for each point
Stephen, This looks perfect, I need to look closer but I had thought the symbols needed to be defined separately. Regards Ian -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Stephen Woodbridge Sent: Thursday, August 23, 2012 11:21 AM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Different image for each point On 8/23/2012 1:31 PM, Ian Walberg wrote: Hello folks, We need to be able to display a different small image from each point in a data set, say along the lines of a thumbnail. From what I can see this could be done my defining each image as a symbol and then referencing that. However what we would like to be able to do is get the image file name as part of the query and display the image based on that. Is this possible? I have done this by creating a column with the filename in it. You can then use the column as a symbol name or symbol path or as attribute column in wfs to OpenLayers that can then be used to point to a thumbnail directory of fullsize directory of images. LAYER NAME images TYPE POINT DATA myImagePoints CLASS STYLE SYMBOL (/path/to/thumbs/+'[FILENAME]') END END END Where column FILENAME has something like 'myimage.png' and to do this you are probably limited to gif, jpg, and png images only. svg will NOT work. -Steve W ___ 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] Different image for each point
A lot of this code has been changed in 6.2, but I think the basics still work. I'm not sure if images are cached or not when using this method or if it matters in your case. I guess ideally if it were a fixed set of images then you want caching, but it they are all different then you probably want to turn caching off, but I do not think there are any controls for that. If you have the whole path to the image in the attribute then you do not need to use an expression to concatenate the path and name so it simplies to: SYMBOL '[FILENAME]' Also be aware that you should probably use a POINT layer and not ANNOTATION layers as the latter is deprecated in 6.2 so upgrading it will be easier. -Steve W On 8/23/2012 2:27 PM, Ian Walberg wrote: Stephen, This looks perfect, I need to look closer but I had thought the symbols needed to be defined separately. Regards Ian -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Stephen Woodbridge Sent: Thursday, August 23, 2012 11:21 AM To: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Different image for each point On 8/23/2012 1:31 PM, Ian Walberg wrote: Hello folks, We need to be able to display a different small image from each point in a data set, say along the lines of a thumbnail. From what I can see this could be done my defining each image as a symbol and then referencing that. However what we would like to be able to do is get the image file name as part of the query and display the image based on that. Is this possible? I have done this by creating a column with the filename in it. You can then use the column as a symbol name or symbol path or as attribute column in wfs to OpenLayers that can then be used to point to a thumbnail directory of fullsize directory of images. LAYER NAME images TYPE POINT DATA myImagePoints CLASS STYLE SYMBOL (/path/to/thumbs/+'[FILENAME]') END END END Where column FILENAME has something like 'myimage.png' and to do this you are probably limited to gif, jpg, and png images only. svg will NOT work. -Steve W ___ 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