0

I am writing a VBA code to resize my polygon, I get a input as vector points (Shapefile). The code below resizes it as according to my scale factor but my central latitude and longitude are also distorted. I want my new polygon to have the same central lat and long as of the original shapefile. As if its overlaid.

lVct = LBound(vct)
uVct = UBound(vct)

ScaleFactor = 0.59  
j = 0
i = 1
Set PPolygon = New Polygon
 For i = lVct To uVct
          vct(i).y = vct(i).y * ScaleFactor
          vct(i).x = vct(i).x * ScaleFactor
          PPolygon.addPairOfCoordinates vct(i).y, vct(i).x  'add coordinates into the new Polygons

  Next i

Describe if I have to use to some coordinate reference system or projections!!!

3

Copy the polygon.

Normalize the polygon by subtracting the center values from every point.

Scale the normalized polygon in the manner you describe.

Add the center values back to every point.

If the data is in lat/lon, you may get better results if you first project it (to any planar system you like) then scale as I've described then deproject.

0

You could use the ITransform2D interface, it has a scale method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.