marcodelpin / cumberland

Automatically exported from code.google.com/p/cumberland
0 stars 0 forks source link

shp2sqlserver: loading a polygon as geography fails #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
error:

Unhandled Exception: System.Data.SqlClient.SqlException: A .NET Framework error
occurred during execution of user-defined routine or aggregate "geography":
Microsoft.SqlServer.Types.GLArgumentException: 24205: The specified input
does n
ot represent a valid geography instance because it exceeds a single hemisphere.
Each geography instance must fit inside a single hemisphere. A common
reason for
 this error is that a polygon has the wrong ring orientation.

Original issue reported on code.google.com by scott.el...@gmail.com on 9 Dec 2008 at 8:08

GoogleCodeExporter commented 9 years ago
Sql Server 2008 uses reverse ring order then shapefiles:

http://blogs.msdn.com/edkatibah/archive/2008/08/19/working-with-invalid-data-and
-the-sql-server-2008-geography-data-type-part-1b.aspx

It's only required on geography types but programmatically reverses geometries 
when
using OGC functions.  So reverse for all.  

Fixed in r262

Original comment by scott.el...@gmail.com on 13 Dec 2008 at 7:37