<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal">i think this problem was solved already thousand times but i could not find a solution via google.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We have polygons in a postgis 2.1 db describing the satellite images which sometimes cross the antimeridan. These polygons shall be rendered to a map via WMS calls using google Mercator in the map client (or any other projection supported
by the WMS). The problem is that the polygons are drawn incorrect (see attached image which is the outcome of the following call
<o:p></o:p></p>
<p class="MsoNormal"><a href="http://db5.devel.intern/cgi-bin/catalog_view.fcgi?SERVICE=WMS&VERSION=1.1.1&REQUEST=getmap&layers=coveragepols_test&bbox=19068286.820724,-2282715.4123002,20749901.442696,-1809417.3332432&srs=epsg:3785&format=image/png&width=800&height=800">http://db5.devel.intern/cgi-bin/catalog_view.fcgi?SERVICE=WMS&VERSION=1.1.1&REQUEST=getmap&layers=coveragepols_test&bbox=19068286.820724,-2282715.4123002,20749901.442696,-1809417.3332432&srs=epsg:3785&format=image/png&width=800&height=800</a>)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any hint on documentation or how to overcome this problem is very welcome!<o:p></o:p></p>
<p class="MsoNormal">Kind regards,<o:p></o:p></p>
<p class="MsoNormal">Peter<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">These are the details: umn ms 6.4.1<o:p></o:p></p>
<p class="MsoNormal">## layer defintion <o:p></o:p></p>
<p class="MsoNormal"> LAYER<o:p></o:p></p>
<p class="MsoNormal"> NAME "coveragepols_test"<o:p></o:p></p>
<p class="MsoNormal"> TYPE POLYGON<o:p></o:p></p>
<p class="MsoNormal"> STATUS ON<o:p></o:p></p>
<p class="MsoNormal"> DEBUG 5<o:p></o:p></p>
<p class="MsoNormal"> UNITS dd<o:p></o:p></p>
<p class="MsoNormal"> SIZEUNITS PIXELS<o:p></o:p></p>
<p class="MsoNormal"> TOLERANCE 3<o:p></o:p></p>
<p class="MsoNormal"> TOLERANCEUNITS PIXELS<o:p></o:p></p>
<p class="MsoNormal"> PROCESSING "CLOSE_CONNECTION=DEFER"<o:p></o:p></p>
<p class="MsoNormal"> CONNECTIONTYPE POSTGIS<o:p></o:p></p>
<p class="MsoNormal"> CONNECTION"user=… password=…. dbname=… host='localhost' port=5432"<o:p></o:p></p>
<p class="MsoNormal"> DATA "coverage_poly FROM (SELECT id as image_id, coveragepoly as coverage_poly<o:p></o:p></p>
<p class="MsoNormal"> FROM public.view_test<o:p></o:p></p>
<p class="MsoNormal"> ) foo USING UNIQUE image_id USING SRID=4326"<o:p></o:p></p>
<p class="MsoNormal"> PROJECTION<o:p></o:p></p>
<p class="MsoNormal"> "init=epsg:4326"<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"> METADATA<o:p></o:p></p>
<p class="MsoNormal"> "ows_title" "Coverage Polygons"<o:p></o:p></p>
<p class="MsoNormal"> #"ows_extent" "-20037508.34 -20037508.34 20037508.34 20037508.34"<o:p></o:p></p>
<p class="MsoNormal"> "ows_extent" "-180 -89 180 89"<o:p></o:p></p>
<p class="MsoNormal"> "wms_srs" "EPSG:3875 EPSG:900913 EPSG:4326" #output<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"> CLASS<o:p></o:p></p>
<p class="MsoNormal"> NAME "Coverage Polygons"<o:p></o:p></p>
<p class="MsoNormal"> #STYLE<o:p></o:p></p>
<p class="MsoNormal"> # COLOR 231 182 21<o:p></o:p></p>
<p class="MsoNormal"> #END<o:p></o:p></p>
<p class="MsoNormal"> STYLE<o:p></o:p></p>
<p class="MsoNormal"> OUTLINECOLOR 10 255 0<o:p></o:p></p>
<p class="MsoNormal"> WIDTH 2<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">##used data<o:p></o:p></p>
<p class="MsoNormal">CREATE TABLE view_test<o:p></o:p></p>
<p class="MsoNormal">(<o:p></o:p></p>
<p class="MsoNormal"> id bigserial NOT NULL,<o:p></o:p></p>
<p class="MsoNormal"> catalog_id integer,<o:p></o:p></p>
<p class="MsoNormal"> dataset_id integer,<o:p></o:p></p>
<p class="MsoNormal"> image_path character varying(256) NOT NULL,<o:p></o:p></p>
<p class="MsoNormal"> coveragepoly geometry(MultiPolygon,4326),<o:p></o:p></p>
<p class="MsoNormal"> CONSTRAINT view_test_pkey PRIMARY KEY (id)<o:p></o:p></p>
<p class="MsoNormal">)<o:p></o:p></p>
<p class="MsoNormal">WITH (<o:p></o:p></p>
<p class="MsoNormal"> OIDS=FALSE<o:p></o:p></p>
<p class="MsoNormal">);<o:p></o:p></p>
<p class="MsoNormal">ALTER TABLE view_test<o:p></o:p></p>
<p class="MsoNormal"> OWNER TO searchdb_admin;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)<o:p></o:p></p>
<p class="MsoNormal">VALUES (15829509, 2061925, '', st_multi(st_geomfromtext('POLYGON((180.655999799 -15.8486300543,180.606999598 -16.0696710923,180.558000402 -16.2907050895,180.509000201 -16.5117270167,180.459000201 -16.7327328505,180.41 -16.9537185677,180.36
-17.1746801448,180.310999799 -17.3956135586,180.260999799 -17.6165178033,180.210999799 -17.8373888554,180.160999799 -18.0582267149,180.110999799 -18.2790293703,180.06 -18.4997958157,180.01 -18.7205260511,179.991351841 -18.8027016697,180.235999799 -18.8380677932,180.478000402
-18.8720267552,180.716999598 -18.9047223899,180.735999799 -18.8224783746,180.785 -18.6015670891,180.834000201 -18.3806216053,180.883000402 -18.1596439348,180.931999598 -17.9386350835,180.980999799 -17.7175950513,181.03 -17.4965258499,181.079000201 -17.2754304969,181.128000402
-17.054309998,181.175999799 -16.8331663649,181.225 -16.6120056327,181.273000402 -16.3908308187,181.321999598 -16.1696449407,181.37 -15.9484540334,181.134000201 -15.9164302957,180.896999598 -15.8832025749,180.655999799 -15.8486300543))',4326)));<o:p></o:p></p>
<p class="MsoNormal">INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)<o:p></o:p></p>
<p class="MsoNormal">VALUES (15836184, 2063096, '', st_multi(st_geomfromtext('POLYGON((179.545984711 -15.9171514786,179.495243412 -16.1403429893,179.444430698 -16.3635103601,179.39354657 -16.5866535908,179.342587005 -16.8097726816,179.291548984 -17.0328726614,179.240427479
-17.2559535305,179.189217461 -17.4790142828,179.137916918 -17.7020488835,179.086521827 -17.9250553209,179.035031181 -18.1480315832,178.983387648 -18.3712140414,179.243388654 -18.4105864011,179.497604104 -18.4480185073,179.746907061 -18.4837567894,179.797483404
-18.2603590827,179.847922953 -18.0371695836,179.898278012 -17.8139509153,179.948551599 -17.5907060954,179.998746731 -17.3674381412,180.049000201 -17.1441520821,180.099000201 -16.9208519413,180.149000201 -16.6975347013,180.199000201 -16.4741983504,180.249000201
-16.2508398713,180.298000402 -16.0274612754,180.053000402 -15.9924049487,179.802257091 -15.9557151479,179.545984711 -15.9171514786))',4326)));
<o:p></o:p></p>
<p class="MsoNormal">INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)<o:p></o:p></p>
<p class="MsoNormal">VALUES (17349264, 2322838, '', st_multi(st_geomfromtext('POLYGON((179.512290179 72.1542419267,179.144996874 71.9140629718,178.786510145 71.6732398732,178.436519681 71.431805025,178.09473374 71.1897945653,177.760579284 70.9470277758,178.409691839
70.8557411573,179.049974648 70.7633884077,179.683210657 70.6697257057,180.037 70.9090975825,180.398 71.1476343103,180.768 71.3855111027,181.146 71.6226895184,181.534 71.8591349187,180.869 71.9588213447,180.196 72.0571058194,179.512290179 72.1542419267))',4326)));<o:p></o:p></p>
<p class="MsoNormal">INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)<o:p></o:p></p>
<p class="MsoNormal">VALUES (17068914, 2257845, '', st_multi(st_geomfromtext('POLYGON((179.039884317 66.7567958853,178.848036178 66.5444771894,178.659274879 66.3319824792,178.473510114 66.1193169453,178.290653052 65.9064856728,178.110617892 65.6934935118,177.933322353
65.4803448547,177.758687153 65.2670434883,177.586635006 65.0535926383,177.417090186 64.8399952046,177.249979201 64.6262540807,177.085232004 64.4123723214,176.922783052 64.1983530566,176.762120618 63.9835922069,176.601173726 63.752017263,176.440226834 63.5204423192,176.279279942
63.2888673753,176.11833305 63.0572924315,175.957386158 62.8257174876,175.796439266 62.5941425438,175.635492375 62.3625675999,175.474545483 62.1309926561,175.313598591 61.8994177122,175.794181146 61.8349421828,176.269645981 61.7699080473,176.741344538 61.7041913201,176.91309487
61.9341579796,177.084845202 62.1641246391,177.256595534 62.3940912986,177.428345866 62.6240579581,177.600096198 62.8540246176,177.77184653 63.0839912771,177.943596862 63.3139579366,178.115347194 63.5439245961,178.287097526 63.7738912556,178.458501351 63.9870341862,178.631810997
64.1994137729,178.807570808 64.4116291457,178.98584849 64.6236763672,179.166716008 64.8355512763,179.350248692 65.047249762,179.536524184 65.2587677865,179.725621852 65.4701011843,179.917623217 65.6812454324,180.113 65.8921955223,180.311 66.1029459981,180.512
66.3134910974,180.716 66.5238248589,180.164 66.6023721443,179.605404276 66.6799870814,179.039884317 66.7567958853))',4326)));<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)<o:p></o:p></p>
<p class="MsoNormal">VALUES (15836249, 2063096, '/BrowseUDM/ams/2014/3/21/1395403157193100/324329_131001_browse.jpg', st_multi(st_geomfromtext('POLYGON((179.838948 -17.340608,179.835209 -17.557215,180.06104 -17.5607,180.064513 -17.344047,179.838948 -17.340608))',4326)));<o:p></o:p></p>
<p class="MsoNormal">INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)<o:p></o:p></p>
<p class="MsoNormal">VALUES (15836252, 2063096, '/BrowseUDM/ams/2014/3/21/1395403157193100/324329_6031228_browse.jpg', st_multi(st_geomfromtext('POLYGON((179.928689 -16.910725,179.932063 -17.127389,180.157366 -17.123996,180.153734 -16.907378,179.928689 -16.910725))',4326)));<o:p></o:p></p>
<p class="MsoNormal">INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)<o:p></o:p></p>
<p class="MsoNormal">VALUES (15836230, 2063096, '/BrowseUDM/ams/2014/3/21/1395403157193100/324329_6031528_browse.jpg', st_multi(st_geomfromtext('POLYGON((179.918861 -16.260704,179.922088 -16.477383,180.146628 -16.474126,180.143154 -16.257492,179.918861 -16.260704))',4326)));<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
BlackBridge AG | Sitz Berlin | Amtsgericht Charlottenburg - Registergericht | HRB 152785 | Aufsichtsratsvorsitzender: David Westwood | Vorstand: Ryan Johnson
</body>
</html>