Hello guys,
I’m a new entry for this mailing-list. I started playing around with Geoserver a couple of weeks ago. Now I have Geoserver installed, a couple of layers, a client browser I use to watch this map using OpenLayers.
Now, Geoserver is linked with a PostGIS database. There’s a table that is updated every second, because there’s a marker changing position. My table is really simple: an id (primary key), a position (a geometry point), speed, username, description, etc. Thanks to Geoserver → Reflector (getMap) → GeoRSS → OpenLayers, i can update my layer and watching this point moving on the map.
Here comes my question: what if I want the client to retrieve all that information in the table (like speed, username, etc.)? I read about Templates and GetFeatureInfo. With templates I can define a custom template for GeoRSS, but how to do that? In the official Geoserver website there’s not so much info about this. If I change the templates in my folder (description.ftl, content.ftl, etc.), I can only get them with a GetFeatureInfo request. Right? But that’s impossibile, because 1. i should retrieve the x,y coordinate in pixel of that moving point, but it means I should make one request to get the point and an other request to get all the other information… not so smart… 2. every second the point moves, and I cannot retrieve the same information from the table a second after.
I hope i’ve been clear. Please, give me a hint. Thanks a lot!
I think you might do better using WFS - it is designed to give access to tabular data, whereas WMS is more oriented around typical “view” and “click for info” operations. You could simply request all features since (1 second ago at time of request) and get them in XML or JSON. Since you are using OpenLayers you already have access to its WFS support: http://openlayers.org/dev/examples/wfs-filter.html . Once OpenLayers parses the request, it can handle rendering, and then you could use JavaScript (JQuery maybe) to construct your table on the client side.
···
On Thu, Apr 11, 2013 at 7:03 AM, Eduard Natale <eduard.natale@anonymised.com> wrote:
Hello guys,
I’m a new entry for this mailing-list. I started playing around with Geoserver a couple of weeks ago. Now I have Geoserver installed, a couple of layers, a client browser I use to watch this map using OpenLayers.
Now, Geoserver is linked with a PostGIS database. There’s a table that is updated every second, because there’s a marker changing position. My table is really simple: an id (primary key), a position (a geometry point), speed, username, description, etc. Thanks to Geoserver → Reflector (getMap) → GeoRSS → OpenLayers, i can update my layer and watching this point moving on the map.
Here comes my question: what if I want the client to retrieve all that information in the table (like speed, username, etc.)? I read about Templates and GetFeatureInfo. With templates I can define a custom template for GeoRSS, but how to do that? In the official Geoserver website there’s not so much info about this. If I change the templates in my folder (description.ftl, content.ftl, etc.), I can only get them with a GetFeatureInfo request. Right? But that’s impossibile, because 1. i should retrieve the x,y coordinate in pixel of that moving point, but it means I should make one request to get the point and an other request to get all the other information… not so smart… 2. every second the point moves, and I cannot retrieve the same information from the table a second after.
I hope i’ve been clear. Please, give me a hint. Thanks a lot!
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Thank you very much for your kind answer. Yeah, I think it’s the best solution. And I think parsing the received GML file with OpenLayers should be easy. Then I can use javascript and OpenLayers, for example, to print all that stuff in a callout for my moving marker inside my map.
Thanks again!
···
2013/4/11 David Winslow <dwinslow@anonymised.com>
I think you might do better using WFS - it is designed to give access to tabular data, whereas WMS is more oriented around typical “view” and “click for info” operations. You could simply request all features since (1 second ago at time of request) and get them in XML or JSON. Since you are using OpenLayers you already have access to its WFS support: http://openlayers.org/dev/examples/wfs-filter.html . Once OpenLayers parses the request, it can handle rendering, and then you could use JavaScript (JQuery maybe) to construct your table on the client side.
–
David Winslow
OpenGeo - http://opengeo.org/
–
Eduard
On Thu, Apr 11, 2013 at 7:03 AM, Eduard Natale <eduard.natale@anonymised.com.> wrote:
Hello guys,
I’m a new entry for this mailing-list. I started playing around with Geoserver a couple of weeks ago. Now I have Geoserver installed, a couple of layers, a client browser I use to watch this map using OpenLayers.
Now, Geoserver is linked with a PostGIS database. There’s a table that is updated every second, because there’s a marker changing position. My table is really simple: an id (primary key), a position (a geometry point), speed, username, description, etc. Thanks to Geoserver → Reflector (getMap) → GeoRSS → OpenLayers, i can update my layer and watching this point moving on the map.
Here comes my question: what if I want the client to retrieve all that information in the table (like speed, username, etc.)? I read about Templates and GetFeatureInfo. With templates I can define a custom template for GeoRSS, but how to do that? In the official Geoserver website there’s not so much info about this. If I change the templates in my folder (description.ftl, content.ftl, etc.), I can only get them with a GetFeatureInfo request. Right? But that’s impossibile, because 1. i should retrieve the x,y coordinate in pixel of that moving point, but it means I should make one request to get the point and an other request to get all the other information… not so smart… 2. every second the point moves, and I cannot retrieve the same information from the table a second after.
I hope i’ve been clear. Please, give me a hint. Thanks a lot!
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users