I'm creating a SQLite Tilecache via the WebMapTiler, with PNG blobs, and would like to use PNG Optimization. This seems to be available in the PNGRaster writer, but I'm not using the PNGraster writer, I'm using the SQLite writer. So, is there any way I can pull that piece of code or is there another transformer I could use to do the same job of PNG Optimization?
Hi @erinjayaustin,
It might no be the most straight forward method, but you could write the rasters with the PNG writer via the FeatureWriter read them (FeatureReader) and write to the DB.
Hope this helps.
Hi @erinjayaustin,
If you are using the RasterExtractor to create the PNG blobs for SQLite, you can replace it with a combination of a FeatureWriter (to write out a PNG) and an AttributeFileReader (to read the PNG back into a blob attribute). This will allow you to control the optimization of the PNG files.
To avoid creating a lot of PNG files on your drive, you can reuse the same name for all the tiles (ie. temp.png). You can also use the TempPathnameCreator to create a temporary folder for your PNGs that will be automatically cleaned up when the workspace finishes.
This is essentially the same process the RasterExtractor uses, so it shouldn't affect the workspace performance at all.
Hi @erinjayaustin,
If you are using the RasterExtractor to create the PNG blobs for SQLite, you can replace it with a combination of a FeatureWriter (to write out a PNG) and an AttributeFileReader (to read the PNG back into a blob attribute). This will allow you to control the optimization of the PNG files.
To avoid creating a lot of PNG files on your drive, you can reuse the same name for all the tiles (ie. temp.png). You can also use the TempPathnameCreator to create a temporary folder for your PNGs that will be automatically cleaned up when the workspace finishes.
This is essentially the same process the RasterExtractor uses, so it shouldn't affect the workspace performance at all.
I have added the FeatureWriter & AttributeFileReader to the workspace, and used your advice with adding the TempPathnameCreator, but the AttributeFileReader is waiting for all the features to be written before reading anything, rather than reading them in as they are created. Any idea what I am doing wrong?
Workspace:
I have added the FeatureWriter & AttributeFileReader to the workspace, and used your advice with adding the TempPathnameCreator, but the AttributeFileReader is waiting for all the features to be written before reading anything, rather than reading them in as they are created. Any idea what I am doing wrong?
Workspace:
In the FeatureWriter, please set the Output Ports to One per Feature Type. This will add a second output port through which each raster can be output to the AttributeFileReader. The Summary output gives only a single feature for each run.
In the FeatureWriter, please set the Output Ports to One per Feature Type. This will add a second output port through which each raster can be output to the AttributeFileReader. The Summary output gives only a single feature for each run.