[Geoserver-users] Displaying the picture in geoserver

Hello there,

I am still struggling to display my pictures whose paths are in the attribute table and would like to display as pictures and not paths.

Currently, only the path of the picture is showing and not the actual picture.

I have the pictures in the attribute as hyperlinks.

I tried to change the content ftl for my point file to the following

<#list features as feature>
Type: ${type.name} (id: ${feature.fid}):

<#list feature.attributes as attribute>
<#if !attribute.isGeometry>

${attribute.name}: ${attribute.value}

</#if>
<#list features as feature>

  • Point of interest, "${feature.NAME.value}":
  • The tutorial suggested that I should refer to my Internet visible server address instead of localhost, or its IP if I have fixed IPs, I do not understand this very very well,

    hence my struggle with defining the src.
    http://docs.geoserver.org/latest/en/user/tutorials/GetFeatureInfo/index.html

    Someone please help.

    Thank you.

    2018-04-21 16:31 GMT+02:00 Nauwanga Nauwanga <amellynicodemus@anonymised.com>:

      <img src=" picturepath.value \ ${feature.NAME.value} .jpg">

      </li>
    </#list>

    The tutorial suggested that I should refer to my Internet visible server
    address instead of localhost, or its IP if I have fixed IPs, I do not
    understand this very very well,

    the img src should end up to be a fully qualified url to the image in the
    featureinfo response so the browser knows where to get it; it cannot be a
    file path. It can be localhost, but the the url will only resolve if the
    webbrowser and the webserver hosting the image are on the same machine, it
    can be a relative link to the geoserver url if you are hosting the image on
    the same webserver as geoserver, I'm assuming you aren't.

    Mark

    --
    Disclaimer;
    This message is just a reflection of what I thought at the time of sending.
    The message may contain information that is not intended for you or that
    you don't understand.

    Dear All,

    For quite sometimes now, I have been trying to figure out how to get pictures to display in Geoserver but still not working. I got someone to help me configure the IP address but still does not work.

    The question I have is how do I create the qualified url that I should call in the content ftl as suggested by Mark?

    After creating the working url, does the individual pictures in the attribute table also needs to be qualified url? how do I create this? because I would like each point to have its picture showing together with the attribute information.

    My pictures are stored in normal folders and I created paths in the attribute table. I did a QGIS to web app and I manage to get the pictures to show without so much struggle only a few configuration but I now I also need it it to work on the other application using Geoserver.

    Thank you so much for the hints/recommendation.

    Regards
    Amelia

    ···

    On Sun, Apr 22, 2018 at 1:20 PM, Mark Prins <mc.prins@anonymised.com> wrote:


    Check out the vibrant tech community on one of the world’s most
    engaging tech sites, Slashdot.org! http://sdm.link/slashdot


    Geoserver-users mailing list

    Please make sure you read the following two resources before posting to this list:

    If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

    Geoserver-users@anonymised.comrge.net
    https://lists.sourceforge.net/lists/listinfo/geoserver-users

    2018-04-21 16:31 GMT+02:00 Nauwanga Nauwanga <amellynicodemus@anonymised.com>:

    The tutorial suggested that I should refer to my Internet visible server address instead of localhost, or its IP if I have fixed IPs, I do not understand this very very well,

    the img src should end up to be a fully qualified url to the image in the featureinfo response so the browser knows where to get it; it cannot be a file path. It can be localhost, but the the url will only resolve if the webbrowser and the webserver hosting the image are on the same machine, it can be a relative link to the geoserver url if you are hosting the image on the same webserver as geoserver, I’m assuming you aren’t.

    Mark

    Disclaimer;
    This message is just a reflection of what I thought at the time of sending. The message may contain information that is not intended for you or that you don’t understand.

    Do you have an example URL for an image? is that stored in your database?

    if so then all you need is an where you replace thumb nail with the attribute name.

    If you don’t have the full URL stored in the database then you’ll need to add the root of the URL to the attribute.

    Ian

    ···

    On 7 May 2018 at 17:04, Nauwanga Nauwanga <amellynicodemus@anonymised.com> wrote:

    Dear All,

    For quite sometimes now, I have been trying to figure out how to get pictures to display in Geoserver but still not working. I got someone to help me configure the IP address but still does not work.

    The question I have is how do I create the qualified url that I should call in the content ftl as suggested by Mark?

    After creating the working url, does the individual pictures in the attribute table also needs to be qualified url? how do I create this? because I would like each point to have its picture showing together with the attribute information.

    My pictures are stored in normal folders and I created paths in the attribute table. I did a QGIS to web app and I manage to get the pictures to show without so much struggle only a few configuration but I now I also need it it to work on the other application using Geoserver.

    Thank you so much for the hints/recommendation.

    Regards
    Amelia


    Check out the vibrant tech community on one of the world’s most
    engaging tech sites, Slashdot.org! http://sdm.link/slashdot


    Geoserver-users mailing list

    Please make sure you read the following two resources before posting to this list:

    If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

    Geoserver-users@anonymised.com.382…sourceforge.net
    https://lists.sourceforge.net/lists/listinfo/geoserver-users

    On Sun, Apr 22, 2018 at 1:20 PM, Mark Prins <mc.prins@anonymised.com> wrote:


    Check out the vibrant tech community on one of the world’s most
    engaging tech sites, Slashdot.org! http://sdm.link/slashdot


    Geoserver-users mailing list

    Please make sure you read the following two resources before posting to this list:

    If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

    Geoserver-users@anonymised.comrge.net
    https://lists.sourceforge.net/lists/listinfo/geoserver-users

    2018-04-21 16:31 GMT+02:00 Nauwanga Nauwanga <amellynicodemus@anonymised.com>:

    The tutorial suggested that I should refer to my Internet visible server address instead of localhost, or its IP if I have fixed IPs, I do not understand this very very well,

    the img src should end up to be a fully qualified url to the image in the featureinfo response so the browser knows where to get it; it cannot be a file path. It can be localhost, but the the url will only resolve if the webbrowser and the webserver hosting the image are on the same machine, it can be a relative link to the geoserver url if you are hosting the image on the same webserver as geoserver, I’m assuming you aren’t.

    Mark

    Disclaimer;
    This message is just a reflection of what I thought at the time of sending. The message may contain information that is not intended for you or that you don’t understand.

    Ian Turton

    my apologies,
    I have changed the src as follows

    based on the below explanation, not as given earlier but still does not work

    Thank you Ian,

    I tried to convert one sample picture to an active url to test using Google drive, the Url works once I am signed in to my gmail (previewing the picture link works just fine in chrome).
    I took the link and placed it in my attribute table (for one point feature) ,it looks like this https://drive.google.com/uc?id=10ZOOUuX1ImkDtTJCu-U2n7w-0aeLapKM
    then I changed the img src in the content ftl to the following

    buildvwg_2018=attribute column heading with the link for the feature picture

    This still does not work.

    I will give it more tries and revert back.

    ···

    On Mon, May 7, 2018 at 7:16 PM, Ian Turton <ijturton@anonymised.com4…> wrote:

    Do you have an example URL for an image? is that stored in your database?

    if so then all you need is an where you replace thumb nail with the attribute name.

    If you don’t have the full URL stored in the database then you’ll need to add the root of the URL to the attribute.

    Ian

    On 7 May 2018 at 17:04, Nauwanga Nauwanga <amellynicodemus@anonymised.com> wrote:

    Dear All,

    For quite sometimes now, I have been trying to figure out how to get pictures to display in Geoserver but still not working. I got someone to help me configure the IP address but still does not work.

    The question I have is how do I create the qualified url that I should call in the content ftl as suggested by Mark?

    After creating the working url, does the individual pictures in the attribute table also needs to be qualified url? how do I create this? because I would like each point to have its picture showing together with the attribute information.

    My pictures are stored in normal folders and I created paths in the attribute table. I did a QGIS to web app and I manage to get the pictures to show without so much struggle only a few configuration but I now I also need it it to work on the other application using Geoserver.

    Thank you so much for the hints/recommendation.

    Regards
    Amelia


    Check out the vibrant tech community on one of the world’s most
    engaging tech sites, Slashdot.org! http://sdm.link/slashdot


    Geoserver-users mailing list

    Please make sure you read the following two resources before posting to this list:

    If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

    Geoserver-users@anonymised.comrge.net
    https://lists.sourceforge.net/lists/listinfo/geoserver-users

    Ian Turton

    On Sun, Apr 22, 2018 at 1:20 PM, Mark Prins <mc.prins@anonymised.com> wrote:


    Check out the vibrant tech community on one of the world’s most
    engaging tech sites, Slashdot.org! http://sdm.link/slashdot


    Geoserver-users mailing list

    Please make sure you read the following two resources before posting to this list:

    If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

    Geoserver-users@anonymised.comrge.net
    https://lists.sourceforge.net/lists/listinfo/geoserver-users

    2018-04-21 16:31 GMT+02:00 Nauwanga Nauwanga <amellynicodemus@anonymised.com>:

    The tutorial suggested that I should refer to my Internet visible server address instead of localhost, or its IP if I have fixed IPs, I do not understand this very very well,

    the img src should end up to be a fully qualified url to the image in the featureinfo response so the browser knows where to get it; it cannot be a file path. It can be localhost, but the the url will only resolve if the webbrowser and the webserver hosting the image are on the same machine, it can be a relative link to the geoserver url if you are hosting the image on the same webserver as geoserver, I’m assuming you aren’t.

    Mark

    Disclaimer;
    This message is just a reflection of what I thought at the time of sending. The message may contain information that is not intended for you or that you don’t understand.