I'd already accounted for that issue and deleted and re-added the layer. However, when I duplicate the view with a different name and add the geometry type to the PostGIS table before publishing, it publishes correctly as a multipolygon style. So, it seems that Geoserver is holding the default style even after the layer is deleted, as long is it has the same name.
-Elijah ************ Elijah Meeks http://dhs.stanford.edu Digital Humanities Specialist Academic Computing Services Stanford University [email protected] (650)387-6170 ----- Original Message ----- From: "David Winslow" <[email protected]> To: "Elijah Meeks" <[email protected]>, "geoserver-users" <[email protected]> Sent: Thursday, July 14, 2011 10:44:33 AM Subject: Re: [Geoserver-users] PostGIS Views Please keep discussion on the public list where others can chip in and google can find the thread for the next user to run into this problem. GeoServer only chooses a default style ONCE, when the layer is initially configured. Even if you change the geometry type after that, the auto-configured style will not change. If you want GeoServer to re-inspect the layer, delete it and add it again through the web ui. As mentioned before, you can also just manually change the style to an appropriate one (on the "publishing" tab when looking at the layer configuration. -- David Winslow OpenGeo - http://opengeo.org/ On Thu, Jul 14, 2011 at 1:40 PM, Elijah Meeks < [email protected] > wrote: David, I didn't want to spam up the Geoserver list with further questions that are really PostGIS, but this is still proving to be an issue for me, even after registering the view as per "4.3.4. Manually Registering Geometry Columns in geometry_columns" in http://postgis.refractions.net/documentation/manual-1.5/ch04.html#geometry_columns When published in OpenLayers, the view still defaults to displaying the geometry as points. Any ideas on what else I'm screwing up? Thanks, Elijah ************ Elijah Meeks http://dhs.stanford.edu Digital Humanities Specialist Academic Computing Services Stanford University [email protected] (650)387-6170 ----- Original Message ----- From: "David Winslow" < [email protected] > To: "Elijah Meeks" < [email protected] > Cc: [email protected] Sent: Thursday, July 14, 2011 9:18:00 AM Subject: Re: [Geoserver-users] PostGIS Views This happens when GeoServer can't properly determine the geometry type for the column; it defaults to the default point style which is the most general (it will render centroids for polygons and midpoints for linestrings, so any vector data can be rendered with the point style.) If you add "styles=polygon" to the URL for your OpenLayers preview then it should work. You can also set this as the default in the configuration for the layer. You can look in the PostGIS manual for details on how to properly register your view with PostGIS to avoid this sort of issue in the future. -- David Winslow OpenGeo - http://opengeo.or/g On Thu, Jul 14, 2011 at 12:11 PM, Elijah Meeks < [email protected] > wrote: I've got Geoserver 2.1 connected to a PostGIS database and it displays the tables as layers just fine: http://dhs.stanford.edu/dh/geospat/polys.PNG but when I try to server a view as a layer, it looks like the geometry is displayed as a collection of points instead of polygons: http://dhs.stanford.edu/dh/geospat/points.PNG The query that produces this result is simply the previous table WHERE id = X, so it's not like I'm running anything that changes the way the geometry is being formatted. Thanks in advance for any suggestions, Elijah ************ Elijah Meeks http://dhs.stanford.edu Digital Humanities Specialist Academic Computing Services Stanford University [email protected] (650)387-6170 ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
