Skip to main content
Question

Get coordinates from tiled geometry?

  • December 13, 2018
  • 6 replies
  • 22 views

alanaliberti
Contributor
Forum|alt.badge.img+2

Hi FMErs

Is there a way to extract the bottom-left coordinates from an output geometry using the Tiler transformer?

The reason is that I'm tiling/filing a geometry (to CAD format) and would like to use the bottom-left coordinates as file names, like for example "x=12000 - y=3000.dwg".

Please let me know if you need me to elaborate or if it is not clear.

Many thanks

6 replies

david_r
Evangelist
  • December 13, 2018

Have you looked at the BoundsExtractor?


alanaliberti
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • December 13, 2018
david_r wrote:

Have you looked at the BoundsExtractor?

Thanks for super fast answer

It's not quite what I need to achieve I think, because I needed the full coordinates of the tile, regardless if it has geometry in it or not.

Like, if I'm tiling at 5000,5000 but my minimum x for geometry in this particular tile is 5123, I even though wanted my tile filename to be named "5000,5000"

Perhaps I should change my approach?


david_r
Evangelist
  • December 13, 2018

Personally I like to use the _column and _row attributes from the Tiler to fanout my tiles. But you could also use them to calculate the tile coordinates if you know the seed coordinates used by the Tiler.


alanaliberti
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • December 13, 2018
david_r wrote:

Personally I like to use the _column and _row attributes from the Tiler to fanout my tiles. But you could also use them to calculate the tile coordinates if you know the seed coordinates used by the Tiler.

Might be an idea, but in my case, even though I'm starting my seed at 0,0, the way it works it starts the tiling counting from the first geometry it finds in x,y, which in case are variable


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • December 13, 2018

You should be able to determine the theoretical bounds of your tile by using the the boundsExtractor as @david_r suggests and using an expression like

(floor(minX/tile_interval_x)*tile_interval_x)+seedX

For your data that would be

@Evaluate(@floor(@Value(_xmin)/5000)*5000)

@Evaluate(@floor(@Value(_ymin)/5000)*5000)


alanaliberti
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • December 13, 2018

That's pretty smart. Many thanks @david_r and @jdh :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings