I’m new to postgis and mapping in general. I have a table containing multipolygon data and one containing point data. I’ve successfully created map images by defining layers using both of these tables individually and showing both of these layers in one image. What I’d like to do is only show the point data within a polygon chosen by the user. I’ve seen this successfully done using queries in mapserver but can’t figure out how to do this in geoserver. A polygon is selected by the user by it’s id through a UI component such as a select box then I’d like to use the polygon’s definition to filter the point data in the other table. Would I have to create a view with the point data that includes a column for the polygon that the point resides in? Can a SLD be defined to join these tables into one layer?
Hi Jeff,
Unfortunately joining isn't all that well supported. People have been
able to work with table views to get what they need, but in the case of
a spatial join in which you need to display multiple spatial attributes
in a single layer i am not sure that will work all that well.
It seems like what you need is a little web app in which your UI
component is built into. There are a number of good web based map
viewers in which you could start from, OpenLayers and MapBuilder to name
a couple.
So once you have your map viewer built into your app and displaying your
polygon layer, you could script up a little bit of magic which processes
a point click on a polygon, and then queries your point layer supplying
a filter which is the boundary of the polygon.
One thing to note is the support in GeoServer for supporting a FILTER
parameter, in which you can filter a wms request on the fly supplying
this type of constraint. You could use it to have the viewer only
display those points which apply to the selected polygon.
Hope that helps somewhat.
-Justin
Jeff Faulkner wrote:
I'm new to postgis and mapping in general. I have a table containing
multipolygon data and one containing point data. I've successfully
created map images by defining layers using both of these tables
individually and showing both of these layers in one image. What I'd
like to do is only show the point data within a polygon chosen by the
user. I've seen this successfully done using queries in mapserver but
can't figure out how to do this in geoserver. A polygon is selected by
the user by it's id through a UI component such as a select box then I'd
like to use the polygon's definition to filter the point data in the
other table. Would I have to create a view with the point data that
includes a column for the polygon that the point resides in? Can a SLD
be defined to join these tables into one layer?!DSPAM:1004,45f6dd3282061460912952!
------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV!DSPAM:1004,45f6dd3282061460912952!
------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users!DSPAM:1004,45f6dd3282061460912952!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org