Question

How to write Raster-Files with a World-File using the FeatureWriter with Generic-Format

  • 29 March 2016
  • 4 replies
  • 19 views

Hello there!

I have tried to write several raster files (TIF, PNG, ..) using the FeatureWriter with the "Generic"-Format which works pretty well unless no WorldFile (tfw, wld, ...) is beeing created.

Is there a way to tell the Writer to create a world file for the raster files?

Thanks a lot! Regards Jacob

This was the configuration I used:


4 replies

Userlevel 2
Badge +17

Hi @jakobhagenauer, possibly a format attribute can be used to control world file creation.

If the destination format is JPEG, for example, add an attribute called "jpeg_world_file_generation" to the raster feature and set "yes" to its value. For the PNGRASTER format, the name is "pngraster_world_file_generation", and so on.

I think every raster format that supports world file has a similar format attribute. To know the attribute name, see the "Feature Representation" section in the help doc for each format. Then, you can add all of them to the raster feature beforehand, so that the FeatureWriter will write a world file for any possible format.

Hope this helps.

Userlevel 2
Badge +17

Hi @jakobhagenauer, possibly a format attribute can be used to control world file creation.

If the destination format is JPEG, for example, add an attribute called "jpeg_world_file_generation" to the raster feature and set "yes" to its value. For the PNGRASTER format, the name is "pngraster_world_file_generation", and so on.

I think every raster format that supports world file has a similar format attribute. To know the attribute name, see the "Feature Representation" section in the help doc for each format. Then, you can add all of them to the raster feature beforehand, so that the FeatureWriter will write a world file for any possible format.

Hope this helps.

It seems that the name of attribute that controls world file generation is "<lowercase format name>_world_file_generation". If it's correct, the BulkAttributeRenamer can be used to rename the format attribute depending on the specified format at run-time, like this. Assume that the destination format name is given via a user parameter called "FORMAT".

Userlevel 4
Badge +25

To set a parameter for a format used in the Generic Writer, you need to add a Writer of the same format. If you set the parameter there the Generic Writer will use it. It doesn't matter that no data is being written to that format.

I created a quick demo movie (http://screencast.com/t/tE6iqGYez2P)

Userlevel 1
Badge +22

Hi @jakobhagenauer, possibly a format attribute can be used to control world file creation.

If the destination format is JPEG, for example, add an attribute called "jpeg_world_file_generation" to the raster feature and set "yes" to its value. For the PNGRASTER format, the name is "pngraster_world_file_generation", and so on.

I think every raster format that supports world file has a similar format attribute. To know the attribute name, see the "Feature Representation" section in the help doc for each format. Then, you can add all of them to the raster feature beforehand, so that the FeatureWriter will write a world file for any possible format.

Hope this helps.

No, the possibility of writing a world file per raster is fixed per format. Some can, most cannot. The "Format Attributes" in FeatureWriter shows what is possible. I tried it with "ecw" and it didn't work, so alas, no hidden capability to conjure up.

Reply