in Education by
I am currently in the process of integrating Google Maps into one of our applications. One of the requirements is to store a user defined area into the database. To do this I have been using the Geography type in SQL Server 2008. While I have got it working for the most part I have come across a blocking issue. Below I have some example code. I am populating the Geography object with a GML XML string and some instances work and some don’t and I can’t see a logical reason why they don’t. DECLARE @geoWork GEOGRAPHY DECLARE @geoNotWork GEOGRAPHY DECLARE @Work NVARCHAR(MAX) DECLARE @DoesntWork NVARCHAR(MAX) SET @Work = '' + '' + '' + '' + '61.52269494598361 -6.50390625 50.84757295365389 -36.5625 32.69486597787505 -17.40234375 46.31658418182218 23.90625 61.52269494598361 -6.50390625' + '' + '' + '' + '' SET @DoesntWork = '' + '' + '' + '' + '51.8591074413996 -0.8425140380859375 51.790355567911845 -0.7051849365234375 51.75381501386028 -0.8191680908203125 51.80564283054998 -0.9180450439453125 51.8591074413996 -0.8425140380859375' + '' + '' + '' + '' SET @geoWork = GEOGRAPHY::GeomFromGml(@Work, 4326) SET @geoNotWork = GEOGRAPHY::GeomFromGml(@DoesntWork, 4326) SELECT @geoWork.AsGml() SELECT @geoNotWork.AsGml() The polygon that is working defines a huge area (spanning the size of several countries) whereas the one that doesn’t defines one about the size of a large town. It is only these “smaller” areas that are failing. Annoyingly this smaller one doesn’t go small enough for what I need it for. Can anyone tell me why this is happening? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
In your failing example, your data has the wrong orientation. In order to be able to track the inside and outside of polygons, the SQL geography type requires polygons to have the correct ring orientation. More about this, from which: In an ellipsoidal system, a polygon has no meaning, or is ambiguous, without an orientation. For example, does a ring around the equator describe the northern or southern hemisphere? If we use the geography data type to store the spatial instance, we must specify the orientation of the ring and accurately describe the location of the instance. The interior of the polygon in an ellipsoidal system is defined by the left-hand rule. How to fix it: "Fixing" Polygon Ring Orientation in SQL Server 2008 using T-SQL

Related questions

0 votes
    Let a(l), b(l) represent in input-output pairs, where l varies in natural range of no.s, then if ... heteroassociation (d) none of the mentioned Please answer the above question....
asked Sep 3, 2022 in Education by JackTerrance
0 votes
    Which annotation is used to represent command line input and assigned to correct data type? (a) @Input (b ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of the following ecological food chains does not represent an erect pyramid of numbers? (a) ... ,Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 8, 2021 in Education by JackTerrance
0 votes
    Which of this does not represent caching types_______________ (a)Server cache (b)Shared Cache (c)Distributed Cache (d)Local & Remote Cache (e) No Cache...
asked Oct 21, 2020 in Technology by Editorial Staff
0 votes
    Write a program in Java to input any age and determine whether the age is valid or  invalid. If age is ... is valid otherwise invalid. Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    I have an ArrayList of LongArrays, each of size 2. I am trying to use the built-in 'indexOf' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    If no header is specified, the block is said to be an _______________ PL/SQL block. (a) Strong (b ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    A memory byte location contains the pattern 00101100. What does this pattern represent when interpreted as a binary ... ASCII code? Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    What does LocalTime represent? (a) Date without time (b) Time without Date (c) Date and Time (d) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    What does the location property represent? (a) Current DOM object (b) Current URL (c) Both DOM ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What does the NamedNodeMap object represent in the HTML DOM? (a) Unordered collection of elements (b) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What does a Node object represent? (a) Single node (b) Set of nodes (c) Sequence of nodes (d) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    What does the status code 302 represent? 1. User can select among multiple links and go to different page. 2. ... available only by means of proxy address given in the response....
asked Jun 26, 2021 in Technology by JackTerrance
0 votes
    What does the following figure represent? a) Flight Management System b) Flight Data System c) Total autopilot system d) Flight Management Computer...
asked Dec 24, 2020 in Technology by JackTerrance
0 votes
    I have a webpage where Firefox 2 displays the font certain, really specific elements, larger than than what ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
...