Hi all,
I was wondering if it's possible to access PostGIS to load a view instead of a table. The goal is to mix different tables and to display different data type to certain locations displayed on the map.
Let's say I have a table with cities with unique IDs. In another table I refer the corresponding IDs to other data in relation to the corresponding cities.
When I click on a city I would like to get some info contained in the other tables, not only get the name of the city.
Is it possible to do something like that with geoserver like loading a view instead of a table? Or any solution that would have the same effect will be welcomed.
The idea is to separate different data into different tables and to be able to refer them while using geoserver.
Regards,
Marc
Marc Desharnais ha scritto:
Hi all,
I was wondering if it's possible to access PostGIS to load a view instead of a table. The goal is to mix different tables and to display different data type to certain locations displayed on the map.
Let's say I have a table with cities with unique IDs. In another table I refer the corresponding IDs to other data in relation to the corresponding cities.
When I click on a city I would like to get some info contained in the other tables, not only get the name of the city.
Is it possible to do something like that with geoserver like loading a view instead of a table? Or any solution that would have the same effect will be welcomed.
The idea is to separate different data into different tables and to be able to refer them while using geoserver.
This is usually done by creating a view on the datatabase, registering
its geometry columns against geometry_columns, and then serving it
straight with Geoserver. Should do what you need.
Cheers
Andrea
Hi Andrea,
I used a view as you said including the geometry column and it worked perfectly. I didn't include the geometry column at first but it's logical when you think about it.
Thanks a lot!
Marc
Andrea Aime wrote:
Marc Desharnais ha scritto:
Hi all,
I was wondering if it's possible to access PostGIS to load a view instead of a table. The goal is to mix different tables and to display different data type to certain locations displayed on the map.
Let's say I have a table with cities with unique IDs. In another table I refer the corresponding IDs to other data in relation to the corresponding cities.
When I click on a city I would like to get some info contained in the other tables, not only get the name of the city.
Is it possible to do something like that with geoserver like loading a view instead of a table? Or any solution that would have the same effect will be welcomed.
The idea is to separate different data into different tables and to be able to refer them while using geoserver.
This is usually done by creating a view on the datatabase, registering
its geometry columns against geometry_columns, and then serving it
straight with Geoserver. Should do what you need.
Cheers
Andrea