<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Show DGN/DWG/SHP file over the ArcGIS JS map viewer in ArcGIS Server with JavaScript API Questions</title>
    <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773158#M81</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A possible solution is to create a geoprocessing service &amp;nbsp;for upload and convert the files to features&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the following example used foe convert the DWG to features&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;import glob, zipfile, arcpy&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def dwgToFeatures(dwgFile):&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.AddMessage("dwgToFeatures")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.CADToGeodatabase_conversion(dwgFile, arcpy.env.scratchGDB, "DWGTestData_CADToGeodatabase", "204657", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 11258999068426,2;-1073,7418235 4194304001953,12;-100000 10000;8,98315284119522E-09;0,001;0,001;IsHighPrecision")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; return arcpy.env.scratchGDB + "/DWGTestData_CADToGeodatabase/Polygon"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def ProcessInput():&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; sourceDWGFile = arcpy.GetParameterAsText(0)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; outputFeatureClass = dwgToFeatures(sourceDWGFile)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.SetParameterAsText(1, outputFeatureClass)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ProcessInput()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;then on the Javascript application create the Upload Form&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sent the uploaded file on the geoprocessing service and get the result features (don't forget to enable the upload service on the geoprocessing service)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;you can add the result features on a graphic layer on the map and/or apply the geometries on a feature service in order to store on the geodatabase.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SAMPLE JS code to sent the file on the upload service&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;---------------------------------------------------------------------------------------------------&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;var requestHandle = esri.request({&lt;BR /&gt; url: "GEOPROCESSING SERVICE URL",&lt;BR /&gt; form: dojo.byId("uploadForm"),&lt;BR /&gt; content: { f: "json" },&lt;BR /&gt; handleAs: "json",&lt;BR /&gt; load: uploadSucceeded,&lt;BR /&gt; error: uploadFailed&lt;BR /&gt; });&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SAMPLE JS code to&amp;nbsp;sent the request on the geoprocessing service&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;---------------------------------------------------------------------------------------------------&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;function uploadSucceeded(response, io) {&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;......&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(filetype === 'dwg'){&lt;BR /&gt; var params= { "uploadDWGFile": "{'itemID':" + itemID + "}" };&lt;BR /&gt; gpTaskdwg.setOutSpatialReference({wkid:102100});&lt;BR /&gt; gpTaskdwg.execute(params, displayResult, errorGP); &lt;BR /&gt; }&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;....&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Apr 2017 07:35:25 GMT</pubDate>
    <dc:creator>PanagiotisPapadopoulos</dc:creator>
    <dc:date>2017-04-05T07:35:25Z</dc:date>
    <item>
      <title>Show DGN/DWG/SHP file over the ArcGIS JS map viewer</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773157#M80</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d;"&gt;We have an ArcGIS java script web application. We need to add a functionality to allow the user to upload the Drawing file (DGN/DWG/SHP) from the client browser and Zoom into the drawing file location and display the drawing as a map service. It should be on the fly and it should maintain the symbology.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;Any suggestions? &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 05:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773157#M80</guid>
      <dc:creator>SreejithSreenivasan</dc:creator>
      <dc:date>2017-04-05T05:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Show DGN/DWG/SHP file over the ArcGIS JS map viewer</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773158#M81</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A possible solution is to create a geoprocessing service &amp;nbsp;for upload and convert the files to features&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the following example used foe convert the DWG to features&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;import glob, zipfile, arcpy&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def dwgToFeatures(dwgFile):&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.AddMessage("dwgToFeatures")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.CADToGeodatabase_conversion(dwgFile, arcpy.env.scratchGDB, "DWGTestData_CADToGeodatabase", "204657", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 11258999068426,2;-1073,7418235 4194304001953,12;-100000 10000;8,98315284119522E-09;0,001;0,001;IsHighPrecision")&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; return arcpy.env.scratchGDB + "/DWGTestData_CADToGeodatabase/Polygon"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;def ProcessInput():&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; sourceDWGFile = arcpy.GetParameterAsText(0)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; outputFeatureClass = dwgToFeatures(sourceDWGFile)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt; arcpy.SetParameterAsText(1, outputFeatureClass)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ProcessInput()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;then on the Javascript application create the Upload Form&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sent the uploaded file on the geoprocessing service and get the result features (don't forget to enable the upload service on the geoprocessing service)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;you can add the result features on a graphic layer on the map and/or apply the geometries on a feature service in order to store on the geodatabase.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SAMPLE JS code to sent the file on the upload service&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;---------------------------------------------------------------------------------------------------&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;var requestHandle = esri.request({&lt;BR /&gt; url: "GEOPROCESSING SERVICE URL",&lt;BR /&gt; form: dojo.byId("uploadForm"),&lt;BR /&gt; content: { f: "json" },&lt;BR /&gt; handleAs: "json",&lt;BR /&gt; load: uploadSucceeded,&lt;BR /&gt; error: uploadFailed&lt;BR /&gt; });&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SAMPLE JS code to&amp;nbsp;sent the request on the geoprocessing service&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;---------------------------------------------------------------------------------------------------&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;function uploadSucceeded(response, io) {&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;......&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(filetype === 'dwg'){&lt;BR /&gt; var params= { "uploadDWGFile": "{'itemID':" + itemID + "}" };&lt;BR /&gt; gpTaskdwg.setOutSpatialReference({wkid:102100});&lt;BR /&gt; gpTaskdwg.execute(params, displayResult, errorGP); &lt;BR /&gt; }&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;....&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 07:35:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773158#M81</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2017-04-05T07:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Show DGN/DWG/SHP file over the ArcGIS JS map viewer</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773159#M82</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also the Web App Builder can use this Geoprocessing service creating the upload UI and the show results UI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 07:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773159#M82</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2017-04-05T07:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Show DGN/DWG/SHP file over the ArcGIS JS map viewer</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773160#M83</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you reply.Can we maintain the symbology once we have convert the file using GP.The drawing files have complex features and symbology.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 09:26:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773160#M83</guid>
      <dc:creator>SreejithSreenivasan</dc:creator>
      <dc:date>2017-04-05T09:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Show DGN/DWG/SHP file over the ArcGIS JS map viewer</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773161#M84</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;When publishing a geoprocessing service, you can choose to view the result of all tasks within the service as a map, see here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://server.arcgis.com/en/server/latest/publish-services/windows/geoprocessing-service-settings-parameters.htm" title="http://server.arcgis.com/en/server/latest/publish-services/windows/geoprocessing-service-settings-parameters.htm"&gt;Geoprocessing service settings: Parameters—Documentation | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative you can store the results on a feature class (apply edits) and use this feature class on a dynamic service (use complex symbology).&lt;/P&gt;&lt;P&gt;The results can be filtered (using definition query) base on a attribute you will calculate.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 10:20:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/show-dgn-dwg-shp-file-over-the-arcgis-js-map/m-p/773161#M84</guid>
      <dc:creator>PanagiotisPapadopoulos</dc:creator>
      <dc:date>2017-04-05T10:20:38Z</dc:date>
    </item>
  </channel>
</rss>

