Hi
I'm using ScaleDown method to decrease the size of the polygon.
Somehow result is not as expected - not scaled properly.
The first polygon is approximately "OK" but the second polygon is not.
Is it possible to resolve scaling issue?
Before scale:
After scale:
Imports ThinkGeo
Imports ThinkGeo.MapSuite
Imports ThinkGeo.MapSuite.Core
Imports ThinkGeo.MapSuite.DesktopEdition
Public 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 Sub
End Class