About 158,000 results
Open links in new tab
  1. python - How to scale polygon using shapely? - Stack Overflow

    Jun 28, 2022 · Scaling is an affine transformation, so you could use shapely.affinity.scale(). affinity.scale can only scale polygon in ratio, I want to scale it up at a fixed scalar. To make it a fixed scalar, just make the xfact and yfact arguments the same value. If your polygon is not convex, the scale method may not give you the desired output. For example:

  2. shapely.Polygon — Shapely 2.1.0 documentation - Read the Docs

    This method orders the coordinates, rings of a polygon and parts of multi geometries consistently. Typically useful for testing purposes (for example in combination with equals_exact). Examples >>>

  3. Scale polygons by a ratio using only a list of their vertices

    Jun 30, 2015 · In short, what you want to do involves more than just the scaling of the polygon given only a list of their vertices. They also need to be translated to be relative to the zoom boundingbox (which isn't part of their list of vertices).

  4. python - Scale polygon relative to the center - Stack Overflow

    May 27, 2022 · I have numpy array with coordinates of polygon. array([[726, 462], [724, 457], [723, 448], ... I have need to scale polygon relative to the center of polygon for draw in OpenCV.

  5. The Shapely User Manual — Shapely 2.1.0 documentation - Read …

    >>> triangle = Polygon ([(1, 1), (2, 3), (3, 1)]) >>> triangle_a = affinity. scale (triangle, xfact = 1.5, yfact =-1) >>> triangle_a. exterior. coords [:] [(0.5, 3.0), (2.0, 1.0), (3.5, 3.0), (0.5, 3.0)] >>> triangle_b = affinity. scale (triangle, xfact = 2, origin = (1, 1)) >>> triangle_b. exterior. coords [:] [(1.0, 1.0), (3.0, 3.0), (5.0, 1. ...

  6. Scales overview — Matplotlib 3.10.1 documentation

    Illustrate the scale transformations applied to axes, e.g. log, symlog, logit. See matplotlib.scale for a full list of built-in scales, and Custom scale for how to create your own scale.

  7. scale - Polygon scaling using arcpy - Geographic Information …

    Mar 15, 2016 · Is it possible to scale each polygon by a numeric value in an attribute table field using arcpy. I have updated the code from some previous excellent work done by Evil Genius

  8. python convex polygon scaling · GitHub

    import itertools as IT def scale_polygon (path, offset): center = centroid_of_polygon (path) for i in path: if i [0] > center [0]: i [0] += offset else: i [0] -= offset if i [1] > center [1]: i [1] += offset else: i [1] -= offset return path def area_of_polygon (x, y): """Calculates the signed area of an arbitrary polygon given its verticies ...

  9. python - Scaling rotated rectangle in Shapely - Geographic …

    Oct 17, 2022 · The idea is to rotate the polygon such that it is horizontal, then scale it on the y-axis, then rotate it back and if needed, correct the skewness. However, for example using a yfactor = 3 , xskew = -13 , and yskew = 0 , I get:

  10. Polygon resizing in ArcPy like Scale tool of Advanced Editing …

    scale_geom takes a single polygon and loops through each vertex, measuring the distance from it to a reference point (by default, the centroid of the polygon). That distance is then scaled by the scale given to create the new 'scaled' vertex.

Refresh