Spot on, David!
Thank you for that - I didn't know about those functions but sure enough, I had 
336 invalid polygons and once fixed, GeoServer has no problem computing the 
bounds. Now I need to delve deeper into what is making them invalid, but at 
least I can go ahead on the GeoServer side.
Thanks once again,
Anne

Anne Brookes
Senior Analyst - GIS and System Development

From: David Collins [mailto:[email protected]]
Sent: 14 March 2011 22:31
To: Anne Brookes
Cc: [email protected]
Subject: Re: [Geoserver-users] publishing polygons from SQLServer 2008 
datastore - Error occured calculating bounds

Anne,

With your first link, the problem involves 'invalid' geometries.  If this is 
the case with you, then see how many records in your table have invalid 
geometries.

SELECT *
  FROM TABLE
  Where GEOMETRY_FIELD.STIsValid()=0

If you have invalid geometries, then you can 'fix' them with ..

Update TABLE
Set GEOMETRY_FIELD = GEOMETRY_FIELD.MakeValid()
Where GEOMETRY_FIELD.STIsValid()=0

The above method is probably a last resort because it changes the geometry 
value slightly - might be better to go back to the process that creates the 
geometries and fix the problem there.

Regards,
David


On Tue, Mar 15, 2011 at 2:33 AM, Anne Brookes 
<[email protected]<mailto:[email protected]>> 
wrote:
Hello,
I am getting this error
java.lang.RuntimeException: java.io.IOException: Error occured calculating 
bounds
     at 
org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:484)
     at 
org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:178)
     at 
org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:366)....
 etc

when I click on "Compute from data" when trying to publish a polygon layer from 
an SQLServer 2008 datastore.  I see that this was a known issue previously (see 
http://www.mail-archive.com/[email protected]/msg01379.html 
 and 
http://osgeo-org.1803224.n2.nabble.com/SQL-Server-2008-layers-td6100772.html) 
so I have just upgraded to the nightly latest version of GeoServer 
(geoserver-2.0.x-latest-bin.zip) and the SqlServer extension 
(gt-jdbc-sqlserver-2.6-SNAPSHOT.jar) but it does not seem to have made any 
difference.  I am also having to run with the sqljdbc.jar because sqljdbc4.jar 
causes GeoServer to give errors and crash when trying to make an SQLServer 
datastore.
I can successfully publish a point layer from my SQLServer database.

Could anyone suggest what I should try next, please?
Thank you,
Anne

Anne Brookes
Senior Analyst - GIS and System Development


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Geoserver-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to