ThinkGeo.com    |     Documentation    |     Premium Support

Wrapping extent

Hello,
we are working on loading polygons on date line . we are getting different result if we change wrapping extent.

if wrapping extent
1)ALayerOverlayLoadEnc.WrappingExtent = new RectangleShape(-180, 90, 180, -90);

The output comes out to be as shown in attachment 2018_06_13_18_57_28_Connect_Order.png

2)ALayerOverlayLoadEnc.WrappingExtent = new RectangleShape(-360, 90, 360, -90);

The output comes out to be as shown in attachment 2018_06_13_19_00_57_Connect_Order_1.png

expected
The output that we getting extent new RectangleShape(-360, 90, 360, -90) we are excepting similar result for extent new RectangleShape(-180, 90, 180, -90) instead for this extent the polygons gets clipped.we want the polygon on each extent.

Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh,

Thanks for your information, it looks the API WrappingExtent just works like how it get designed.

When you set the WrappingExtent between -180 and 180, it will be wrap in that line, just like your image shows.

So if set the area to -360 to 360 it can touch your target, why you still want to make the -180 to 180 get the same result? That will broken how it should works.

Regards,

Ethan

Hello,
We want the same result so that we ca see the corresponding polygons on each extent i.e. 180 rather that after every 360

Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh,

I asked about our developer, it looks you should have a class from us named CustomFeature.

I tested the sample code like this:

        highlightLayer.WrappingMode = WrappingMode.WrapDateline;
        highlightLayer.WrappingExtent = new RectangleShape(-180, 90, 180, -90);

        CustomFeature cf = new CustomFeature(new RectangleShape(-160, 60, 160, 50));
        cf.WrapGeomotry();
        highlightLayer.InternalFeatures.Add(cf);

It looks the polygon cross wrapdateline works well.

So I think you should want to loop all your polygons and call WrapGeomotry for each of them, then they should works.

Regards,

Ethan

Hello,
We tried the above given code we were unable to to achieve the desired result .We have attached the polygon data in the given text file . please let us know if you can load those two polygon without clipping and with wrapping extent between -180 to 180.polygon.txt (975 Bytes)
Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh Konde,

Please view my result and see whether it’s what you want:

And here is the test code:

  PolygonShape poly1 = new PolygonShape("POLYGON ((-124.13314 55.49983, -124.1332 55.49983, -124.1332 60.33333, -116.33333 60.33333, -116.33333 18.75, -153.9941 18.75, -153.9941 18.8701, -153.41021 18.8701, -153.41021 19.15455, -152.04275 19.15455, -152.04275 20.75177, -151.15981 20.75177, -151.15981 21.5994, -150 21.5994, -150 30, -179 30, -179 28.85945, -179.00002 28.85451, -179.00007 28.83833, -178.99975 28.79628, -179 28.78846, -179 18.75, -180 18.75, -180 48.5, -161 48.5, -161 49.5, -157.6668 49.5, -157.6668 47.1667, -137.49983 47.1667, -137.49983 47.16665, -137.4999 47.16665, -137.4999 31.9999, -116.5001 31.9999, -116.5001 55.4999, -124.13314 55.4999, -124.13314 55.49983))");
        PolygonShape poly2 = new PolygonShape("POLYGON ((180 48.5, 180 25, 155.31734 25, 155.36723 25.05004, 155.74595 25.42996, 155.92059 25.60514, 155.98318 25.66794, 156.00022 25.68503, 156.09598 25.78109, 156.14967 25.83495, 156.18561 25.871, 156.23202 25.91756, 156.3142 26, 160 26, 160 46, 155 46, 155 50, 165.66667 50, 165.66667 48.5, 178.91874 48.5, 180 48.5))");


        CustomFeature f1 = new CustomFeature(poly1);
        f1.WrapGeomotry();

        CustomFeature f2 = new CustomFeature(poly2);
        f2.WrapGeomotry();
        
        highlightLayer.InternalFeatures.Add(f1);
        highlightLayer.InternalFeatures.Add(f2);

Regards,

Ethan

Hello,
We tried to load the two it worked fine but we try to load one polygon we got polygon which was clipped on side which lies on dateline.can you please try loading only one polygon .
PolygonShape poly2 = new PolygonShape(“POLYGON ((180 48.5, 180 25, 155.31734 25, 155.36723 25.05004, 155.74595 25.42996, 155.92059 25.60514, 155.98318 25.66794, 156.00022 25.68503, 156.09598 25.78109, 156.14967 25.83495, 156.18561 25.871, 156.23202 25.91756, 156.3142 26, 160 26, 160 46, 155 46, 155 50, 165.66667 50, 165.66667 48.5, 178.91874 48.5, 180 48.5))”);

                        CustomFeature f2 = new CustomFeature(poly2);
                        f2.WrapGeomotry();

Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh,

We cannot reproduce it, please try attached sample, and you should want to copy your CustomFeature.cs file into project and run it.

GettingStartedSample_20180620.zip (124.8 KB)

Regards,

Ethan

hello Ethan,
finally we came with the code that can help us. we have loaded the same polygon before the dateline.we found if we load polygon on immemory feature layer it gets sliced but if we load same polygon on trackshape layer it load as full polygon on date line. please find the above project given below.


Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh,

Our area style only have the outer pen, your edge line is just in the wrap line, so the line is drawn out of valid area.

We suggest you solve it like this:

  1. Make the wrap area a little bigger for example 180.1 etc.

  2. Set single tile mode for this layer.

Here is the sample from our developer

GettingStartedSample_20180627.zip (830.6 KB)

Regards,

Ethan

Hello Ethan,
We tried the do things according to the sample code.we got following exception after it.(we are also getting exception on refresh as well).<img


Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh,

I tried to download the sample in a clean VM machine, and run it. It looks everything goes well.

So please let us know have you did some change in code for the sample? Or please let us know what’s the steps to reproduce the exception.

Regards,

Ethan

Hello Ethan,
We sorted out the previous problem but the polygon after the dateline.if we use single tile.see the given image given below for refrence


for polygon data use the text file polygon.txt from above.
Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh,

Our developer tried to reproduce this problem by the shape you provided, but it looks works well.

Here is the sample, please modify it if you found we missed anything.

GettingStartedSample(1).zip (830.4 KB)

Regards,

Ethan