Skip to main content

In my work job, I need workspace in my cloud to be operated from my javascript web application, that converts standard Autodesk DWG files into shapefiles.

 

The DWG coordinate system of ALL the files I have to convert, is ALWAYS EPSG:2039, even if not explicitly specified,

and the coordinate system of the resulting shapefiles should be the SAME - EPSG:2039

 

Each DWG file contains DWG typical standard 5 layers - Annotation, Point, Polyline, Polygon, and Multipatch.

Attached are 5 files - The workspace, and typical actual 4 DWG files.

 

The DWG is displayed a little different by next ESRI desktops:

  1. By ArcMap (ArcGIS Desktop) I see the 5 layers as I describe them here - 5 layers, each with its specific attribute table. It's clear and simpls, so next description is when I see the DWG in ArcMap.
  2. By ArcGIS-Pro (and set coordinate system to "Israel TM Grid" that is EPSG:2039), then it presents the 5 DWG layers as 5 groups, where each group contains several "layers", where the "real" DWG 5 layers are the first layer in each group.

 

As can be seen, EACH one of the standard DWG layers has its standard attribute table with 9 or 10 fields, all of them standard DWG fields for each layer type:

 

  1. Annotation layer has next 9 fields - FID, Shape, Entity, Layer, Color, Elevation, RefName, Style, Text
  2. Point layer has next 10 fields - FID, Shape, Entity, Layer, Color, Linetype, Elevation, LineWt, RefName, Angle
  3. Polyline layer has next 9 fields - FID, Shape, Entity, Layer, Color, Linetype, Elevation, LineWt, RefName
  4. Polygon layer has next 9 fields - FID, Shape, Entity, Layer, Color, Linetype, Elevation, LineWt, RefName
  5. Multipatch layer has next 9 fields - FID, Shape, Entity, Layer, Color, Linetype, Elevation, LineWt, RefName

 

I assume the workspace could be designed in one of 2 ways:

  1. By 5 workspaces, each converting ONE of the 5 DWG layers to the proper zipped shapefile for this specific layer,
  2. By a single workspace that creates a single zip file containing all 5 shpefiles.

 

Notes -

  1. DWG "Annotation" layer will be a shapefile layer of type Point, but its data and its attribute table are different from DWG "Point" layer, so both should be converted to separate shapefiles.
  2. The DWG "Multipatch" layer is not important and could be skipped.

 

BUT, WHAT IS MOST IMPORTANT -

That each shapefile will contain its related attribute table with all the field names as were in the DWG and with all the values, exactly as were in the DWG.

 

Help will be appreciated, since I need this for my work job,

 

Michael

If you use the Generate Workspace option to set this up, do you get the shapefile the way you want it?


If you use the Generate Workspace option to set this up, do you get the shapefile the way you want it?

Dear @Hans van der Maarel​, thank you for referring immediately!

 I apologize, since I'm pretty new to all this matter, I don't understand what you mean by "Generate Workspace option"... All I know is that in all my trials to convert DWG to shapefile, the geometries have passed, but the attribute tables of the 5 layers have NEVER been passed into the shapefiles as the user expects.

I have examples (with coordinate conversion within, that I've got in the past from fme support, also now I don't need coordinate conversion). I again apologize for being newbie, and maybe I'm missing something that should be straightforward? Have you succeeded to convert the attached DWG files into shapefiles, keeping all attribute tables with all field names and field values, for each of the DWG 5 layers?

It should be "straight forward" - I expected I'll need only reader and writer, aince this is the "bread and butter" of fme workspaces, but, as I said, I have not succeeded, and i don't know what I'm missing.

I'll appreciate help.


Dear @Hans van der Maarel​, thank you for referring immediately!

 I apologize, since I'm pretty new to all this matter, I don't understand what you mean by "Generate Workspace option"... All I know is that in all my trials to convert DWG to shapefile, the geometries have passed, but the attribute tables of the 5 layers have NEVER been passed into the shapefiles as the user expects.

I have examples (with coordinate conversion within, that I've got in the past from fme support, also now I don't need coordinate conversion). I again apologize for being newbie, and maybe I'm missing something that should be straightforward? Have you succeeded to convert the attached DWG files into shapefiles, keeping all attribute tables with all field names and field values, for each of the DWG 5 layers?

It should be "straight forward" - I expected I'll need only reader and writer, aince this is the "bread and butter" of fme workspaces, but, as I said, I have not succeeded, and i don't know what I'm missing.

I'll appreciate help.

I'm trying now the "Generate workspace option". I'll inform after.

Michael


If you use the Generate Workspace option to set this up, do you get the shapefile the way you want it?

Dear @Hans van der Maarel​ ,

I tried Generate Workspace option,

but...

  1. It has not produced what a regular user expects - I expect only 5 layers, each with its attribute table, exactly as I elaborated that I see in ArcMap. I got many many layers and I get lost, and I seriously suspect that all the attribute tables data has been corrupted and maybe most of it is missing in the result shapefiles. So, the " Generate Workspace option" does NOT give correct results for DWG files - it produces much more than 5 layers, and though the geometry is presented OK to the user, but ALL THE ATTRIBUTE TABLE information is lost/corrupted and the user can't find his legs or hands in the result shapefiles. Is this a bug?
  2. Maybe I have not made it clear enough in my question, that I can't use Generate Workspace option, since my mission is to create workspace in cloud, that my web application will pass it a DWG file. So, the workspace should be able to operate on ANY dwg file, whilst "Generate Workspace option" operates on SPECIFIC dwg file.

I indeed hope you can help me in my challenge, and if there is indeed a bug in the handling of DWG files, what should I do?

Michael


Dear @Hans van der Maarel​ ,

I tried Generate Workspace option,

but...

  1. It has not produced what a regular user expects - I expect only 5 layers, each with its attribute table, exactly as I elaborated that I see in ArcMap. I got many many layers and I get lost, and I seriously suspect that all the attribute tables data has been corrupted and maybe most of it is missing in the result shapefiles. So, the " Generate Workspace option" does NOT give correct results for DWG files - it produces much more than 5 layers, and though the geometry is presented OK to the user, but ALL THE ATTRIBUTE TABLE information is lost/corrupted and the user can't find his legs or hands in the result shapefiles. Is this a bug?
  2. Maybe I have not made it clear enough in my question, that I can't use Generate Workspace option, since my mission is to create workspace in cloud, that my web application will pass it a DWG file. So, the workspace should be able to operate on ANY dwg file, whilst "Generate Workspace option" operates on SPECIFIC dwg file.

I indeed hope you can help me in my challenge, and if there is indeed a bug in the handling of DWG files, what should I do?

Michael

DWG is a complex format, when you use the Generate Workspace option check out the parameters setting on the DWG reader. It has an option to group by geometry rather than layer name, it sounds like that might be more what you need.

Also, a workspace will be suitable to work with any DWG file as long as it has the same structure. If you put in one with a completely different attribute structure it will not work of course.

I highly recommend that, if you haven't done so already, you go through the FME Desktop Basic and Advanced training courses that are offered online: https://www.safe.com/training/recorded/, they should give you a good background in FME. Especially the piece in the Advanced course on dynamic workspaces will be of use to you.


Dear @Hans van der Maarel​ , The workspace should be in cloud and be able to accept various DWG files from javascript code in my web app, though all of them would be with similar structure as elaborated in my question.

Thank you for your advice . I’ll follow and I‘ll try to get best results I could.

Michael


Reply