c# - Edge with antipodal points exception with POLYGON 180-90 -


creating dbgeography text using dbgeography.fromtext(polygonastext, 4326); generates quoted exception. box dimensions have been provided google geocoding result suggested viewport dimension. coordinates dud? order used in construction of polygon wrong?

the latitude/longitude ordering has provided accurate results other coordinates, except one.

north east longitude: 180.0 north east latitude: 90.0

south west longitude: -180.0 south west latitude: -90.0

polygon((180 90, -180 90, -180 -90, 180 -90, 180 90)) 

the exception:

24206: specified input cannot accepted because contains edge antipodal points.

why don't these coordinates result in valid polygon?

there nice easy way address problem (assuming have sql server 2012 or onwards - john barca points out absolutely required build spatial object covering more half hemisphere).

try following:

// let's use nice , simple "fullglobe" statement create polygon covering earth sqlgeography geography = sqlgeography.stgeomfromtext("fullglobe", 4326); dbgeography dbgeography = dbgeography.fromtext(geography.tostring(), 4326); 

the conversion (second line) taken previous answer of mine on so here.


Comments

Popular posts from this blog

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

clojure - 'get' replacement that throws exception on not found? -