none
Recieving error when converting Geometric data to Geographic data

    Question

  • hi,

    I need to convert from Geometric data to Geographic datatypes, because I want to use the map (original shape file of the Netherlands) in an SSRS report with Bing layer. This requires the map to be of the Mercator type. (SRID 4326).

    I already have the shape data in a SQL table.

    Upon conversion I recieve the following error:

    Msg 6522, Level 16, State 1, Line 1
    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, Nullable`1 z, Nullable`1 m)
       at Microsoft.SqlServer.Types.Validator.BeginFigure(Double x, Double y, Nullable`1 z, Nullable`1 m)
       at Microsoft.SqlServer.Types.ForwardingGeoDataSink.BeginFigure(Double x, Double y, Nullable`1 z, Nullable`1 m)
       at Microsoft.SqlServer.Types.CoordinateReversingGeoDataSink.BeginFigure(Double x, Double y, Nullable`1 z, Nullable`1 m)
       at Microsoft.SqlServer.Types.WellKnownTextReader.ParseLineStringText()
       at Microsoft.SqlServer.Types.WellKnownTextReader.ParsePolygonText()
       at Microsoft.SqlServer.Types.WellKnownTextReader.ParseTaggedText(OpenGisType type)
       at Microsoft.SqlServer.Types.WellKnownTextReader.Read(OpenGisType type, Int32 srid)
       at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid)

    I've been going crazy on this and have already tried many suggestions like mentioned in : "Fixing Invalid Geography Data"

    Any suggestions are appreciated.

    thx.

    Dinand

    Thursday, February 09, 2012 10:11 PM

Answers

  • I'd say that error message is pretty descriptive - you're trying to supply geographic coordinate data where the latitude value exceeds 90 degrees. Either your data is dodgy or, what's more than likely, is that it isn't defined using SRID 4326 as you suggest it is.

    You said that the data was imported from a shapefile of the Netherlands? Did that shapefile come with an associated .PRJ file? If so, please paste the contents here - that will describe the correct reference system in which these coordinates are defined.


    twitter: @alastaira blog: http://alastaira.wordpress.com/

    • Proposed as answer by Peja Tao Friday, February 10, 2012 8:02 AM
    • Marked as answer by Peja Tao Monday, February 20, 2012 1:33 AM
    Thursday, February 09, 2012 11:10 PM
    Answerer

All replies

  • I'd say that error message is pretty descriptive - you're trying to supply geographic coordinate data where the latitude value exceeds 90 degrees. Either your data is dodgy or, what's more than likely, is that it isn't defined using SRID 4326 as you suggest it is.

    You said that the data was imported from a shapefile of the Netherlands? Did that shapefile come with an associated .PRJ file? If so, please paste the contents here - that will describe the correct reference system in which these coordinates are defined.


    twitter: @alastaira blog: http://alastaira.wordpress.com/

    • Proposed as answer by Peja Tao Friday, February 10, 2012 8:02 AM
    • Marked as answer by Peja Tao Monday, February 20, 2012 1:33 AM
    Thursday, February 09, 2012 11:10 PM
    Answerer
  • Hi Tanoshimi,

    Thanks for the reply. Yes it was converted using the wrong SRID.

    Also I went into another direction for what I was trying to achieve.

    grts,

    Dinand

    Sunday, April 22, 2012 10:05 AM