Web AppBuilder (developer edition) 2.16 - which way to go in developing custom widget to display DWG file?

3282
11
Jump to solution
07-29-2020 06:03 AM
MichaelLev
Occasional Contributor III

I need to develop a custom widget for Web AppBuilder (developer edition) 2.16

in order to display a DWG file (2d or 3d) in 3D scene.

The DWG will always be in ITM coordinates (Israel TM grid, that is EPSG:2039) even if not specified.

The DWG contains Lines, Polygons and Points. Most of the time the other layers except lines will be empty.

What choice is more preferred/applicable -

1. Convert to 3 shape files (for lines, polygons and points) and display them?

2. Convert to KML and display it (is there a way to display 2d/3d KML?)?

3. Display the DWG directly (is a way to do it?) ?

I assume the only applicable way is 1, but I want to know more in order to be sure -

- Is conversion from DWG needed at all?

- Converting to KML is easy, but maybe KML 2D/3D could not be added to 3D scene?

- Or maybe there are more suitable ways to go by?

Help will be greatly appreciated.

Michael

11 Replies
MajdoleenO_A__Awadallah
Occasional Contributor III

Thank you Michael for your suggestion, I am working on the first approach you suggested,to add the shapfile to our cityworks map. I will update you once I finish it.

Thank you 

MichaelLev
Occasional Contributor III

Dear Majdoleen,

I got confused, and I'd appreciate it if you elaborate on the way you are going.

In addition, in case it could help - I elaborate here on my way: I have succeeded to accomplish my task, by developing 2 independent widgets in the Web AppBuilder -

  1. "Convert DWG" custom widget - Displays explorer dialog to choose DWG in the PC and then uses my Fme Cloud to convert from DWG into zipped shapefile which the user downloads to his PC.
    This widget code is based on FME web app code example FME Server Playground - Upload File In Session.
    Important: transformation from DWG to shapefile (translating coordinates from Israel TM into geographic coordinates) succeeded in FME Workbanch but failed in cloud (they had some bug in the the cloud linux). I opened question in FME cloud community and got necessary help from an FME expert 
  2. "Add Shapefile" custom widget - Displays explorer dialog to choose zipped shapefile in the PC, adding it to the 3D map.
    This widget is based on ESRI web app code example Create a FeatureLayer from a shapefile.

I had to split into 2 independent widgets, since

  1. Win10 disables any "communication" between my web app and the explorer "save file" dialog
    (I could possibly upload from FME zip url into my Amazon S3 cloud [complicated, have not tried such thing yet], and add to the map by specifying Amazon S3 url of zipped shapefile, but I failed in adding to the map by Amazon S3 url of the zip)
  2. It makes sense, since the 2nd widget could be used independently to add several existing zipped shapefiles to the 3D map.

I already saw that my task is not completed yet - I need additional development efforts in at least the next 2 areas:

  1. My current DWG is simple and includes only lines. Maybe I'll have to improve for more complicated DWG, especially if it has things beyond the 3 geometries (Points, Lines and Plolygons), especially colors.
  2. I'll have to continue to see that the final 3D map could be either saved with all the added data, and/or how can the user remove some of the added shapefiles, if he wants to.

Michael

0 Kudos