2

I'm more of an ArcGIS user than a SQL Server user but I have polygon data in a 'geography' type in SQL 2008 R2. For a couple of these poly layers, I get this persistent drawing error in ArcMap:

One or more layers failed to draw:

Cultural Resource Site Polygon: Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server]A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": System.FormatException: 24201: Latitude values must be between -90 and 90 degrees. System.FormatException: at Microsoft.SqlServer.Types.GeographyValidator.ValidatePoint(Double x, Double y, Nullable1 z, Nullable1 m) at Microsoft.SqlServer.Types.Validator.BeginFigure(Double x, Double y, Nullable1 z, Nullable1 m) at Microsoft.SqlServer.Typ] [db.layer]

I thought at first this might be related to other posts I've seen on incorrect ring orientation in polygons but those errors tend to say that the data exceeds a hemisphere. This error seems to suggest that I have vertices inside some of my polys that are perhaps backwards.

Unsure how to find them in SQL (any help would be great!), I turned to ArcMap and used the Feature Vertices to Points tool to create a set of points at every vertex of my polys. I then calculated X and Y on those points. I can't find any instance where my Y exceeds either 90 or -90.

Unsure at this point...

3
  • just for checking, but are you sure that you have a geographic coordinate system.?
    – radouxju
    Commented Feb 11, 2015 at 21:20
  • Yeah. I'm positive. It was all WGS84.
    – MattS
    Commented Feb 12, 2015 at 22:01
  • 1
    Do you have any that are listed as being at 90 or -90? It's possible that they're just slightly over--like 90.0000000000213 and that's what SQL Server is catching.
    – mkennedy
    Commented Apr 17, 2016 at 17:05

2 Answers 2

1

There's been a bug filed in Esri about this error message as:

Bug: Spatial query fails when features are stored in SQL Server Geography storage type and the filter shape is larger than one hemisphere

0

You could try one of the answers here https://stackoverflow.com/questions/28237265/getting-list-of-spatial-points-from-polygon-within-query to get all the points from your polygons and then add a where limit to find anything above or below +/-90.

Not really answer as you need 2008R2, but:

If you could import the data into a SQL 2012 or 2014 database (even Express would work) you could try to use MakeValid to 'fix' your polygons. If that helps you can save the new polygon back into your 2008R2 database.

Note that MakeValid (as MS puts it) "is not precise." It might make changes to your polygon, so I usually only use it for display purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.