9 กุมภาพันธ์ 2555 22:11
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.
9 กุมภาพันธ์ 2555 23:10ผู้ตอบ
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/
22 เมษายน 2555 10:05
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.