Hi Hoa,
The Clipper can be used to clip the raster by the sqaure polygons. But you will have to create copies of the raster for each square since there are overlaps of some squares.
One possible way is:
(1) Set unique ID attribute to the sqaures. If they have unique attribute already, you can use that. Otherwise, use the Counter to add sequential number to them as temporary ID.
(2) Add a FeatureMerger; send the original raster to the Requestor port; send the squares to the Supplier port.
- Join On: Requestor 1, Supplier 1 (unconditional merging)
- Feature Merge Type: Attributes Only
- Process Duplicate Suppliers: Yes
- List Name: _list
(3) Connect a ListExploder to the Merged port of the FeatureMerger; set "_list{}" to the List Attribute parameter. The raster will be copied for each square, and the copied rasters have all attributes including the ID of square for each.
(4) Add a Clipper; send the original squares to the Clipper port; send the copied rasters to the Clippee port; set the ID attribute to the "Group By" parameter.
- Merge Attributes: Yes (Accumulation Mode: Merge Clipper)
Required clipped rasters will be output from the Inside port of the Clipper, each raster will have attributes of associated square (i.e. the clipper).
I think you can then draw a point and a text onto each raster.
Takashi
I fyour raster is big, you might consider to not copy it.
If you use the clippers on a single raster, you can create a list of the clipper id's on each clipped raster part.
Then create a comma separated string out of it.
By testing each id against the id-string you can construct the rasters for each box
Thank you Takashi and Gio. I export to .jpg file with name images.
No way to print label attributes images on each image like my target, right?
Because I have too many images, if I make to draw and label for each image, it lost many times.
Hi Takashi,
Thank you so much. I saw the VectorOnRasterOverlayer or the MapnikRasterizer to get only a raster image, right?
I cliped all part images . Then, I use MapnikRasterizer to make overlay image and point ?
Yes, you can use either of them to put the labels on your rasters.
I share a workspace (FME 2015.0) which illustrates basic usage of the MapnikRasterizer to draw a label text and a point marker onto a raster.
FYI. (
https://drive.google.com/file/d/0B0ufVP2t0eApNlNCaE03QjJSNlk/view?usp=sharing)
The transformer has many options/parameters, cannot explain all of them.
This article would be a good start point to learn more about the transformer.
FMEpedia - Introduction to MapnikRasterizer (
http://fmepedia.safe.com/articles/Samples_and_Demos/Introduction-to-MapnikRasterizer)
Thank you, Takashi and Gio.
I tried it with a raster image, It's ok. But I have many raster images and a point file (many point).
I see MapnikRasterizer get only point and only raster.
Could you tell me how to batch for many raster images?
Thank you
If you give a common attribute to the raster and associated point, you can set it to the "Group By" parameter of the MapnikRasterizer, so that the input features will be processed for each individual pair of raster and point.
The ID attribute which I mentioned in my first post can also be used as the common attribute for the grouping, if you have clipped the original raster by the procedure that I suggested.
Dear Takashi,
I made it as the image below but I still get error.
I don't know why
. Could you tell me why?
Thank you
How did you set "Group By" parameter of the Clipper?
I set "Group BY" parameter based on img_name
. Maybe, it does not run because that parameter?
The number of input polygons is 1076, but the number of clipped features is 1605.
It's strange.
Is "img_name" an attribute of the polygons?
Is "img_name" value unique for each polygon?
Anyway, first of all, check if the clipped features are created as expected.
I checked the model. I see mapnikRassterizer didn't get
img_name attribute.
So It can't run
.
Hi Takashi,
Img_name is like ID name for each polygon. It's value unique for each polygon
Looks like you forgot to set "img_name" to the "Group By" for the MapnikRasterizer.
And, why do you send polygons to the MapnikRasterizer? You will have to set Symbolizer appropriately for polygons, if you send the buffer polygons instead of the original points.
Usage of the MapnikRasterizer is not so simple. I would recommend you to learn the usage with simple exmaples. See the help of the transformer and this link. (
http://fmepedia.safe.com/articles/Samples_and_Demos/Introduction-to-MapnikRasterizer)
In addition, I can see a warning message (blue text) in the Log window.
Have you checked whether the clipped rasters have been created properly?
If every point is located at the center of the buffer polygon, you can transform each polygon into the original point using the CenterPointReplacer.
Oh, I mistake model. I put point file to send mapnikRasterizer and edit "Group by" for Mapnik.
I done it
. It's successful . Thank you so much, Takashi and Gio .
So great !