Spatial data type

I think I can't find my (obvious stupid) error :-).

Following the SELECT statement on the database:

SELECT geography::STMPolyFromText('MULTIPOLYGON( (((11.791039 47.5448077, 11.7910551 47.544757, 11.7911677 47.5446375, 11.7644687 47.542786))) )',4326)

      

And the error:

NET Framework error occurred during execution of user-defined routine or aggregate "geography": 
System.FormatException: 24141: A number is expected at position 26 of the input. The input has (11.791039.
System.FormatException: 
   at Microsoft.SqlServer.Types.WellKnownTextReader.RecognizeDouble()
   at Microsoft.SqlServer.Types.WellKnownTextReader.ParseLineStringText()

      

I can't find my mistake, maybe one of you will see the error ?!


Just found a solution: a '(' was too much.

+3


source to share


1 answer


I think you have too many pairs of parentheses after MULTIPOLYGON

... this example only shows 3 , but you have 4.

Try this instead:



SELECT geography::STMPolyFromText
(
    'MULTIPOLYGON
    ( 
        (
            (
                11.791039 47.5448077, 
                11.7910551 47.544757, 
                11.7911677 47.5446375, 
                11.7644687 47.542786
            )
        ) 
    )',4326
)

      

+1


source







All Articles