Skip to main content

I have a series of point, from each point, I would like to create a specific rectangle with height and width specified. The point provided are treated as centroid of the polygon (rectangle).

Or, even better, the polygon would be in a specified angle, but this is not required...

Is there a workflow for this process? Thanks!

Hi @gisluo, Thank you for posting this question.

Here is a idea to try (might not be the most elegant method):

 

1. Since the rectangle will be of the same shape and size, they are only different in their location (and angle), we can create a rectangle using a Creator transformer. Create this polygon, so it's center point is at 0,0.

2. Parallel to the Creator, read in the points, and extract the x y coordinates

3. Use a FeatureMerger to merge the points (Supplier) with the created polygon (Requester). Since we want to merge every point with the polygon, you can simply set the Join On values for Requestor and Supplier to both be 1. This will do a blind join of the two data stream. Also, Set Feature Merge Type to Attributes Only.

4. Now that the polygons has the x y coordinates of the points, we can use an Offsetter to move each polygon to the location of the points using the extracted X Y coordinate attribute. And if the points had an attribute with the angle, you can also use an Rotator to rotate it by the angle attribute.

Hope this helps.

Xiaomeng


Hi @gisluo, Thank you for posting this question.

Here is a idea to try (might not be the most elegant method):

 

1. Since the rectangle will be of the same shape and size, they are only different in their location (and angle), we can create a rectangle using a Creator transformer. Create this polygon, so it's center point is at 0,0.

2. Parallel to the Creator, read in the points, and extract the x y coordinates

3. Use a FeatureMerger to merge the points (Supplier) with the created polygon (Requester). Since we want to merge every point with the polygon, you can simply set the Join On values for Requestor and Supplier to both be 1. This will do a blind join of the two data stream. Also, Set Feature Merge Type to Attributes Only.

4. Now that the polygons has the x y coordinates of the points, we can use an Offsetter to move each polygon to the location of the points using the extracted X Y coordinate attribute. And if the points had an attribute with the angle, you can also use an Rotator to rotate it by the angle attribute.

Hope this helps.

Xiaomeng

Also, when creating the polygon in the Creator, consider set the coordinate system to be the same as the point coordinate system. Or, you can set the coordinate system, after merging, using a CoordinateSystemSetter.

 

 


Or you could create a rectangle for each point using the Bufferer transformer (buffer type square).

That would automatically have the point as center point.


I would add a point through the VertexCreator with width and height (for x and y respectively), then use a BoundingBoxReplacer and finally 'Offsetter' it by -width/2 and -height/2.


Or you could create a rectangle for each point using the Bufferer transformer (buffer type square).

That would automatically have the point as center point.

Oh, yeah, that's much simpler, Thanks, @erik_jan!

 

If the polygons are not squares, you can buffer by 1, and then use a Scaler to scale x y using the desired scale factor to create the rectangle that you need. (Note the Scale Origin should be Center Point)

 


I would use the CoordinateExtractor, 2DBoxReplacer, and Rotator. Assume the point has height, width, and rotation angle as its attributes, this screenshot illustrates my intention.

 


Reply