[mapserver-users] searching for a solution to render polygons crossing the antimeridan
Peter Freimuth
peter.freimuth at blackbridge.com
Mon Sep 1 06:49:38 PDT 2014
Hi,
i think this problem was solved already thousand times but i could not find a solution via google.
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
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)
Any hint on documentation or how to overcome this problem is very welcome!
Kind regards,
Peter
These are the details: umn ms 6.4.1
## layer defintion
LAYER
NAME "coveragepols_test"
TYPE POLYGON
STATUS ON
DEBUG 5
UNITS dd
SIZEUNITS PIXELS
TOLERANCE 3
TOLERANCEUNITS PIXELS
PROCESSING "CLOSE_CONNECTION=DEFER"
CONNECTIONTYPE POSTGIS
CONNECTION"user=... password=.... dbname=... host='localhost' port=5432"
DATA "coverage_poly FROM (SELECT id as image_id, coveragepoly as coverage_poly
FROM public.view_test
) foo USING UNIQUE image_id USING SRID=4326"
PROJECTION
"init=epsg:4326"
END
METADATA
"ows_title" "Coverage Polygons"
#"ows_extent" "-20037508.34 -20037508.34 20037508.34 20037508.34"
"ows_extent" "-180 -89 180 89"
"wms_srs" "EPSG:3875 EPSG:900913 EPSG:4326" #output
END
CLASS
NAME "Coverage Polygons"
#STYLE
# COLOR 231 182 21
#END
STYLE
OUTLINECOLOR 10 255 0
WIDTH 2
END
END
END
##used data
CREATE TABLE view_test
(
id bigserial NOT NULL,
catalog_id integer,
dataset_id integer,
image_path character varying(256) NOT NULL,
coveragepoly geometry(MultiPolygon,4326),
CONSTRAINT view_test_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE view_test
OWNER TO searchdb_admin;
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
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)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
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)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
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)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
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)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
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)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
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)));
INSERT INTO public.view_test (catalog_id,dataset_id,image_path,coveragepoly)
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)));
BlackBridge AG | Sitz Berlin | Amtsgericht Charlottenburg - Registergericht | HRB 152785 | Aufsichtsratsvorsitzender: David Westwood | Vorstand: Ryan Johnson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140901/59b77984/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: view_test.png
Type: image/png
Size: 6794 bytes
Desc: view_test.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140901/59b77984/attachment.png>
More information about the MapServer-users
mailing list