# ScaleDown method issue

**URL:** <https://community.thinkgeo.com/t/scaledown-method-issue/2207>\
**Category:** WinForms\
**Created:** [April 9, 2013, 3:12pm UTC](https://community.thinkgeo.com/t/scaledown-method-issue/2207 "2013-04-09T15:12:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergei](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@Sergei](https://community.thinkgeo.com/u/Sergei)\
**Post date:** [April 9, 2013, 3:12pm UTC](https://community.thinkgeo.com/t/scaledown-method-issue/2207/1 "2013-04-09T15:12:49Z")

</div>

Hi

I'm&nbsp;using&nbsp;ScaleDown&nbsp;method&nbsp;to&nbsp;decrease&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;polygon.

Somehow&nbsp;result&nbsp;is&nbsp;not&nbsp;as&nbsp;expected&nbsp;-&nbsp;not&nbsp;scaled&nbsp;properly.

The&nbsp;first&nbsp;polygon&nbsp;is&nbsp;approximately&nbsp;"OK"&nbsp;but&nbsp;the&nbsp;second&nbsp;polygon&nbsp;is&nbsp;not.

Is&nbsp;it&nbsp;possible&nbsp;to&nbsp;resolve&nbsp;scaling&nbsp;issue?

Before&nbsp;scale:

 ![](https://community.thinkgeo.com/uploads/default/original/1X/1debbcff0861434041f938841d4562b206d48562.png)

&nbsp;

After&nbsp;scale:

 ![](https://community.thinkgeo.com/uploads/default/original/1X/69d798bcf8c8ef15f609c8b6c7db72fecec1c035.png)

`Imports ThinkGeoImports ThinkGeo.MapSuiteImports ThinkGeo.MapSuite.CoreImports ThinkGeo.MapSuite.DesktopEditionPublic Class Form1  Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load    WinformsMap1.MapUnit = GeographyUnit.DecimalDegree    Dim wkt1 As String = "POLYGON ((-95.606609822483733 41.805456965812482, -95.6060583582148 41.805498126312159, -95.605589631712064 41.805498126312159, -95.605341418646276 41.805580313084647, -95.604872692143545 41.805621339357458, -95.603962758090347 41.805559799890034, -95.601701682666317 41.805456965812482, -95.595856089377776 41.805477479007095, -95.595856089377776 41.805847519775853, -95.595856089377776 41.80899210984353, -95.5965730289463 41.809012621990405, -95.600488497177139 41.809094938216731, -95.601536387111992 41.8090332680149, -95.604679697658867 41.809012621990405, -95.6050106480252 41.809012621990405, -95.60536911780946 41.808868769207038, -95.60561715089716 41.808889415347949, -95.6059205820784 41.8090332680149, -95.606637341668829 41.809362130356021, -95.606251352699474 41.809320972417481, -95.605727587593719 41.809115450247191, -95.605644850060344 41.809218144393526, -95.605782626196742 41.80952649388928, -95.605782626196742 41.809896377148107, -95.60561715089716 41.810512933996506, -95.605727587593719 41.81170500756707, -95.60561715089716 41.812280524987727, -95.605644850060344 41.812691548257135, -95.610166820930317 41.812629881547764, -95.610249558696523 41.812198212835938, -95.610139301745221 41.811622828710824, -95.610084083396941 41.811499493080191, -95.609753312775865 41.811581672169268, -95.609532619128 41.812198212835938, -95.609284406295046 41.812362703029066, -95.609119110740721 41.812259879894555, -95.608926116256043 41.811869365046732, -95.60889841732569 41.811622828710824, -95.609036373207346 41.811540649621747, -95.609201848506927 41.8117871863069, -95.609339624643326 41.811910521355458, -95.609477580524981 41.811602317495272, -95.609835870563984 41.811293978011236, -95.610056564211845 41.811108973575756, -95.610166820930317 41.810862434329465, -95.610166820930317 41.810307415784337, -95.610194340348244 41.809917023056187, -95.610249558696523 41.809567651711404, -95.6103047770448 41.809135962277651, -95.6102220392786 41.808663245639764, -95.610359815415 41.807861657231115, -95.610166820930317 41.80763561790809, -95.610139301745221 41.807327393442392, -95.610029044793919 41.807162890210748, -95.610029044793919 41.806895688991062, -95.609725613612682 41.806402442860417, -95.60895363567397 41.805744686163962, -95.608319433638826 41.805559799890034, -95.607547275722027 41.805477479007095, -95.606609822483733 41.805456965812482))"    Dim wkt2 As String = "POLYGON ((-95.6147164911963 41.805415805312805, -95.610966498148628 41.805456965812482, -95.610690766014159 41.805580313084647, -95.610883760498837 41.807532921317033, -95.61071828531567 41.808211171883158, -95.61077350366395 41.808950951672159, -95.610801022965461 41.809320972417481, -95.610828542150557 41.81010189675726, -95.610828542150557 41.810410242062062, -95.610690766014159 41.810697940178216, -95.610663246829063 41.811561160953715, -95.6111594926333 41.811622828710824, -95.611710956902243 41.81166385114193, -95.611655738553964 41.81166385114193, -95.611683437717147 41.812342058052309, -95.611710956902243 41.812691548257135, -95.615323173813522 41.812691548257135, -95.615405731601641 41.812362703029066, -95.615378212300129 41.8109856370138, -95.615350692998618 41.810430753626861, -95.615405731601641 41.810184211703017, -95.615323173813522 41.809074292192236, -95.615378212300129 41.806053052423522, -95.615405731601641 41.805744686163962, -95.615295474650338 41.805477479007095, -95.6147164911963 41.805415805312805))"    Dim bs1 As BaseShape = BaseShape.CreateShapeFromWellKnownData(wkt1)    Dim bs2 As BaseShape = BaseShape.CreateShapeFromWellKnownData(wkt2)    Dim imfl1 As New InMemoryFeatureLayer    With imfl1      With .ZoomLevelSet.ZoomLevel01        .DefaultAreaStyle = AreaStyles.Crop1        .ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20      End With      .InternalFeatures.Add(New Feature(bs1))      .InternalFeatures.Add(New Feature(bs2))    End With    imfl1.Open()    Dim bb As RectangleShape = imfl1.GetBoundingBox    imfl1.Close()    Dim bs3 As BaseShape = BaseShape.CreateShapeFromWellKnownData(wkt1)    Dim bs4 As BaseShape = BaseShape.CreateShapeFromWellKnownData(wkt2)    CType(bs3, AreaBaseShape).ScaleDown(25)    CType(bs4, AreaBaseShape).ScaleDown(25)    'CType(bs3, AreaBaseShape).ScaleTo(0.75)    'CType(bs4, AreaBaseShape).ScaleTo(0.75)    Dim imfl2 As New InMemoryFeatureLayer    With imfl2      With .ZoomLevelSet.ZoomLevel01        .DefaultAreaStyle = AreaStyles.State1        .ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20      End With      .InternalFeatures.Add(New Feature(bs3))      .InternalFeatures.Add(New Feature(bs4))    End With    Dim o As New LayerOverlay    o.Layers.Add(imfl1)    o.Layers.Add(imfl2)    WinformsMap1.Overlays.Add(o)    WinformsMap1.CurrentExtent = bb    WinformsMap1.Refresh()  End SubEnd Class`

&nbsp;

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [April 10, 2013, 1:46am UTC](https://community.thinkgeo.com/t/scaledown-method-issue/2207/2 "2013-04-10T01:46:10Z")

</div>

&nbsp;Hi&nbsp;Sergei,

Sorry&nbsp;that&nbsp;it&nbsp;confuses&nbsp;you&nbsp;here.&nbsp;Actually,&nbsp;the&nbsp;ScaleDown&nbsp;method&nbsp;takes&nbsp;the&nbsp;coordinate&nbsp;center&nbsp;which&nbsp;is&nbsp;caulated&nbsp;by&nbsp;sum(x)/(point&nbsp;count)&nbsp;and&nbsp;sum(y)/(point&nbsp;count)&nbsp;&nbsp;for&nbsp;doing&nbsp;scale&nbsp;down.&nbsp;It's&nbsp;not&nbsp;the&nbsp;geometric&nbsp;center&nbsp;of&nbsp;the&nbsp;shape,&nbsp;that's&nbsp;why&nbsp;the&nbsp;result&nbsp;is&nbsp;different&nbsp;from&nbsp;what&nbsp;you&nbsp;expected.&nbsp;For&nbsp;instance,&nbsp;the&nbsp;below&nbsp;screenshot&nbsp;show&nbsp;the&nbsp;average&nbsp;center&nbsp;point&nbsp;of&nbsp;the&nbsp;2&nbsp;shapes&nbsp;seperately.

 ![](https://community.thinkgeo.com/uploads/default/original/2X/9/955d2266313a54986a9fb3c9efb2e4e7a0ff0f1f.png)

&nbsp;

Best&nbsp;Regards,

Johnny

---

<div class="post-metadata">

**Author:** ![Sergei](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@Sergei](https://community.thinkgeo.com/u/Sergei)\
**Post date:** [April 10, 2013, 9:08am UTC](https://community.thinkgeo.com/t/scaledown-method-issue/2207/3 "2013-04-10T09:08:55Z")

</div>

Thank&nbsp;you&nbsp;Johnny.

I&nbsp;was&nbsp;expecting&nbsp;something&nbsp;like&nbsp;this:

 ![](https://community.thinkgeo.com/uploads/default/original/2X/5/510f1146f0ea54f536c9056a4a692eb9ad0cf4a1.png)

I&nbsp;used&nbsp;negative&nbsp;buffering&nbsp;sample&nbsp;approach&nbsp;to&nbsp;achieve&nbsp;this&nbsp;output.

Negative&nbsp;buffering&nbsp;will&nbsp;do&nbsp;the&nbsp;job.

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [April 11, 2013, 4:34am UTC](https://community.thinkgeo.com/t/scaledown-method-issue/2207/4 "2013-04-11T04:34:33Z")

</div>

Hi&nbsp;Sergei,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I’m&nbsp;glad&nbsp;it’s&nbsp;working&nbsp;for&nbsp;you,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;other&nbsp;questions.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
