I'm trying to link a GeoServer application to a SQL Server Spatial Database. The spatial data has been saved as Geography, but GeoServer can read only Geometry type.
So I'm using the following script to create an additional field of Geometry type:
UPDATE [dbo].[GeoBoundaries]
SET [GeoCoords] = geometry::STGeomFromWKB([SimplifiedCoords].STAsBinary(),[SimplifiedCoords].STSrid).MakeValid()
GO
The issue is with Russian Federation that has polygons crossing the 180 meridian.
The Geography data type is correctly shown:
instead, the Geometry data type has issues displaying the crossing meridian polygons:
Obviously Geoserver is not able to read the GeoCoords field even if it is a geometry field and raise an error:
java.lang.RuntimeException: java.io.IOException: Error occured calculating bounds for GeoBoundaries
...
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry":
How can I correctly convert geography to geometry to be used by Geoserver?
No comments:
Post a Comment