Skip to main content

Hey all,

 

I often receive multiple AutoCAD drawings which I need to convert to ArcGIS feature classes. I configured my reader as 'Single Merged Feature Type' to read all the features in one input port. At the end of my workflow I want to save the features by dividing them over the feature classes of the unique combination of autocad file name (fme_basename) and GIS geometry type.  I tried to use the geometryfilter to filter on point, line & polygon features followed by a string concatenator to then create a new attribute that contains the combination of fme_basename and geometry (point, line, polygon). I then tried to use a fanout by setting the feature class or table name in the writer to the created attribute and ticked the dynamic schema option and set the fme_feature_type as schema definition name. The result is however not completely what I wanted because I end up with for example different feature classes for arcs and lines while in arcgis these are both considered lines.

 

Example:

Consider I have 3 AutoCAD files (A, B, C)

I would like to end up with maximally the following feature classes in my esri geodatabase:

  • A_point
  • A_lines
  • A_polygons
  • B_point
  • B_lines
  • B_polygons
  • C_point
  • C_lines
  • C_polygons

If someone could help me I would be very thankfull :)

 

Thanks,

 

Valentin

Hi @valentinthonen 

 

The GeometryCoercer or the ArcStroker might work for this. 

If you can share your workspace with some sample data I can take a closer look. 

 

Crystal 


Hi @crystalatsafe,

I was enjoying some holidays so the reply is maybe a bit later than expected. 😅

Here is my slightly modified workspace in which I get the results I'm looking for. However there is some overlap in the string concatenator transformers which is in general considered a bad practice in IT. So if you would know how to fix this I would be glad to hear it. I was thinking about the geometryCoercer indeed but not sure about how to implement it.

 

See attachment for my workspace + sample data. 


Hi @valentinthonen 

 

I have attached two solutions that will eliminate the need for multiple StringConcatenator transformers in your workspace. I saved it as DWG_To_GIS_Fanout_solution.fmw in the same folder you attached. 

 

For the first workaround I added an attribute called layer in the AttributeCreator transformer using conditional values for point, line and polygon. I then placed the StringConcatenator before the GeometryFilter and added that type attribute to the concatenated result after the fme_basename. 

 

In the second workaround I added the layer attribute to the GeometryFilter transformer and was able to get rid of the StringConcatenator altogether. 

 

Please let me know if this is what you were looking for. 


Hi @crystalatsafe,

 

Thanks for your solution. Your solution is indeed cleaner in comparison to what I posted, but my main point of interest is if you can achieve the same with using only 1 writer instead of one per geometry type (point, line, polygon). Normally FME is smart enough to make a table for each geometry type when writing to a gdb. However when I want to also devide it by the layer attribute it does not work as I expected because I also get for example a table for the geometry type arc while I would only like the devision point, line, polygon.


Hi @valentinthonen 

 

I added an ArcStroker transformer to replaces arc geometry with interpolated straight line segments.

I also added a Dynamic Writer with a SchemaScanner transformer in order to use only one writer. 

 

Please let me know if this is the output you were looking for. 


Thank you a lot @crystalatsafe, this was indeed what I was searching for! :D


@valentinthonen 

That’s great! Happy to help! :) 


Reply