Solved

Writing TMS Folders and Files

  • 9 November 2015
  • 4 replies
  • 15 views

Hi,

 

 

We are currently evaluating FME Desktop in the hopes that we replace MapTiler with FME and write tiles in the same folder and naming structure that is used by MapTiler.

 

 

We are attempting to use the WebMapTiler transformer and the raster PNG writer to write a folder and file structure that is compatible with TMS which is used by our tile server. The folder structure needs to be in the format of ../ZoomLevel/X/Y with Y being the actual file name. I've been able to use the dataset fanout to get the files into folders that match the zoom level but can't figure out how to get a second fanout to the X folder. Also, it looks like the file names may not be setup the way we need.

 

 

Has anyone done this before?

 

 

Thanks,

 

Mark
icon

Best answer by jdh 9 November 2015, 20:57

View original

4 replies

Badge +7
Hi Mark,

 

 

I've done this before using a StringConcatenator - if you build an attribute containing "{z}/{x}/", you can use that attribute as the dataset fanout instead of the individual values.

 

 

Could you send an example of the file names you're getting?

 

 

Hope this helps!

 

Roland.

 

Badge +22
I do this regularly to create Google Map compatible tiles.

 

 

On the WebMapTiler I have the output attributes set to _zoom, _x, _y.

 

Then a StringConcatenator _fanout : @Value(_zoom)\\@Value(_x)

 

The png feature type has the raster file name parameter set to _y

 

And the writer parameters are set to fanout on _fanout.

 

 

Tthis produces files in the structure of ..\\_zoom\\_x\\y.png
Roland, Jdh,

 

 

Thanks for the info! That got it working. To get the folder structure we used a string concatenator after the WebMapTiler using the format @Value(_zoom_level)/@Value(_tile_column)/. Inline after that we used an expression evaluator to flip the Y coordinate. The WebMapTiler was outputing the Y in Google format and we had to flip it to TMS format using the expression @pow(2.0,@Value(_zoom_level))-@Value(_tile_row)-1. Not sure if that's the easiest way, but it's working now.

 

 

Thanks!

 

Mark
@markatssi

Any chance you'd be willing to share your workspace? I'd like to create a TMS tilecache and serve it up in Leaflet. I've never used the WebMapTiler transformer so I was hoping you may be able to share what you have.

Thanks in advance!

-Jeff

Reply