Solved

Export geodatabase features into individual tiles


Hi all,

 

I have been using a workbench to read in a geodatabase and clip the features to a particular extent then export out to a DWG. However the requirements have recently changed and we need to split the DWG output into multiple smaller files based on 1km tiles.

So here is what I am trying to do essentially. Take the geodatabase, use a grid to split the geodatabase features into individual tiles and save each tile as a seperate DWG. So NZ4920, NZ4921 etc.

I feel like this should be quite simple to do but I can't find how to do it. One long workaround would be to use the 'clipper' transformer for each individual tile, which would give me result I want but I would have to do this for about 100 tiles, and I am sure there is a more effecient way to do this.

 

Any help is appreciated

Thanks

Dan

icon

Best answer by ebygomm 7 February 2020, 13:22

View original

15 replies

Userlevel 2
Badge +12

For point features this is fairly straight forward:

Extract the geometry X and Y (CoordinateExtractor)

Round the X and Y to kilometers (AttributeRounder)

Create the NZ#### attribute using the X and Y.

And use the new attribute in the DWG Writers Fanout (see the Navigator window).

 

For non point features, you will need to decide if you want to use a Clipper or if the features need to be unclipped and overshoot the boundary.

 

Hope this helps.

For point features this is fairly straight forward:

Extract the geometry X and Y (CoordinateExtractor)

Round the X and Y to kilometers (AttributeRounder)

Create the NZ#### attribute using the X and Y.

And use the new attribute in the DWG Writers Fanout (see the Navigator window).

 

For non point features, you will need to decide if you want to use a Clipper or if the features need to be unclipped and overshoot the boundary.

 

Hope this helps.

Thanks for the response.

 

I should have said, it is line features I am trying to split.

Currently I am using the clipper, as I am reading in the line features, clipping it based on an individual tile, and writing it to a DWG. That works fine for the individual tile, but now I need to do this for 100+ tiles.

I have the dataset which contains each of these tiles, with each tile having their NZ reference in the attribute table. So I almost want to tell FME me to take the lines and put each line features into a seperate DWG based on the tile it is contained within.

I could just replicate the clipping method as above, but repeating the workflow for over a 100 tiles does not seem like the most effecient way.

Thanks

Dan

Badge +10

When you clip the features, you should be able to transfer the attribute from your clipper grid to the line features by ticking merge attributes. Each line will then have the attribute of the tile it was clipped by. You can then use this attribute to fanout the output to individual tiles (I'm assuming there are no overlapping tiles here)

When you clip the features, you should be able to transfer the attribute from your clipper grid to the line features by ticking merge attributes. Each line will then have the attribute of the tile it was clipped by. You can then use this attribute to fanout the output to individual tiles (I'm assuming there are no overlapping tiles here)

Thanks for the reply.

 

I have just tried enabling the merge attributes feature and ran the workbench again, after a bit of trial and error I got it working and now each line has the associated tile attribute associated with it.

I presume now it is best to use an attribute splitter to seperate these into individual files?

 

Thanks

Badge +10

Thanks for the reply.

 

I have just tried enabling the merge attributes feature and ran the workbench again, after a bit of trial and error I got it working and now each line has the associated tile attribute associated with it.

I presume now it is best to use an attribute splitter to seperate these into individual files?

 

Thanks

You should be able to fanout the DWG with the tilename. This needs to be done on the writer in the navigator.

You should be able to fanout the DWG with the tilename. This needs to be done on the writer in the navigator.

Fantastic - I didn't realise the fanout option was part of the writer/navigator. That's really helpful, thank you.

Userlevel 2
Badge +12

Thanks for the response.

 

I should have said, it is line features I am trying to split.

Currently I am using the clipper, as I am reading in the line features, clipping it based on an individual tile, and writing it to a DWG. That works fine for the individual tile, but now I need to do this for 100+ tiles.

I have the dataset which contains each of these tiles, with each tile having their NZ reference in the attribute table. So I almost want to tell FME me to take the lines and put each line features into a seperate DWG based on the tile it is contained within.

I could just replicate the clipping method as above, but repeating the workflow for over a 100 tiles does not seem like the most effecient way.

Thanks

Dan

You can do this in one go.

Just read all tiles in the workspace and use them as Clippers.

Read all lines and use them as Clippees.

Set the Clipper parameter to merge the tile name on the clipped lines.

Then use the Writer Fanout, using the tile name to write to multiple DWG files.

Hope this helps.

You can do this in one go.

Just read all tiles in the workspace and use them as Clippers.

Read all lines and use them as Clippees.

Set the Clipper parameter to merge the tile name on the clipped lines.

Then use the Writer Fanout, using the tile name to write to multiple DWG files.

Hope this helps.

Hello,

 

So this kind of worked, I brought in my geodatabase points and lines, clipped them using the clipper (tiles). Set the clipper parameter to merge attributes and then used the fanout expression for tile name.

This created individual files, but they arent in DWG format, just 'files', for example NZ4919. I changed one file to NZ4919.DWG and brought it into GIS, it looked like it opened ok as it brought in all the associated geometries, but it didn't actually display anything.

I used the same work bench again but this time used a shapefile writer instead, and that works as expected. It created individual tiles in shapefile format, not just a file. For some reason it doesn't like it when I fanout as DWG?

Any ideas please?

Thanks

Badge +10

Hello,

 

So this kind of worked, I brought in my geodatabase points and lines, clipped them using the clipper (tiles). Set the clipper parameter to merge attributes and then used the fanout expression for tile name.

This created individual files, but they arent in DWG format, just 'files', for example NZ4919. I changed one file to NZ4919.DWG and brought it into GIS, it looked like it opened ok as it brought in all the associated geometries, but it didn't actually display anything.

I used the same work bench again but this time used a shapefile writer instead, and that works as expected. It created individual tiles in shapefile format, not just a file. For some reason it doesn't like it when I fanout as DWG?

Any ideas please?

Thanks

You probably just need to add the file extension .DWG to the fanout
You probably just need to add the file extension .DWG to the fanout

I did try that previously as I noticed the screenshot posted above had '.dwg' included, but it just seemed to create a separate individual DWG file, didn't affect the fanout files. Will give that another go though.

You probably just need to add the file extension .DWG to the fanout

Just tried again, and yes it just seems to create a new DWG file but doesn't affect the fanout files. Screenshot below.

 

Badge +10

@dan_mbc

You need to set the fanout to the attribute value, so it should look like @Value(PLAN_NO).DWG

If you use the triangle to the right to go into the text editor, double click your fanout attribute then type .DWG

Badge +10

Just tried again, and yes it just seems to create a new DWG file but doesn't affect the fanout files. Screenshot below.

 

You need to set the fanout to the attribute value, so it should look like @Value(PLAN_NO).DWG

If you use the triangle to the right to go into the text editor, double click your fanout attribute then type .DWG

You need to set the fanout to the attribute value, so it should look like @Value(PLAN_NO).DWG

If you use the triangle to the right to go into the text editor, double click your fanout attribute then type .DWG

Thank you.

I originally pressed the triangle and used the dropdown menu to select my attribute... this seemed to work fine for the shapefile fanout.

But I have just done it by going into text editor as you suggested and that has worked. Thank you for your help, it's much appreciated.

Dan

@dan_mbc

You need to set the fanout to the attribute value, so it should look like @Value(PLAN_NO).DWG

If you use the triangle to the right to go into the text editor, double click your fanout attribute then type .DWG

Thank you, this worked. I previously just selected the attribute from the dropdown list, which did work when using fanout for shapefile, but it doesn't seem to work for DWG.

Thanks again, your help was much appreciated.

Dan

Reply