tag:blogger.com,1999:blog-61607046511889677402024-02-20T19:18:02.683-08:00GIS StudyGeoDatabase for all your GIS QueriesAnonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-6160704651188967740.post-58172300620164717572015-01-22T23:34:00.000-08:002015-01-22T23:34:52.172-08:00ArcFm Auto Updaters to Update the Shape Length of the Feature<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><span style="color: lime;">Schneider electric</span><br />
<span style="color: #3d85c6;"></span></span><br />
<h1>
<span style="font-size: large;"><span style="color: #3d85c6;">Update the Shape Length of the Poly line Feature</span></span></h1>
<h1>
<span style="color: #0b5394; font-size: x-large;">Special Auto Up-daters</span></h1>
A special Auto Up-daters differs from the attribute Auto Up-daters in that it is not associated with a field/event combination but rather a feature/event combination. A special Auto Up-daters can be associated to the On Feature Create, On Feature Update, or On Feature Delete events of a feature.<br />
<br />
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal">
Special Auto Up-daters are not limited to simple field updates like attribute Auto Up-daters. Rather, they can be written to perform a wide array of tasks such as writing out text files, updating records in a remote database, sending emails - just about anything that you would need to programmatically do in response to a feature/object.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: #0b5394; font-family: Segoe UI, Verdana, Arial;"><span style="font-size: 32px; line-height: 32px;">IMMSpecialAUStrategyEx Interface</span></span></div>
<div class="MsoNormal">
<span style="color: #0b5394; font-family: Segoe UI, Verdana, Arial;"><span style="font-size: 32px; line-height: 32px;"><br />
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC66lrYpLC0DbSeEzEm2UEBF464W8Z-0CWnwSyMVf_7URRqw6pozgKWSAsSmN1cAVKzAVean0OK7jOMB-QaQv-XrzCVdunZDMxZ1_HxAKw2b-__We5rHfabBOt-156nOu4Hv8G6HkKAMoI/s1600/ArcFm+AutoUpdaters.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC66lrYpLC0DbSeEzEm2UEBF464W8Z-0CWnwSyMVf_7URRqw6pozgKWSAsSmN1cAVKzAVean0OK7jOMB-QaQv-XrzCVdunZDMxZ1_HxAKw2b-__We5rHfabBOt-156nOu4Hv8G6HkKAMoI/s1600/ArcFm+AutoUpdaters.jpg" height="235" width="320" /></a></div>
<span style="color: #0b5394; font-family: Segoe UI, Verdana, Arial;"><span style="font-size: 32px; line-height: 32px;"><br /></span></span></div>
<div class="MsoNormal">
</div>
<ol style="text-align: left;">
<li style="text-align: justify;"><span style="line-height: 32px;"><span style="font-family: Arial, Helvetica, sans-serif;">Do the following steps to start with AutoUpdaters.</span></span></li>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 32px;">Start your Visual Studio 2010 or More</span><span style="line-height: 32px;"> </span></span></li>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 32px;">Create</span><span style="line-height: 32px;"> a New Project of Type base Command from ArcGIS tab .Choose the Programming Language of your comfort(VB or C#.Net)</span></span></li>
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">Give a Name to the Project and your can see base class library with your dll registered function with Unique Code GUID.</span></li>
</ol>
<ol style="text-align: left;">
<li style="text-align: justify;"><span style="font-family: Arial, Helvetica, sans-serif;">To get the Functionality of the Special AutoUpdaters in your code implement the Specific Interface ie. I<a href="http://resources.arcfmsolution.com/10.1/EngineSDK/Miner.Interop.Geodatabase~Miner.Interop.IMMSpecialAUStrategyEx.html" rel="nofollow" target="_blank">MMSpecialAUStrategyEx Interface</a></span></li>
</ol>
<div style="text-align: justify;">
<br /></div>
<br />
<div class="MsoNormal">
public class ShapeLengthAU : IMMSpecialAUStrategyEx</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
private string _name;</div>
<div class="MsoNormal">
//Name is a required parameter for the Implemented Interface</div>
<div class="MsoNormal">
public string Name</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
get</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
if (string.IsNullOrEmpty(_name))</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
_name =”Name of your Autoupdater</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
return _name;</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
public void Execute(IObject obj, mmAutoUpdaterMode eAUMode, mmEditEvent editEvent)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
IPCursor pCursor = null;</div>
<div class="MsoNormal">
try</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
//Autoupdater will update only when the EditEvent is of Type like FeatureCreate,FeatureSplit,FeatureUpdate</div>
<div class="MsoNormal">
if (editEvent == mmEditEvent.mmEventFeatureCreate || editEvent == mmEditEvent.mmEventFeatureSplit || editEvent == mmEditEvent.mmEventFeatureUpdate)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
IFeature pFeature = obj as IFeature;</div>
<div class="MsoNormal">
IPolyline pPolyLine = pFeature.Shape as IPolyline;</div>
<div class="MsoNormal">
double ftLength = pPolyLine.Length;</div>
<div class="MsoNormal">
//Place the length value in to the Pfeature respective field</div>
<div class="MsoNormal">
pFeature.set_Value(pFeature.Fields.FindField(“ShapeFieldName”), ftLength);</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
catch (Exception ex)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
MessageBox.Show(ex.Message);</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
finally</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
if (pCursor != null)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
//Use the Marshalling Method to release the Cursoer from the Memory</div>
<div class="MsoNormal">
Marshal.ReleaseComObject(pCursor); </div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
} </div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<span class="Apple-tab-span" style="white-space: pre;"> </span>//get_Enabled is a required Method for the Implemented Interface</div>
<div class="MsoNormal">
public bool get_Enabled(IObjectClass,pObjectClass, mmEditEvent eEvent)</div>
<div class="MsoNormal">
{</div>
<div class="MsoNormal">
return true;</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
}</div>
<div class="MsoNormal">
}</div>
<div>
<br /></div>
<div>
Now Compile the Code and Execute.</div>
<div>
Note:Set the Startup Project for Debugging as ArcCatalog.exe in the Project Properties.<br />
<br />
Go to Arc-Catalog , Right Click on your ArcFM feature and Select ArcFm Properties Mangaer<br />
<br />
Select the Object Tab.It will display the various event from the ArcFm for the Particular Object.</div>
<div>
Assign your Auto Updaters to the various event you want to call.<br />
<br />
Do the edit in the feature through ArcMap editor.This will trigger your Updaters.</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div>
<div class="MsoNormal">
<span style="color: #0b5394; font-family: Segoe UI, Verdana, Arial;"><span style="font-size: 32px; line-height: 32px;"><br />
</span></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-69681426282718674962015-01-15T09:49:00.000-08:002015-01-15T09:49:54.972-08:00Modifying the Vertices of a Polyline in ArcMap using ArcObjects<div dir="ltr" style="text-align: left;" trbidi="on">
<h1>
<span style="color: #93c47d;">Modifying the Vertices of a Polyline using ArcObjects </span></h1>
<br />
1.Start the Editing Mode in the Editor Toolbar<br />
<br />
2.This will create an edit session<br />
<br />
3.Using the editor tool select the polyline feature you want to edit<br />
<br />
4.Click on our Custom tool<br />
<br />
5.The vertices of our polyline will be visible<br />
<br />
6.Save the edits<br />
<br />
7.Stop editing and complete the session<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.IO;<br />
using ESRI.ArcGIS.ArcMapUI;<br />
using ESRI.ArcGIS.Framework;<br />
using ESRI.ArcGIS.esriSystem;<br />
using ESRI.ArcGIS.Editor;<br />
using ESRI.ArcGIS.Display;<br />
using ESRI.ArcGIS.Controls;<br />
using ESRI.ArcGIS.Carto;<br />
using ESRI.ArcGIS.Geodatabase;<br />
using ESRI.ArcGIS.Geometry;<br />
<br />
<br />
namespace ToolTest<br />
{<br />
public class poli : ESRI.ArcGIS.Desktop.AddIns.Tool<br />
{<br />
public static Boolean mousedown = false;<br />
public static IEditor3 meditor=null;<br />
IEditSketch3 editsketch = meditor as IEditSketch3;<br />
<br />
public poli()<br />
{<br />
}<br />
<br />
protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)<br />
{<br />
if (mousedown == false)<br />
{<br />
<br />
meditor = GetEditorFromArcMap(ArcMap.ThisApplication) as IEditor3;<br />
//IWorkspace workspace = (GetFeatureLayerFromLayerIndexNumber((ArcMap.Application.Document as IActiveView), 1).FeatureClass as IWorkspace);<br />
//if(meditor.EditState!=esriEditState.esriStateEditing)<br />
//meditor.StartEditing(workspace);<br />
<br />
<br />
<br />
<br />
<br />
<br />
IEditSketch3 editsketch = meditor as IEditSketch3;<br />
editsketch.GeometryType = esriGeometryType.esriGeometryPolyline;<br />
<br />
<br />
IEditTaskSearch editTaskSearch = meditor as IEditTaskSearch;<br />
IEditTask editTask = editTaskSearch.get_TaskByUniqueName("GarciaUI_ModifyFeatureTask");<br />
<br />
//Set the task returned to the current edit task.<br />
if (editTask != null)<br />
{<br />
meditor.CurrentTask = editTask;<br />
}<br />
ISketchOperation sk = new SketchOperationClass();<br />
sk.Start(meditor);<br />
<br />
<br />
<br />
<br />
}<br />
if(mousedown==true)<br />
{<br />
if(editsketch.Geometry==null)<br />
{<br />
IPolyline poly;<br />
poly = editsketch as IPolyline;<br />
editsketch.FinishSketch();<br />
<br />
}<br />
else<br />
{<br />
mousedown=false;<br />
}<br />
<br />
<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
<br />
protected override void OnMouseUp(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)<br />
{<br />
<br />
}<br />
<br />
public ESRI.ArcGIS.Editor.IEditor2 GetEditorFromArcMap(ESRI.ArcGIS.ArcMapUI.IMxApplication mxApplication)<br />
{<br />
if(mxApplication == null)<br />
{<br />
return null;<br />
}<br />
ESRI.ArcGIS.esriSystem.UID uid = new ESRI.ArcGIS.esriSystem.UIDClass();<br />
uid.Value = "{F8842F20-BB23-11D0-802B-0000F8037368}";<br />
ESRI.ArcGIS.Framework.IApplication application = mxApplication as ESRI.ArcGIS.Framework.IApplication; // Dynamic Cast<br />
ESRI.ArcGIS.esriSystem.IExtension extension = application.FindExtensionByCLSID(uid);<br />
ESRI.ArcGIS.Editor.IEditor2 editor2 = extension as ESRI.ArcGIS.Editor.IEditor2; // Dynamic Cast<br />
<br />
return editor2;<br />
}<br />
<br />
<br />
<br />
<br />
public ESRI.ArcGIS.Carto.IFeatureLayer GetFeatureLayerFromLayerIndexNumber(ESRI.ArcGIS.Carto.IActiveView activeView, System.Int32 layerIndex)<br />
{<br />
if (activeView == null || layerIndex < 0)<br />
{<br />
return null;<br />
}<br />
ESRI.ArcGIS.Carto.IMap map = activeView.FocusMap;<br />
if (layerIndex < map.LayerCount && map.get_Layer(layerIndex) is ESRI.ArcGIS.Carto.IFeatureLayer)<br />
{<br />
return (ESRI.ArcGIS.Carto.IFeatureLayer)activeView.FocusMap.get_Layer(layerIndex); // Explicit Cast<br />
}<br />
else<br />
{<br />
return null;<br />
}<br />
}<br />
public ESRI.ArcGIS.Geometry.IPointCollection4 modifyFirstVertexOfAPolyline<br />
(ESRI.ArcGIS.Geometry.IGeometryCollection geometryCollection_Polyline,<br />
System.Double searchRadius, System.Double offsetX, System.Double offsetY)<br />
{<br />
ESRI.ArcGIS.Geometry.IPolyline polyline = (ESRI.ArcGIS.Geometry.IPolyline)<br />
geometryCollection_Polyline;<br />
ESRI.ArcGIS.Geometry.IPoint queryPoint = polyline.FromPoint;<br />
<br />
ESRI.ArcGIS.Geometry.IPoint hitPoint = new ESRI.ArcGIS.Geometry.PointClass();<br />
<br />
//Define and initialize the variables that will get populated from the .HitTest() method.<br />
System.Double hitDistance = 0;<br />
System.Int32 hitPartIndex = 0;<br />
System.Int32 hitSegmentIndex = 0;<br />
System.Boolean rightSide = false;<br />
<br />
ESRI.ArcGIS.Geometry.IHitTest hitTest = (ESRI.ArcGIS.Geometry.IHitTest)<br />
geometryCollection_Polyline;<br />
System.Boolean foundGeometry = hitTest.HitTest(queryPoint, searchRadius,<br />
ESRI.ArcGIS.Geometry.esriGeometryHitPartType.esriGeometryPartVertex,<br />
hitPoint, ref hitDistance, ref hitPartIndex, ref hitSegmentIndex, ref<br />
rightSide);<br />
<br />
if (foundGeometry == true)<br />
{<br />
ESRI.ArcGIS.Geometry.IGeometry geometry =<br />
geometryCollection_Polyline.get_Geometry(hitPartIndex);<br />
ESRI.ArcGIS.Geometry.IPointCollection4 pointCollection =<br />
(ESRI.ArcGIS.Geometry.IPointCollection4)geometry;<br />
ESRI.ArcGIS.Geometry.IPoint transformPoint = pointCollection.get_Point<br />
(hitSegmentIndex);<br />
<br />
ESRI.ArcGIS.Geometry.ITransform2D transform2D =<br />
(ESRI.ArcGIS.Geometry.ITransform2D)transformPoint;<br />
transform2D.Move(offsetX, offsetY);<br />
<br />
ESRI.ArcGIS.Geometry.IPoint afterMovePoint = (ESRI.ArcGIS.Geometry.IPoint)<br />
transform2D;<br />
<br />
//The point is not updated in the polyline until the next line is called.<br />
pointCollection.UpdatePoint(hitSegmentIndex, (ESRI.ArcGIS.Geometry.IPoint)<br />
transform2D);<br />
<br />
return pointCollection;<br />
}<br />
<br />
return null;<br />
<br />
}<br />
<br />
protected override void OnUpdate()<br />
{<br />
Enabled = ArcMap.Application != null;<br />
}<br />
}<br />
<br />
}<br />
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-45347970018461792512014-12-24T04:24:00.000-08:002014-12-24T04:24:38.415-08:00ArcGIS Python Mapping Module<div dir="ltr" style="text-align: left;" trbidi="on">
<b></b><br />
<h1>
<span style="color: #3d85c6;">Arc Python</span><b><span style="color: #3d85c6;"> to interact with Arc-map</span></b></h1>
<h2 style="text-align: left;">
<b><span style="color: #e06666;">What is ArcPy Mapping and Why is it actually used for :</span></b></h2>
<h1 style="text-align: justify;">
<span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; line-height: 17.9200000762939px;">Arcpy.mapping was built for the professional GIS analyst (as well as for developers). Traditionally, the scenarios listed above had to be done using ArcObjects and it often proved to be a very difficult programming environment to learn for the average GIS professional. Arcpy.mapping is a courser-grained object model, meaning that the functions are designed in a way that a single arcpy.mapping function can replace many lines of ArcObjects code. The following is a very simple example of how arcpy.mapping can be used to reference an existing map document and export it to a PDF document with only two lines of code.</span></h1>
<div>
<span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; line-height: 17.9200000762939px;">To explore the Overall Arcpy mapping Module use the following PDF:</span><h3 style="text-align: left;">
<span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; line-height: 17.9200000762939px;"><a href="https://drive.google.com/open?id=0B-o9IVle6leoUFJYM1VfZUNpVnM&authuser=0" rel="nofollow" target="_blank"><span style="font-size: x-large;">Arcpy Python Mapping Module</span></a></span></h3>
</div>
<div>
<span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; line-height: 17.9200000762939px;"><br /></span></div>
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 13px; line-height: 17.9200000762939px;"><b>Code for Getting the reference to the MXD :</b></span></span></div>
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 13px; line-height: 17.9200000762939px;"><br />YourMXD= arcpy.mapping.MapDocument("path to the MXD")<br /><br /><b>To export the above MXD to PDF using arcpy:</b></span></span></div>
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 13px; line-height: 17.9200000762939px;"><b><br /></b></span></span></div>
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 13px; line-height: 17.9200000762939px;">arcpy.mapping.ExportToPdf(YourMXD,"your pdf file")</span></span></div>
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 13px; line-height: 17.9200000762939px;"><br /></span></span></div>
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 13px; line-height: 17.9200000762939px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij09E6KUI_v2iLdIjpxKBQqMs1JgwuSnxVp_tPny9IeHoOs4ulEqRn1ezRk5zIRrym879d1dUTiflVjlMINPcrln49XOgvVn9KKKPlXfep-7Na4CKRFTQdFiPKs7j6nSSVu5hPvzG1XCSK/s1600/Reference_MXD.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Get Reference to the Current Arcmap" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij09E6KUI_v2iLdIjpxKBQqMs1JgwuSnxVp_tPny9IeHoOs4ulEqRn1ezRk5zIRrym879d1dUTiflVjlMINPcrln49XOgvVn9KKKPlXfep-7Na4CKRFTQdFiPKs7j6nSSVu5hPvzG1XCSK/s1600/Reference_MXD.PNG" height="179" title="Python to Get Reference to the Current Arcmap" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Pointer to a MXD present on the Disk</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2ure3uvZ99gWq1rX8alC0UcT29sy5b-a-5GWcBFdXzK9wEg9HqnoVG1U6HWEooD4Kmmf0gs-9ss96cm304oFv44AGqCyb9CI8j37T3sftKea8bhx2xwJ_zHD_os4T6BOZlI_6qgeWz082/s1600/Arcpy_Mapping.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Map Layout Document in the Arc map" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2ure3uvZ99gWq1rX8alC0UcT29sy5b-a-5GWcBFdXzK9wEg9HqnoVG1U6HWEooD4Kmmf0gs-9ss96cm304oFv44AGqCyb9CI8j37T3sftKea8bhx2xwJ_zHD_os4T6BOZlI_6qgeWz082/s1600/Arcpy_Mapping.PNG" height="176" title="Map Layout Document in the Arc map" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Layout View of the Map Document</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17.9200000762939px; text-align: start;">Arcpy.mapping is not a replacement for ArcObjects but rather an alternative for the different scenarios it supports. ArcObjects is still necessary for finer-grain development and application customization, whereas arcpy.mapping is intended for automating the contents of existing map documents and layer files.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="background-color: white; font-size: 13px; line-height: 17.9200000762939px;"><br /></span></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-63073119975450060702014-12-24T00:45:00.000-08:002014-12-24T04:05:11.736-08:00Creating Geodatabases using Arcpy or Model builder<div dir="ltr" style="text-align: left;" trbidi="on">
<h1>
<span style="color: #3d85c6;">Creating Geo-databases in Arc Map</span></h1>
<div>
What is a Geodatabase:</div>
<div>
<ul style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif;">A</span><span style="background-color: white; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px;"> geodatabase is the common data storage and management framework for all the ArcGIS Products. It combines <b>Geo</b> (spatial data) with <b>Database</b> (data repository) to create a central data repository for all the spatial data storage and management in your ArcGIS platform.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">It can be leveraged in desktop, server, or mobile environments and allows you to store GIS data in a central location for easy access and management.</span></li>
</ul>
<div>
<div style="background-color: white; border: 0px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; outline: 0px; padding: 0px; vertical-align: baseline;">
The geodatabase offers you the ability to</div>
<ul class="singleline" style="background-color: white; border: 0px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; list-style: none outside none; margin: 10px 0px 10px -5px; outline: 0px; padding: 0px; vertical-align: baseline;">
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;"><span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Store</span> a rich collection of spatial data in a centralized location.</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;">Apply <span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">sophisticated rules and relationships</span> to the data.</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;">Define <span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">advanced geospatial relational models</span> (e.g., topologies, networks).</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;"><span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Maintain integrity</span> of spatial data with a consistent, accurate database.</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;">Work within a <span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">multiuser access and editing</span> environment.</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;"><span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Integrate spatial data</span> with other IT databases.</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;">Easily <span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">scale</span> your storage solution.</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;">Support <span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">custom features</span> and behavior.</li>
<li style="background: url(http://www.esri.com/graphics/bluebullet.gif) 0px 3px no-repeat scroll transparent; border: 0px; margin: 1px 0px; outline: 0px; padding: 0px 0px 0px 21px; vertical-align: baseline;"><span style="border: 0px; font-family: 'Avenir LT W01 85 Heavy', Arial, Helvetica, sans-serif; line-height: normal; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Leverage</span> your spatial data to its full potential.</li>
</ul>
<div>
<span style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 14px; line-height: 19px;">Arc-map geodatabase can be created using various way:</span></span><br />
<ol style="text-align: left;"><span style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;">
<li><span style="font-size: 14px; line-height: 19px;">Manually creating through Arc-Catalog</span></li>
<li><span style="font-size: 14px; line-height: 19px;">Using the Model workflow to create it Programmatic-ally</span></li>
<li><span style="font-size: 14px; line-height: 19px;">Using the Python integrated to Create Geodatabase </span><span style="font-size: 14px; line-height: 19px;">Programmatic</span></li>
</span></ol>
<span style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;">
</span></div>
</div>
</div>
<ol><span style="color: #4d4d4d; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: x-large;">
<li><b style="line-height: 19px;">Model for Creating Feature Class</b></li>
</span></ol>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoDUMEIH3pwVvl4t4ESAJx4SHcn7m8x_92psTVp5ZlFABWdRcmHmNadn2_TaLekhYP3bHEuNSeoRDo8ymcoqfgQX4E3LSywtO_eyGANZmRmRh_ZjOjY6RtrAsp9SiRz5kqdJ6uXO4TVF-H/s1600/Create+Geodatabases.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoDUMEIH3pwVvl4t4ESAJx4SHcn7m8x_92psTVp5ZlFABWdRcmHmNadn2_TaLekhYP3bHEuNSeoRDo8ymcoqfgQX4E3LSywtO_eyGANZmRmRh_ZjOjY6RtrAsp9SiRz5kqdJ6uXO4TVF-H/s1600/Create+Geodatabases.PNG" height="291" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Model to create Geodatabase in ArcGIS</td></tr>
</tbody></table>
Set the <b>workspace and OutputFC </b>as the Model parameter<br /><br />AddField will add a column to the newly created Feature class and can be populated with the user defined values<br /><br />The Search, Insert or Update cursor can be used to manipulate the values present in the new Feature class<br /><br />For achieving the above functionality it is advised to write a python code using the arcpy library.<br /><br />To know more detailed step by step information about the creating a feature class in the Geodatabase<br /><span style="font-size: x-large;">Click here - <a href="https://drive.google.com/open?id=0B-o9IVle6leodWd3bS1icXljS00&authuser=0" rel="nofollow" target="_blank">Create Geodatabase Feature Class - PDF</a></span><br /><br /><br /><div>
<br /></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-12287868224684892472014-12-24T00:21:00.000-08:002014-12-24T00:26:02.703-08:00Arcpy Improvements in 10.1<div dir="ltr" style="text-align: left;" trbidi="on">
<h1>
<span style="color: #3d85c6;">Arc Python in ArcGIS 10.1</span></h1>
<div>
<ol style="text-align: left;">
<li>Site package that adds ArcGIS functionality to Python</li>
<li>Access to rich suite of geoprocessing tools</li>
<li>Functions, classes and modules</li>
<li>Helper functions like ListFeatureClasses, Describe</li>
<li>Classes that can be used to create complex objects like Spatial Reference, Field Map</li>
<li>Modules that provide specialized functionality like Mapping,SpatialAnalyst, NetworkAnalyst, DataAccess</li>
</ol>
<div>
<br /></div>
</div>
<div>
Complete Introduction to Python concepts for beginners is available here<br />
<div style="text-align: center;">
<span style="font-size: large;"><a href="https://drive.google.com/open?id=0B-o9IVle6leoX3d1d2kyN25INEU&authuser=0" target="_blank">ArcPython a complete Overview</a></span></div>
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhStPgpxr1non6PpGpbcQIsIlFczCEYn8yEJTpNMsFKVaWORZWPCxmVFJ7yDVVFeSvs8tc6cFJo6sHdjovw-11CiJceyokv1rjQ3jzMQQZhn_bACsfqTUB5lfJ23ZpOyzrlXrwFo_79Pjs5/s1600/arc+python.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Python" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhStPgpxr1non6PpGpbcQIsIlFczCEYn8yEJTpNMsFKVaWORZWPCxmVFJ7yDVVFeSvs8tc6cFJo6sHdjovw-11CiJceyokv1rjQ3jzMQQZhn_bACsfqTUB5lfJ23ZpOyzrlXrwFo_79Pjs5/s1600/arc+python.jpg" height="186" title="Arc python" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ArcGIS + Python = ArcPython</td></tr>
</tbody></table>
<br /></div>
<div style="text-align: left;">
For more info and advance Concepts use the folowing references: </div>
<div style="text-align: left;">
<span style="color: #999999;"><br /></span></div>
<div style="text-align: left;">
<div>
<span style="color: #999999;">resources.ArcGIS.com</span></div>
<div>
<span style="color: #999999;">arcpy.wordpress.com</span></div>
<div>
<span style="color: #999999;">GIS Stack Exchange, Stack Overflow</span></div>
<div>
<span style="color: #999999;">Python References,Python Scripting for ArcGIS</span></div>
<div>
<span style="color: #999999;">GIS Tutorial for Python Scripting by Allen (Esri Press)</span></div>
<div>
<span style="color: #999999;">Learning Python by Lutz - The Python Standard Library</span></div>
<div>
<span style="color: #999999;">python.org</span></div>
<div>
<span style="color: #999999;">http://www.esri.com/training</span></div>
<div>
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-51170673139650137752014-12-24T00:10:00.002-08:002014-12-24T00:12:59.029-08:00Exporting the feature class to CSV Format<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h1>
<span style="color: #3d85c6;">Exporting Geodatabase toComma Separated Value Format</span></h1>
<div>
Let start creating an python addin for converting the feature class in your geodatabase to CSV format.So that everyone can understand your feature class and its values.<br />
<ul style="text-align: left;">
<li>If you are very new to python addin then go through- <a href="https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0CCoQFjAC&url=http%3A%2F%2Fresources.arcgis.com%2Fen%2Fhelp%2Fmain%2F10.1%2F014p%2F014p00000018000000.htm&ei=PnOaVPTIOdCFuwTBooHADw&usg=AFQjCNFHcZafOw5rNoMPOGRasxF0OR6aqg&bvm=bv.82001339,d.c2E" rel="nofollow" target="_blank">How to start with python addin</a> </li>
<li>The input feature class and output csv file path are hard coded in the sample program</li>
<li>For dynamic conversion get the path of the files through a variable and pass it as a parameter to the defined functions</li>
</ul>
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfGdvjD2n_pJK_4PUnkgYcYu2qKdd7U-34jzijVeX3FB7Nmw5YpE0QqwcZ1V9UuyE5rx0ceQhwdr9fO5vWLPSZVbRf8xIy5Om1UwUnExY_LmmlagVV-eY4Myf4ZUXnZIr6iYI9kEp4e4y/s1600/CSV.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Comma Seperated values" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfGdvjD2n_pJK_4PUnkgYcYu2qKdd7U-34jzijVeX3FB7Nmw5YpE0QqwcZ1V9UuyE5rx0ceQhwdr9fO5vWLPSZVbRf8xIy5Om1UwUnExY_LmmlagVV-eY4Myf4ZUXnZIr6iYI9kEp4e4y/s1600/CSV.png" height="320" title="Export feature class to csv" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">CSV Fromat</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="color: #3d85c6;"><br /></span></div>
<div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">def ex_fc_to_csv(fc, out_csv):<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> """<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> Export all vertex in a
line or poly feature class to a csv with OID<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> example<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> import geom_snippets<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> geom_snippets.ex_fc_to_csv(r"c:\proj\fc1.shp",
r"c:\proj\fc1.csv")<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> output csv looks like
this<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
1,56019.99998067904,69118.00001450378<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
1,56159.99998080942,69026.0000144181<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
1,56359.999980995686,68913.00001431286<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
2,34985.00002508866,68936.00001433428<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
2,35178.000025268404,68805.00001421227<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> """<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> import csv<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> import json<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> with open(out_csv, 'w')
as csvfile:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> csvwriter =
csv.writer(csvfile, delimiter=',', lineterminator='\n')<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> with
arcpy.da.SearchCursor(fc,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
field_names=("OID@","SHAPE@JSON")) as cursor:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> for row in
cursor:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> geom =
json.loads(row[1])<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> for path in
geom['paths']:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> for pt
in path:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;">
csvwriter.writerow([row[0]] + pt)<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-71971595136967635922014-12-15T09:04:00.000-08:002014-12-15T09:06:55.290-08:00Story Telling Maps - on ESRI News<div dir="ltr" style="text-align: left;" trbidi="on"><span style="color: #3d85c6;"><h1>James Douglas Skinner AirForce Navigator Story Maps</h1></span><span style="color: #3d85c6;"></span><br />
<h2 style="text-align: left;"><span style="color: #b4a7d6;"><a href="http://arcgis-content.maps.arcgis.com/apps/MapJournal/?appid=1ae674dcf9c2440197b36bff57718e08" rel="nofollow" target="_blank">Story Telling Maps</a></span></h2><div class="separator" style="clear: both; text-align: center;"><span style="font-size: xx-small;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiszKlid1WlD8MDDyIjvQ3dpx1foJjUPUsknp8llOIfhvP2WPR0PtpX0BENgosfo2amzK22nhnIzK4RH0hR2f01YfdFrsYKrIfsHnmqNhvCm5Xg9dFBD7VpgK-38VaujGZSOjqmXddlndIU/s1600/James+douglas.JPG" height="340" width="640" /></span></div><div><br />
</div><h2 style="text-align: left;"><br />
</h2><h2 style="text-align: left;"><br />
</h2></div>Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-77472236447266187552014-12-15T08:29:00.002-08:002014-12-15T08:34:18.735-08:00GIS for real life Applications and Intergating with GIS Devices<div dir="ltr" style="text-align: left;" trbidi="on">
<h1>
<span style="color: #3d85c6;">GIS Future Technologies</span></h1>
<h2>
Introduction</h2>
Global positioning system (GPS) technology has complimented geographic information systems (GISs) for a number of years and is now well understood and accepted by the GIS community. The primary focus of GPS within the GIS arena has traditionally been based around GPS systems that collect, store and transfer data from a field system to an office-based GIS. With current developments in field computers (especially related to lightweight and low cost devices that operate Microsoft's Windows CE operating system) there is a strong desire to take GIS directly into the field. This increased interest in field-GIS has a corresponding interest in the application of GPS within GIS.<br />
<h2>
GIS/GPS Integration Techniques</h2>
There are three basic ways that GPS technology can interact with or be integrated into GIS. The level of integration associated with these vary from a 'disparate' connection, whereby data is transferred between a GPS system and a GIS system, through to a very 'tight' level of integration, whereby GPS technology is totally embedded directly within GIS application software. GIS/GPS integration can be categorized into the following three categories:<br />
<ul>
<li>Data-focused integration </li>
<li>Position-focused integration </li>
<li>Technology-focused integration</li>
</ul>
The appropriateness of each method is dependent upon the requirements that a user has for field-based operations, the level of dependence the user has on GPS and, to a large extent, the availability of a complete system to meet the specific needs that the user has for a system. <br />
<h3>
Data-focused Integration</h3>
To date, the most common method of integrating GPS into GIS has been through a <i>data-focused</i> method of integration. (Although the term '<i>interaction</i>' is probably a more appropriate term than '<i>integration</i>'.) Data-focused integration, as depicted by Figure 1., utilizes a complete, self-contained GPS system that has data collection and storage capability for use in the field. Data that is collected in the field is later transferred to an office PC for processing and eventual export to an enterprise GIS that resides within an organization. Historically, data-focused systems have concentrated on a one-way data flow whereby data is transferred from the GPS product to the GIS database. GPS field products are now emerging, however, that allow data from the GIS to be uploaded as well, so existing data can be taken easily back to the field for data update and maintenance purposes. <br />
<img alt="Conceptual view of data-focused integration" src="http://proceedings.esri.com/library/userconf/proc00/professional/papers/PAP169/p1691.gif" height="271" width="539" /><br />
Figure 1. <u>Conceptual view of data-focused integration</u><br />
Self-contained GPS systems used in this manner are complete in themselves and generally developed by large GPS manufacturing organizations. The system consists of a GPS receiver, GPS antenna and a controlling device with data storage capability. Units can be either modular (as stylized in Figure 1.), fully integrated into one housing or a combination of the two. Historically, GPS systems have been rugged, to cater for harsh outdoor environments, with self-contained software that is optimized for limited storage, keyboards and screen real estate. These GPS systems are usually designed to meet the needs of most data collection or data maintenance professionals and are purchased as an off-the-shelf, turnkey system.<br />
The primary advantage of utilizing a data-focused approach to GIS/GPS integration is that an end-user can operate the GPS system "out of the box" with little or no need for customization. For many GPS users, an off-the-shelf system will cater for most, if not all, of their needs for data collection and maintenance. A perceived downside is that there's often more functionality in the system than required, but the cost associated with a complete system is generally less expensive than costs associated with building a customized solution that is restricted to a specific application.<br />
An example of a data-focused solution is Trimble Navigation's GeoExplorer® 3, for data collection and update, with GPS Pathfinder® Office, for data transfer and processing, and Esri's ArcInfo or ArcView products, for spatial analysis, query and archive.<br />
<h3>
Position-focused Integration</h3>
Position-focused integration is, historically, the most common approach to GPS integration (as opposed to interaction). As depicted in Figures 2a. and 2b., position-focused integration generally consists of a complete GPS system supplying a separate field application with GPS derived data that is related solely to the computation of positions. Data from the GPS is commonly transmitted to the field device using the NMEA-0183 protocol, although this is not the only protocol used. NMEA-0183 is a strictly defined ASCII-based format that consists of several messages, which contain data that's packaged and sent to an external device. Data from the field device may be transferred to and from the enterprise GIS. This is not imperative however, as the field application may be a self contained GIS in its own right.<br />
<img alt="Conceptual representation of position-focused integration using two field devices" src="http://proceedings.esri.com/library/userconf/proc00/professional/papers/PAP169/p1692.gif" height="313" width="573" /><br />
Figure 2a. <u>Conceptual representation of position-focused integration using two field devices</u><br />
Figure 2a. presents a good perspective on the components associated with position-focused integration. Position-focused integration essentially uses a GPS system, which could be the same as that used in data-focused integration, to provide data directly into an application running on the field device. In effect, the GPS system is treated as an external sensor by the application on the field device. The field device will usually provide data storage.<br />
<img alt="Conceptual representation of position-focused integration using a single field device" src="http://proceedings.esri.com/library/userconf/proc00/professional/papers/PAP169/p1693.gif" height="257" width="545" /><br />
Figure 2b. <u>Conceptual representation of position-focused integration using a single field device</u><br />
With the advances in handheld field devices, it is becoming more common to find both the GPS control application and the field device application operating on the same device, as depicted in Figure 2b. It’s important to note though that the applications will be operated totally separate to one another. In general, one application is used to configure the GPS receiver and control the provision of position related data, while another application is used to store and use the data that is being sent to it. It's important to note that the data storage application has little or no control over the operation of the GPS equipment. <br />
While systems that make use of position-focused integration can become cumbersome, from an equipment and ease of use perspective, and expensive they are very useful when GPS positioning is required on an infrequent basis. An organization, for example, may already have a complete GPS system for data collection purposes but may have another application that can make use of GPS from time to time. The ability to utilize the GPS system when GPS is useful makes good economic sense. The downside of losing a tight integration with the GPS receiver or carrying a cumbersome system may be an acceptable alternative to the expense required to fully customize a system.<br />
An example of position-focused integration is seen through the use of Trimble Navigation's GPS Pathfinder Controller software to setup a GPS Pathfinder XRS receiver for use with Esri's ArcPad field-GIS product. While ArcPad is actually able to power on and connect to a GPS Pathfinder XRS receiver directly, it has not been designed to configure the GPS receiver directly. The Pathfinder Controller software acts as the controlling device for the GPS receiver, while ArcPad provides an interface that is designed well for image display and spatial query.<br />
<h3>
Technology-focused Integration</h3>
Technology-focused integration is a refinement of position-focused integration. As Figure 3 illustrates, control of the GPS hardware is achieved directly from a third party application, thus eliminating the need for a separate application or device to control the GPS receiver. Communication between the application and the GPS receiver has a two-way communication flow - as compared to the one-way flow associated with the secondary application and the GPS system in the position-focused approach. As with position-focused integration, it is optional for data to be transferred between the field device and the enterprise GIS. The transfer of data is dependant on the capabilities of the application on the field device.<br />
<img alt="Conceptual representation of technology-focused integration" src="http://proceedings.esri.com/library/userconf/proc00/professional/papers/PAP169/p1694.gif" height="257" width="545" /><br />
Figure 3. <u>Conceptual representation of technology-focused integration</u><br />
This ability for a customized application to communicate directly with the GPS receiver enables GPS and GIS technologies to truly be integrated together in a seamless manner. In fact, the GPS technology is able to be totally embedded within a GIS application system to an extent that an end-user of the system will think that technologies from two different organizations actually came from one single source. Thus making a technology-focused application very similar to a data-focused system. The advantage though is that the full power of the GIS can also be taken directly into the field. The user-interface and functionality of the application can be totally designed around the needs of the user - resulting in powerful spatial analysis systems that are familiar and easy to use for the person who is going to use it most.<br />
The reason that GPS receivers can be so tightly integrated is not new, but the current state of software technology has made a technology-focused integration approach more readily accessible to more people. Technology-focused integration requires a developer to be able to create programs using the raw (often proprietary) language (or protocol) of the GPS receiver. Proprietary protocols are generally in a binary format and can be very complex and complicated - at least for those who are not expert programmers. This has often meant that the development of customized GPS-based applications has been a costly exercise.<br />
Now, however, through the use of component technologies (such as ActiveX components), it's significantly easier to integrate GIS and GPS components within the same programming code - or application. Software development products are emerging from within the GPS industry that takes the complex, but powerful, proprietary protocol of the GPS receiver and makes it simple to use and understand by '<i>wrapping</i>' an ActiveX application programming interface (API) around the proprietary protocol. ActiveX components follow clearly defined rules for interacting with applications. Such standardized interaction allows the same control to be used in several different contexts. The applications are typically developed within Microsoft's Visual Basic, Visual C++ or VBA development environments, but ActiveX controls also operate in additional development environments.<br />
As with the GPS industry, components are also available from GIS vendors, such as Esri's MapObjects ActiveX product. Because GPS and GIS ActiveX components adhere to a standard and commonly used API structure, the power that was once restricted to the large companies that develop GIS and GPS products is now readily available to all, enabling unique and powerful, user-specific solutions to be easily created.<br />
The most significant advantage of a technology-focused integration approach is the flexibility it offers for both end-users and application developers alike. Although ActiveX has made it easy to develop applications using proprietary protocols, the programmer time required to develop customized applications can still make it prohibitively expensive. For that reason, technology-focused integration is best suited to very simple applications or applications that are complex in nature and cannot be catered for by an off-the-shelf system. For the majority of GIS professionals who make use of GPS, therefore, a data-focused integration approach often provides the most economical solution.<br />
ActiveX components also exist for position-focused integration techniques, so it’s important to look closely at the component to ensure it provides the level of functionality that you expect. When looking for an appropriate GPS-based ActiveX component it's important to consider:<br />
<ul>
<li>The level of control offered over the GPS receiver's settings and status messages; </li>
<li>The level of flexibility associated with the computation of positions and their associated levels of accuracy; and </li>
<li>The provision of adequate information that provides confidence in the quality and use of the positions that are being supplied.</li>
</ul>
An example of technology-focused integration is the use of Trimble Navigation's Pathfinder Tools™ software development kit to integrate a GPS Pathfinder XRS receiver within a customized application that uses Esri's MapObjects product to visually display a map and carry out spatial analysis directly on a pen-based field computer.<br />
<h2>
Conclusion</h2>
<u></u><u></u><u></u><u></u><br />
There are numerous ways that GIS and GPS technology can (and already do) work well together. From complete off-the-shelf data collection and data maintenance systems, to help with the management of spatial features and attribute data, through to very flexible software development kits, to assist in the creation of unique and sophisticated field applications. The use of GPS within a GIS environment has already been well accepted and proven - especially for data collection and now data maintenance. The manner in which GPS is used with GIS is now wide and varied allowing users to determine the way GIS and GPS are used together to best meet their needs</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-81512176576843646042014-12-12T10:37:00.000-08:002014-12-12T10:37:16.784-08:00How to create a simple python add-in tool for ArcGIS Desktop<div dir="ltr" style="text-align: left;" trbidi="on">
<h1>
<u><span style="font-size: 20.0pt; line-height: 115%; mso-bidi-font-size: 14.0pt;">How to create a simple python add-in for ArcGIS Desktop<o:p></o:p></span></u></h1>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><u><span style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">TOOL USED</span></u></b><span style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">:</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"> Python Add-in Assistant<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<b><u><span style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">WORKING OF THE TOOL</span></u></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">:<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">Creating a Simple python add-in assistant for ArcGIS
Desktop to add a Fishnet table to the ArcMap using the python<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">Type of Python Add-in: Tool Type<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">Function: At the end of drawing a rectangle on the
ArcMap a fishnet with specified rows and columns should appear on the Screen<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;">A python add-in tool is
very similar to a<span class="apple-converted-space"> </span></span><a href="http://resources.arcgis.com/en/help/main/10.2/014p/014p0000001z000000.htm"><span style="background: white; border: none windowtext 1.0pt; color: #007ac2; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%; mso-border-alt: none windowtext 0in; padding: 0in;">button</span></a><span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;">. But, a tool requires user to interact with the map application based
on that interaction some business logic will get executed. The<span class="apple-converted-space"> </span></span><span class="uicontrol"><b><span style="background: white; border: none windowtext 1.0pt; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 9.0pt; line-height: 115%; mso-border-alt: none windowtext 0in; padding: 0in;">Zoom In</span></b></span><span class="apple-converted-space"><span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;"> </span></span><span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;">tool<span class="apple-converted-space"> </span></span><!--[if gte vml 1]><v:shapetype id="_x0000_t75"
coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Picture_x0020_4" o:spid="_x0000_i1028" type="#_x0000_t75"
alt="Description: Zoom In" style='width:12pt;height:12pt;visibility:visible;
mso-wrap-style:square'>
<v:imagedata src="file:///C:\Users\Jebestin\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"
o:title="Zoom In"/>
</v:shape><![endif]--><!--[if !vml]--><img alt="Description: Zoom In" border="0" height="16" src="file:///C:/Users/Jebestin/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png" v:shapes="Picture_x0020_4" width="16" /><!--[endif]--><span class="apple-converted-space"><span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;"> </span></span><span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;">in ArcMap will be a great example, when the
user draws a rectangle on the ArcMap ,then the map will be redrawn with that
rectangle as an extent.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;">Below steps will help you
to create both Toolbox as well as a Tool on it</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<b><u><span style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">PROCEDURE:<o:p></o:p></span></u></b></div>
<div class="MsoNormal">
Steps to Create a Toolbar for your Tool:<o:p></o:p></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 22.5pt; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in; vertical-align: baseline;">
<!--[if !supportLists]--><span style="font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: Arial;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><!--[endif]--><span style="border: none windowtext 1.0pt; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-border-alt: none windowtext 0in; mso-fareast-font-family: "Times New Roman"; padding: 0in;">To create your own toolbar. Open the Add-n assistant and Go to
Add-in Contents tab and give the information <span style="color: #4d4d4d;">about
the add-in which you are going to create.<br />
</span><span style="color: #f79646; mso-themecolor: accent6;">Note: A tool can
reside on a Toolbar but cannot sits on a Menu</span></span><span style="color: #f79646; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman"; mso-themecolor: accent6;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 22.5pt; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in; vertical-align: baseline;">
<!--[if !supportLists]--><span style="font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: Arial;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><!--[endif]--><span style="color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Click the </span><b><span style="border: none windowtext 1.0pt; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-border-alt: none windowtext 0in; mso-fareast-font-family: "Times New Roman"; padding: 0in;">Add-In Contents</span></b><span style="color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> tab and begin declaring your add-in
customizations. A tool can reside on a toolbar but not on a menu. See </span><a href="http://resources.arcgis.com/en/help/main/10.2/014p/014p0000001t000000.htm"><span style="border: none windowtext 1.0pt; color: #007ac2; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-border-alt: none windowtext 0in; mso-fareast-font-family: "Times New Roman"; padding: 0in; text-decoration: none; text-underline: none;">creating
an add-in toolbar</span></a><span style="color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> for more
detailed procedure.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 22.5pt; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in; vertical-align: baseline;">
<!--[if !supportLists]--><span style="font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: Arial;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><!--[endif]--><span style="border: none windowtext 1.0pt; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-border-alt: none windowtext 0in; mso-fareast-font-family: "Times New Roman"; padding: 0in;">To Create the tool on your new Toolbar</span><span style="color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; margin-left: 22.5pt; margin-right: 0in; margin-top: 0in; vertical-align: baseline;">
<span style="color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Right-click the new toolbar and choose </span><b><span style="border: none windowtext 1.0pt; color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 9.0pt; mso-border-alt: none windowtext 0in; mso-fareast-font-family: "Times New Roman"; padding: 0in;">New Tool</span></b><span style="color: #4d4d4d; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> on the right click Menu.<o:p></o:p></span></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvkC3kcyHLYPsKA4nSbXL5MxwJR2ASrkx9sAPCBIwVPvc2G_tMFlLLSXHRuOR08olzGtoxf2kfkQqDHBAPZAPYRqRL1llTty9gx6ykeJTi5sLIXjCi7YEMxw7fSOnRRMfcDlCjbajHcueJ/s1600/python+addin.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvkC3kcyHLYPsKA4nSbXL5MxwJR2ASrkx9sAPCBIwVPvc2G_tMFlLLSXHRuOR08olzGtoxf2kfkQqDHBAPZAPYRqRL1llTty9gx6ykeJTi5sLIXjCi7YEMxw7fSOnRRMfcDlCjbajHcueJ/s1600/python+addin.png" height="328" title="Python addin Assistant" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Python addin assistant window</td></tr>
</tbody></table>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; margin-left: 22.5pt; margin-right: 0in; margin-top: 0in; vertical-align: baseline;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #4d4d4d; font-family: Arial, sans-serif; font-size: 10pt;">At once you have finished giving out the
information and details about the add-in. Click on </span><span class="uicontrol"><b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 1pt none windowtext; color: #4d4d4d; font-family: Arial, sans-serif; font-size: 9pt; padding: 0in;">Save button </span></b></span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #4d4d4d; font-family: Arial, sans-serif; font-size: 10pt;">at the bottom of the wizard. All the necessary files and
folders will get created within the working folder of your add-in assistant.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #4d4d4d; font-family: Arial, sans-serif; font-size: 10pt;">Now it is the time to work on the main code. Go
to the python script located on the install folder and open it using your
Python idle. Code will appear as shown below with the class name same as your
button name.<br />
</span><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #f79646; font-family: Arial, sans-serif; font-size: 10pt;">Note: Do not change the
button name as it is directly linked with the button and registered in the your
Config.xml file<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #f79646; font-family: Arial, sans-serif; font-size: 10pt;"><o:p> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxr94EsvPO4XxazwVSDwY_GH8QPaunDrPEJfJv-FzZXVXu2BZq-_1Y8chhmehipYuLJoxSxI5F40ZEMyfzWWMtGYHoEcWMdfMHrGqpHpM9J1eVuHtRWRE83Q4zSvRXXd4HYjaA25-nMAVP/s1600/onclick()method.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxr94EsvPO4XxazwVSDwY_GH8QPaunDrPEJfJv-FzZXVXu2BZq-_1Y8chhmehipYuLJoxSxI5F40ZEMyfzWWMtGYHoEcWMdfMHrGqpHpM9J1eVuHtRWRE83Q4zSvRXXd4HYjaA25-nMAVP/s1600/onclick()method.png" height="256" title="Python onclick method" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Onclick() methof of the addin button class</td></tr>
</tbody></table>
</o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Arial, sans-serif; font-size: 10pt;">The Onclick () method shown on idle will get executed on when
the user click on the tool . But I our case the fishnet should get created
whenever the user draw the tool is selected and draw an rectangle on the Map.
So to do that OnRectangle () method of the python add-in will comes in to
Picture. Replace on click method with OnRectangle () method as shown below:<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-RFNDjSqWn2yhgCtcuvSJnIVbCQcQBEaxEfMbWGC2Tla83bAGFTnUmmn7hWWThqgtmKmhlACNfLugG7wktFuqf8thfiPZAkqb5tHpUoKps6xzp-zTYULUInea8ffAlhUqac1Dz-gxoFXo/s1600/rectangle.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-RFNDjSqWn2yhgCtcuvSJnIVbCQcQBEaxEfMbWGC2Tla83bAGFTnUmmn7hWWThqgtmKmhlACNfLugG7wktFuqf8thfiPZAkqb5tHpUoKps6xzp-zTYULUInea8ffAlhUqac1Dz-gxoFXo/s1600/rectangle.png" height="257" title="Fishnet python addin assistant" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Fishnet content added to On Rectangle method</td></tr>
</tbody></table>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="background: white; line-height: 13.45pt; margin-bottom: .05in; mso-add-space: auto; mso-list: l1 level1 lfo2; text-indent: -.25in; vertical-align: baseline;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;">
</span></span><!--[endif]--><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Arial, sans-serif; font-size: 10pt;">The code will check for any preexistence of fishnet on the
memory using the Exist() Method and deletes if anyone is already there using
the Delete_Management() function.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="background: white; line-height: 13.45pt; margin-bottom: .05in; mso-add-space: auto; mso-list: l1 level1 lfo2; text-indent: -.25in; vertical-align: baseline;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;">
</span></span><!--[endif]--><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Arial, sans-serif; font-size: 10pt;">CreateFishnet_management is the core function which is going
to do the actual work after supply all the necessary parameters to it<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="background: white; line-height: 13.45pt; margin-bottom: .05in; mso-add-space: auto; mso-list: l1 level1 lfo2; text-indent: -.25in; vertical-align: baseline;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;">
</span></span><!--[endif]--><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Arial, sans-serif; font-size: 10pt;">Refresh the active view to redraw the Map and return the path
of the fishnet to the calling function.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 13.45pt; margin-bottom: .05in; vertical-align: baseline;">
<br /></div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com1tag:blogger.com,1999:blog-6160704651188967740.post-15195446032152676172014-12-12T10:23:00.004-08:002014-12-12T10:27:24.251-08:00How to check for condition in Geoprocessing Service or Model Builder<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 style="text-align: left;">
<span style="color: blue;">How to check for if/else conditions in Geoprocessing Service</span></h1>
<div>
<div>
<br /></div>
<div>
<b>TOOL USED:</b> </div>
<div>
Arc python and Script tool</div>
<div>
Python script will be deployed in the ARC Toolbox to create the Conversion Tool </div>
<div>
<br /></div>
<div>
<b>WORKING OF THE TOOL:</b></div>
<div>
Script tool is created in the ArcMap and the required input & Output Parameter are set. The script tool source is set to the custom python code present in an Python file(.py)</div>
<div>
Out motive is to use check for the count of a features in an feature class and performing an conditional Execution</div>
<div>
<br /></div>
<div>
<b>PROCEDURE:</b></div>
<div style="text-align: left;">
<ul style="text-align: left;">
<li>Open ArcMap 10.0+ </li>
<li>Create your own Geometric Network or Open your Existing Geometric Network</li>
<li>Add your Geometric network to the Table of contents in the ArcMap as Shown Below</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP7TvxQ5M5lpEArCKHjgfGiPCwAjFV_4CKXejzdTFBiJI-rxAuyecLMnTBXGyerEDvsxExUGavgIN3Y10L1DZCratE1EvFTZjq7gHq9sEwaU4fp7AlWwAOst1jfHv6NC0zRx0gLELJ3HxZ/s1600/temp.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP7TvxQ5M5lpEArCKHjgfGiPCwAjFV_4CKXejzdTFBiJI-rxAuyecLMnTBXGyerEDvsxExUGavgIN3Y10L1DZCratE1EvFTZjq7gHq9sEwaU4fp7AlWwAOst1jfHv6NC0zRx0gLELJ3HxZ/s1600/temp.jpg" height="245" width="400" /></a></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Symbol; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">Create a new Model in your myToolBox .Right Click on MyToolBox > New > Model.Following window will appear on the Screen</span><span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"> </span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWGvo7iTqzLy68ub0Kkn0gQGEqo798xNPKj7fmHHGWfew_yWM5ef-dMs2lJrFX4-znz18spmKvm6yCm4FNQm4_nzq_7eFy4i-AY_Y65PUGHMdD3BntCy0oK_FvAhKTOIbB0QyuREQWiY3N/s1600/modelbuidler.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWGvo7iTqzLy68ub0Kkn0gQGEqo798xNPKj7fmHHGWfew_yWM5ef-dMs2lJrFX4-znz18spmKvm6yCm4FNQm4_nzq_7eFy4i-AY_Y65PUGHMdD3BntCy0oK_FvAhKTOIbB0QyuREQWiY3N/s1600/modelbuidler.png" height="295" width="400" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: Symbol; text-indent: -0.25in;"><span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">Add your desired feature class to the Model. (Right Click on any empty space and select ADD DATA</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">and select your feature class in the object browser)</span></li>
<li><span style="font-family: Symbol; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">Add Get Count and Calculate value Model from the System Toolbox </span><span style="text-indent: -0.25in;">Connect the model as shown below</span><o:p style="text-indent: -0.25in;"></o:p><span style="text-indent: -0.25in;"> </span></li>
</ul>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLqYNbqxMOcT1xuc58sh84PuOWPZrxNMHtZJxoqeCxfL_IxAO8PHuGb7C2hZgLIR1aql0770mg-C2IXjzUqLCVmv2oMORzuudE5Xu75wFlDLPMsNPnh6Bku0uaX48Sjb27xiILnisG20oW/s1600/getcount.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLqYNbqxMOcT1xuc58sh84PuOWPZrxNMHtZJxoqeCxfL_IxAO8PHuGb7C2hZgLIR1aql0770mg-C2IXjzUqLCVmv2oMORzuudE5Xu75wFlDLPMsNPnh6Bku0uaX48Sjb27xiILnisG20oW/s1600/getcount.png" height="223" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
</div>
<ul style="text-align: left;">
<li><span style="color: red; font-family: Symbol; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">Now open calculate value Model and in the Expression Textbox call the function </span><span style="color: red; text-indent: -0.25in;">Calculate(%RowCount%)</span></li>
<li><span style="font-family: Symbol; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">Here %RowCount% will act as an Inline Variable and Compiler automatically replace the %RowCount% with the value of the rowcount field</span></li>
<li><span style="font-family: Symbol; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">At the Code block defined the function Calculate as</span></li>
</ul>
<!--[if !supportLists]--><br />
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<o:p></o:p></div>
<div class="MsoNormal" style="margin-left: 1.0in;">
<span style="color: red;">def calculate(row):<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 1.0in;">
<span style="color: red;">if row>0:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 1.0in;">
<span style="color: red;">return true<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 1.0in;">
<span style="color: red;">else:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 1.0in;">
<span style="color: red;">return false<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<o:p></o:p></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
</div>
<ul style="text-align: left;">
<li><span style="font-family: Symbol; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">Make the return Data type as Boolean</span></li>
<li><span style="font-family: Symbol; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><span style="text-indent: -0.25in;">The output Boolean can be set as a precondition for any model. So that the Model</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">get executes only when the output of calculate value is true</span></li>
</ul>
<!--[if !supportLists]--><o:p></o:p><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal">
<br /></div>
<br />
<div style="text-indent: -24px;">
<br /></div>
<br />
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-83237181374106713262014-12-12T09:47:00.000-08:002014-12-12T09:47:45.139-08:00How to create Graphical User Interface in Arcpy<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 style="text-align: left;">
<span style="color: blue;">To Show GUI in your Script tool of your ArcMap</span></h1>
<div>
<span style="color: blue;"><br /></span></div>
<div>
<span style="color: blue;"><br /></span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;">Python consist of huge number of GUI frameworks (or toolkits) available for it, from </span><a href="https://wiki.python.org/moin/TkInter" style="background-color: white; border-bottom-color: rgb(221, 221, 221); border-bottom-style: dashed; border-width: 0px 0px 1px; color: #551a8b; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px; text-decoration: none;">TkInter</a> <span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;">to a number of other cross-platform solutions.<br /><br />In your case we going to use the default TkInter Module to access the windows form from the python script tool.</span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;">TkInter is being proposed as the most interactive and easy to program module in Python GUI framework</span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;"><br /></span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;">1. Create a new Script tool in the Arcmap's ArcCatalog window in your desired location</span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;">2. Copy the below codes in to a notepad file and save it as python .py extension</span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;">3.Go to the script tool and Right Click > Properties > Parameter<br />4.Browse to your newly created python code as the source file to execute</span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;">5.All is well.Start GUI python from TkInter. Happy Programming</span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLg44ivToe2Lel4iR8o8DHqF0XV7QVK7LM-s2ZJlRHgD0Z62tOYOYcO7JPAniGpgJdHiR1GdKLej4kTxYXCHuwcdCpGsKmkFycv8HQ9fce7no__9u8gtQ9fW-Vdtq3phqnp6mgb4oCKUaZ/s1600/Arcpy+GUI+for+Arcmap.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLg44ivToe2Lel4iR8o8DHqF0XV7QVK7LM-s2ZJlRHgD0Z62tOYOYcO7JPAniGpgJdHiR1GdKLej4kTxYXCHuwcdCpGsKmkFycv8HQ9fce7no__9u8gtQ9fW-Vdtq3phqnp6mgb4oCKUaZ/s1600/Arcpy+GUI+for+Arcmap.JPG" height="212" width="400" /></a></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;"><br /></span></div>
<div>
<span style="background-color: white; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 14px; line-height: 21.2591991424561px;"><br /></span></div>
<div>
<span style="color: blue;"><br /></span></div>
<div>
<div>
from Tkinter import *</div>
<div>
import datetime</div>
<div>
from array import *</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
root = Tk()</div>
<div>
logo = PhotoImage(file="Image.Gif")</div>
<div>
w2 = Label(root,</div>
<div>
image=logo).grid(row=0,column=1)</div>
<div>
explanation = """Team Geo Zoner"""</div>
<div>
w2 = Label(root, </div>
<div>
compound = CENTER,</div>
<div>
fg="Red",</div>
<div>
bg="black",</div>
<div>
font="Times 55 bold",</div>
<div>
text=explanation)</div>
<div>
w2.grid(row=0,column=0)</div>
<div>
<br /></div>
<div>
p=str(datetime.datetime.now().isoformat())</div>
<div>
texter="Your Heading Goes Here"+str(p);</div>
<div>
w3 = Label(root, </div>
<div>
compound = CENTER,</div>
<div>
fg="Green",</div>
<div>
font="Times 20 bold",</div>
<div>
text=texter)</div>
<div>
w3.grid(row=1,column=0)</div>
<div>
<br /></div>
<div>
Parameters = ['Number of Inputs','Number of Ouputs','Number of Processing Parameters','Number of Intermediate data']</div>
<div>
<br /></div>
<div>
r = 2</div>
<div>
i=1</div>
<div>
for c in Parameters:</div>
<div>
Label(text=c, relief=RIDGE,width=25).grid(row=r,column=0)</div>
<div>
Entry(text="Value", relief=SUNKEN,width=10).grid(row=r,column=1)</div>
<div>
r = r + 1</div>
<div>
i = i + 1</div>
<div>
<br /></div>
<div>
root.title("GISSTUDY")</div>
<div>
root.mainloop()</div>
<div>
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-62760696481638943992014-12-11T09:28:00.000-08:002014-12-11T09:45:34.364-08:00Performance issues on ArcGIS Geoprocessing Service<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 style="text-align: left;">
<u><b><span style="color: #3d85c6;">How to improve Geo-processing Execution Speed</span></b></u></h1>
<div>
Geoprocessing services hosted in the ArcGIS server needs to be pretty fast and accurate. User will always want the service to be the fastest. Since ArcGIS Server will be able to service multiple users at one instant of time, inefficient services can overload your server and increase the processing time. The more efficient and intelligent your services, the more users can be serviced with the same computing resources at a smaller amount of time.</div>
<div>
<br />
<div class="Break">
</div>
Below are some of the tips and techniques that helps in increasing the performance of your Geo-processing Services.</div>
<div>
<br /></div>
<div>
<h3 style="text-align: left;">
<span style="color: lime;">Use local paths to data and resources</span></h3>
<div>
The more faster the data requires to be processed is accessible by the server the more faster your service will be.It is good to copy your data to the server rather than placing it on the shared location and asking the server to access it.(Copying the server will be effective only if the Geo processing input data is very small in size and also when the input data is not dynamic)</div>
<div class="Break">
</div>
Reading data from the local area network will be slow compared to accessing the data from the local disk.. </div>
<div>
<br /></div>
<h3 style="text-align: left;">
<br /><span style="color: lime;">Reading and Writing the Intermediate data IN_Memory</span></h3>
<div>
<span style="color: lime;"><br /></span></div>
<div>
The service execution speed will get increased by multiple times when the intermediate data is allowed to stored in the machine memory(RAM).Input and output operation is the slowest of all the computing operations.In Geoprocessing storing the intermediate data in a file geodatabase or personnel Geodatabase will take maximum of the execution time.</div>
<div>
Please be sure the data which your are storing in the memory as an intermediate data need not be necessary after the execution is complete.Because once the execution is complete the data in the memory will get cleared.Don't write large amount of data to the in_memory as it may affect the performance of the processing service.</div>
<div>
To write to your computer's memory, use the pathname in_memory, as follows:<br />
<pre class="code"> in_memory\your featureclassname</pre>
<pre class="code"></pre>
<pre class="code"></pre>
</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbA4x9NfdjG22wIUjHA0yZQQYOkZfLn6Ru6wwO1_In5EZp7liXPCnekhSyPINgFA1FLeK3VpJVPBiGsxMNEq-jex4O1PDPt78duOxelW9CGZUkTftYnU1lcD5649r6pXnUMM2hKGVYIJ9c/s1600/geoprocessing+speed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbA4x9NfdjG22wIUjHA0yZQQYOkZfLn6Ru6wwO1_In5EZp7liXPCnekhSyPINgFA1FLeK3VpJVPBiGsxMNEq-jex4O1PDPt78duOxelW9CGZUkTftYnU1lcD5649r6pXnUMM2hKGVYIJ9c/s1600/geoprocessing+speed.png" height="296" width="400" /></a></div>
<h3>
<span style="color: lime;"><br /></span></h3>
<h3>
<span style="color: lime;">Use layers from a source map document</span></h3>
<div class="Break">
</div>
If a service uses a source map document instead of feature classes and datasets, it will tremendously increase the performance of the service.Your models and scripts can use map layers from the source map document so that it will impose less load on the processor and significantly decrease the execution time. A layer references a dataset on disk or feature class on a geodatabase, and some layers cache properties about the dataset. Therefore by using dataset layer instead of the direct dsataset or feature class,there is a performance advantage because ArcMap opens the dataset once, caches basic properties of the dataset, and keeps the dataset open. When the Service executes, the dataset need not to be reopened because the source map document already it is opened and it will gives us a performance boost. </div>
<div>
<br /></div>
<div>
<span style="color: lime;"><br /></span></div>
<div>
<h3>
<span style="color: lime;">Write data to shapefiles</span></h3>
<div class="Break">
</div>
Storing the data to shapefiles is a bit faster than writing to other formats but writing data to memory, described above, is the fastest of all. Even then there is further more limitations on the shapefiles such field names should be as 10 character , no null values, and limited support for date/time, to name a few. This become more helpful if the you are running your model locally on your Desktop</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-37993737112894571282014-12-09T11:37:00.000-08:002014-12-09T11:37:43.664-08:00ArcObjects to add a flag to the Geometric Network .Net<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 style="text-align: left;">
<span style="color: #3d85c6;">Creating a Flag in ArcMap using ArcObjects .NET</span></h1>
<div style="text-align: justify;">
<span style="color: #3d85c6;"><br /></span></div>
<div>
<div style="text-align: justify;">
1. Add a new add-in component to the CreatingOutputs solution and name the component</div>
<div style="text-align: justify;">
AddFlagTool. Select Tool as the type of add-in, set the confi guration of the tool as shown in</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
2. Enter the following using directives at the top of the AddFlagTool.cs fi le’s code window:</div>
<div style="text-align: justify;">
using ESRI.ArcGIS.ArcMapUI;</div>
<div style="text-align: justify;">
using ESRI.ArcGIS.Geometry;</div>
<div style="text-align: justify;">
using ESRI.ArcGIS.Display;</div>
<div style="text-align: justify;">
using ESRI.ArcGIS.Carto;</div>
<div style="text-align: justify;">
3. You are going to write the code for handling the OnMouseDown event. In other words, you want</div>
<div style="text-align: justify;">
your code to be executed when a user clicks somewhere in the main window of the software application. Because all the events and their handlers are defined in the base class of all tools(ESRI.ArcGIS.Desktop.AddIns.Tool), you have to override the necessary handlers. So write</div>
<div style="text-align: justify;">
the following code in the AddflagTool.cs file inside the definition for the AddflagTool class and outside of any method: protected override</div>
<div style="text-align: justify;">
As soon as you type these two keywords and press the spacebar, you will see the list of all available handlers.</div>
<div style="text-align: justify;">
Find OnMouseDown in the list as shown in below Figure and press Enter.</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYt31rvT_W85F1KdlQZmz3Lj40XVfmF6hMDbZqv7P5wqVfwex1VIolcoUoAKlCg2Bmm2WetqowiroW3PIoB5LHmwzl3tLydFtnDlb9RnW_zXQNd4co0McSjrVwWIYJMRjEIRcJfLqZl3MR/s1600/Mousedown.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYt31rvT_W85F1KdlQZmz3Lj40XVfmF6hMDbZqv7P5wqVfwex1VIolcoUoAKlCg2Bmm2WetqowiroW3PIoB5LHmwzl3tLydFtnDlb9RnW_zXQNd4co0McSjrVwWIYJMRjEIRcJfLqZl3MR/s1600/Mousedown.JPG" height="379" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
4.On the Mouse down event call the add flag function in the another library</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
5.For the Add flag function add the following code in the other library addflag function</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<div>
public static void AddFlag(IPoint pPnt, IApplication app, double snapTol)</div>
<div>
{</div>
<div>
//IProgressDialogFactory pProDFact = null;</div>
<div>
//IStepProgressor pStepPro = null;</div>
<div>
//IProgressDialog2 pProDlg = null;</div>
<div>
//ITrackCancel pTrkCan = null;</div>
<div>
IGeometricNetwork gn = null;</div>
<div>
IPoint snappedPoint = null;</div>
<div>
IFlagDisplay pFlagDisplay = null;</div>
<div>
INetFlag startNetFlag = null;</div>
<div>
<br /></div>
<div>
INetworkAnalysisExt pNetAnalysisExt = null;</div>
<div>
IMap pMap = null;</div>
<div>
UID pID = null;</div>
<div>
int EID = -1;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
try</div>
<div>
{</div>
<div>
<br /></div>
<div>
pID = new UID();</div>
<div>
<br /></div>
<div>
pID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";</div>
<div>
pNetAnalysisExt = (INetworkAnalysisExt)app.FindExtensionByCLSID(pID);</div>
<div>
gn = pNetAnalysisExt.CurrentNetwork;</div>
<div>
<br /></div>
<div>
pMap = (app.Document as IMxDocument).FocusMap;</div>
<div>
startNetFlag = Globals.GetJunctionFlagWithGN(ref pPnt, ref pMap, ref gn, snapTol,out snappedPoint, out EID, out pFlagDisplay, true) as INetFlag;</div>
<div>
if (startNetFlag == null)</div>
<div>
{</div>
<div>
//startNetFlag = Globals.GetEdgeFlag(ref pPnt, ref pMap, ref gnList, snapTol, ref gnIdx, out snappedPoint, out EID, out distanceAlong, out pFlagDisplay, true) as INetFlag;</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
if (app != null)</div>
<div>
{</div>
<div>
</div>
<div>
Globals.AddFlagToGN(ref pNetAnalysisExt, ref gn, ref pFlagDisplay);</div>
<div>
// pFlagDisplay</div>
<div>
pNetAnalysisExt = null;</div>
<div>
pID = null;</div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
}</div>
<div>
catch (Exception)</div>
<div>
{</div>
<div>
</div>
<div>
throw;</div>
<div>
}</div>
<div>
}</div>
<div>
5. The above function will make a call to the getJunctionflag code.create a function block called "getjunctionflag" with the class library Global and place the below code:</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
using System;</div>
<div>
using System.Collections.Generic;</div>
<div>
using System.Linq;</div>
<div>
using System.Text;</div>
<div>
using ESRI.ArcGIS.SystemUI;</div>
<div>
using ESRI.ArcGIS.Geometry;</div>
<div>
using ESRI.ArcGIS.GeoDatabaseUI;</div>
<div>
using ESRI.ArcGIS.Geodatabase;</div>
<div>
using ESRI.ArcGIS.Framework;</div>
<div>
using ESRI.ArcGIS.esriSystem;</div>
<div>
using ESRI.ArcGIS.Display;</div>
<div>
using ESRI.ArcGIS.DataSourcesGDB;</div>
<div>
using ESRI.ArcGIS.DataSourcesFile;</div>
<div>
using ESRI.ArcGIS.CartoUI;</div>
<div>
using ESRI.ArcGIS.Carto;</div>
<div>
using ESRI.ArcGIS.ArcMapUI;</div>
<div>
using ESRI.ArcGIS.ArcMap;</div>
<div>
using ESRI.ArcGIS.NetworkAnalysis;</div>
<div>
using ESRI.ArcGIS.NetworkAnalyst;</div>
<div>
using ESRI.ArcGIS.EditorExt;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
namespace Toolkit</div>
<div>
{</div>
<div>
class Globals</div>
<div>
{</div>
<div>
public enum GNTypes</div>
<div>
{</div>
<div>
Flags = 1, Barries = 2, Results = 3</div>
<div>
<br /></div>
<div>
};</div>
<div>
<br /></div>
<div>
public enum flagType { EdgeFlag, JunctionFlag, EdgeBarrier, JunctionBarrier };</div>
<div>
</div>
<div>
<br /></div>
<div>
public static IJunctionFlag GetJunctionFlagWithGN(ref IPoint point, ref IMap map, ref IGeometricNetwork gn, double snapTol, out IPoint snappedPoint, out int EID, out IFlagDisplay pFlagDisplay, bool Flag)</div>
<div>
{</div>
<div>
//Initialize output variables</div>
<div>
snappedPoint = null;</div>
<div>
EID = -1;</div>
<div>
pFlagDisplay = null;</div>
<div>
int FCID = -1, FID = -1, subID = -1;</div>
<div>
<br /></div>
<div>
IGeoDataset pDS = null;</div>
<div>
IPointToEID pointToEID = null;</div>
<div>
INetElements netElements = null;</div>
<div>
INetFlag junctionFlag = null;</div>
<div>
try</div>
<div>
{</div>
<div>
pFlagDisplay = null;</div>
<div>
<br /></div>
<div>
pDS = gn.FeatureDataset as IGeoDataset;</div>
<div>
point.Project(pDS.SpatialReference);</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
pointToEID = new PointToEIDClass() as IPointToEID;</div>
<div>
<br /></div>
<div>
// find the nearest junction element to this Point</div>
<div>
pointToEID.GeometricNetwork = gn as IGeometricNetwork;</div>
<div>
pointToEID.SourceMap = map;</div>
<div>
pointToEID.SnapTolerance = snapTol;</div>
<div>
<br /></div>
<div>
try</div>
<div>
{</div>
<div>
pointToEID.GetNearestJunction(point, out EID, out snappedPoint);</div>
<div>
}</div>
<div>
catch (Exception ex)</div>
<div>
{</div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
if (snappedPoint == null)</div>
<div>
return null;</div>
<div>
<br /></div>
<div>
// convert the EID to a feature class ID, feature ID, and sub ID</div>
<div>
netElements = gn.Network as INetElements;</div>
<div>
<br /></div>
<div>
try</div>
<div>
{</div>
<div>
netElements.QueryIDs(EID, esriElementType.esriETJunction, out FCID, out FID, out subID);</div>
<div>
}</div>
<div>
catch (Exception ex)</div>
<div>
{</div>
<div>
<br /></div>
<div>
return null;</div>
<div>
}</div>
<div>
<br /></div>
<div>
//Create flag for start of trace</div>
<div>
junctionFlag = new JunctionFlagClass() as INetFlag;</div>
<div>
junctionFlag.UserClassID = FCID;</div>
<div>
junctionFlag.UserID = FID;</div>
<div>
junctionFlag.UserSubID = subID;</div>
<div>
<br /></div>
<div>
if (junctionFlag is IEdgeFlag)</div>
<div>
{</div>
<div>
pFlagDisplay = new EdgeFlagDisplayClass();</div>
<div>
<br /></div>
<div>
if (Flag)</div>
<div>
pFlagDisplay.Symbol = CreateNetworkFlagBarrierSymbol(flagType.EdgeFlag) as ISymbol;</div>
<div>
else</div>
<div>
pFlagDisplay.Symbol = CreateNetworkFlagBarrierSymbol(flagType.EdgeBarrier) as ISymbol;</div>
<div>
}</div>
<div>
else</div>
<div>
{</div>
<div>
pFlagDisplay = new JunctionFlagDisplayClass();</div>
<div>
if (Flag)</div>
<div>
pFlagDisplay.Symbol = CreateNetworkFlagBarrierSymbol(flagType.JunctionFlag) as ISymbol;</div>
<div>
else</div>
<div>
pFlagDisplay.Symbol = CreateNetworkFlagBarrierSymbol(flagType.JunctionBarrier) as ISymbol;</div>
<div>
}</div>
<div>
<br /></div>
<div>
pFlagDisplay.ClientClassID = FCID;</div>
<div>
pFlagDisplay.FeatureClassID = FID;</div>
<div>
pFlagDisplay.SubID = subID;</div>
<div>
pFlagDisplay.Geometry = snappedPoint;</div>
<div>
<br /></div>
<div>
return junctionFlag as IJunctionFlag;</div>
<div>
}</div>
<div>
catch</div>
<div>
{</div>
<div>
return null;</div>
<div>
}</div>
<div>
finally</div>
<div>
{</div>
<div>
pDS = null;</div>
<div>
pointToEID = null;</div>
<div>
netElements = null;</div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
public static ISimpleMarkerSymbol CreateNetworkFlagBarrierSymbol(flagType flgType)</div>
<div>
{</div>
<div>
ISimpleMarkerSymbol pSymbolFlag = null;</div>
<div>
switch (flgType)</div>
<div>
{</div>
<div>
case flagType.EdgeFlag:</div>
<div>
pSymbolFlag = new SimpleMarkerSymbolClass();</div>
<div>
pSymbolFlag.Style = esriSimpleMarkerStyle.esriSMSSquare;</div>
<div>
pSymbolFlag.Angle = 0;</div>
<div>
//pSymbolFlag.Color = </div>
<div>
pSymbolFlag.Outline = true;</div>
<div>
pSymbolFlag.OutlineSize = 1;</div>
<div>
//pSymbolFlag.OutlineColor = GetColor(0, 0, 0);</div>
<div>
pSymbolFlag.Size = 10; //TODO: UserConfig</div>
<div>
break;</div>
<div>
case flagType.JunctionFlag:</div>
<div>
<br /></div>
<div>
pSymbolFlag = new SimpleMarkerSymbolClass();</div>
<div>
pSymbolFlag.Style = esriSimpleMarkerStyle.esriSMSCircle;</div>
<div>
pSymbolFlag.Angle = 0;</div>
<div>
//pSymbolFlag.Color = GetColor(0, 255, 0);</div>
<div>
pSymbolFlag.Outline = true;</div>
<div>
pSymbolFlag.OutlineSize = 1;</div>
<div>
//pSymbolFlag.OutlineColor = GetColor(0, 0, 0);</div>
<div>
pSymbolFlag.Size = 10; //TODO: UserConfig</div>
<div>
break;</div>
<div>
case flagType.EdgeBarrier:</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
pSymbolFlag = new SimpleMarkerSymbolClass();</div>
<div>
pSymbolFlag.Style = esriSimpleMarkerStyle.esriSMSDiamond;</div>
<div>
pSymbolFlag.Angle = 0;</div>
<div>
//pSymbolFlag.Color = GetColor(255, 0, 0);</div>
<div>
pSymbolFlag.Outline = true;</div>
<div>
pSymbolFlag.OutlineSize = 1;</div>
<div>
//pSymbolFlag.OutlineColor = GetColor(0, 0, 0);</div>
<div>
pSymbolFlag.Size = 10; //TODO: UserConfig</div>
<div>
break;</div>
<div>
case flagType.JunctionBarrier:</div>
<div>
<br /></div>
<div>
pSymbolFlag = new SimpleMarkerSymbolClass();</div>
<div>
pSymbolFlag.Style = esriSimpleMarkerStyle.esriSMSX;</div>
<div>
pSymbolFlag.Angle = 0;</div>
<div>
//pSymbolFlag.Color = GetColor(255, 0, 0);</div>
<div>
pSymbolFlag.Outline = true;</div>
<div>
pSymbolFlag.OutlineSize = 1;</div>
<div>
//pSymbolFlag.OutlineColor = GetColor(0, 0, 0);</div>
<div>
pSymbolFlag.Size = 10; //TODO: UserConfig</div>
<div>
break;</div>
<div>
default:</div>
<div>
pSymbolFlag = new SimpleMarkerSymbolClass();</div>
<div>
pSymbolFlag.Style = esriSimpleMarkerStyle.esriSMSCircle;</div>
<div>
pSymbolFlag.Angle = 0;</div>
<div>
//pSymbolFlag.Color = GetColor(0, 255, 0);</div>
<div>
pSymbolFlag.Outline = true;</div>
<div>
pSymbolFlag.OutlineSize = 1;</div>
<div>
//pSymbolFlag.OutlineColor = GetColor(0, 0, 0);</div>
<div>
pSymbolFlag.Size = 10; //TODO: UserConfig</div>
<div>
break;</div>
<div>
}</div>
<div>
return pSymbolFlag;</div>
<div>
<br /></div>
<div>
}</div>
<div>
<br /></div>
<div>
public static void AddFlagToGN(ref INetworkAnalysisExt pNetworkAnalysisExt, ref ESRI.ArcGIS.Geodatabase.IGeometricNetwork pGeomNet, ref IFlagDisplay pFlagDsiplay)</div>
<div>
{</div>
<div>
INetworkAnalysisExtFlags pNetworkAnalysisExtFlags = null;</div>
<div>
<br /></div>
<div>
try</div>
<div>
{</div>
<div>
if (pNetworkAnalysisExt.CurrentNetwork != pGeomNet)</div>
<div>
{</div>
<div>
pNetworkAnalysisExt.CurrentNetwork = pGeomNet;</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
pNetworkAnalysisExtFlags = (INetworkAnalysisExtFlags)pNetworkAnalysisExt;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
if (pFlagDsiplay is IEdgeFlagDisplay)</div>
<div>
{</div>
<div>
<br /></div>
<div>
pNetworkAnalysisExtFlags.AddEdgeFlag(pFlagDsiplay as IEdgeFlagDisplay);</div>
<div>
<br /></div>
<div>
}</div>
<div>
else</div>
<div>
{</div>
<div>
<br /></div>
<div>
pNetworkAnalysisExtFlags.AddJunctionFlag(pFlagDsiplay as IJunctionFlagDisplay);</div>
<div>
}</div>
<div>
}</div>
<div>
catch</div>
<div>
{</div>
<div>
<br /></div>
<div>
}</div>
<div>
finally</div>
<div>
{</div>
<div>
pNetworkAnalysisExtFlags = null;</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
}</div>
<div>
}</div>
<div>
}</div>
</div>
<div>
<br /></div>
</div>
<div style="text-align: justify;">
<span style="color: #3d85c6;">6. Run code and set the default debug application as ArcMap</span></div>
<div style="text-align: justify;">
<span style="color: #3d85c6;"><br /></span></div>
<div style="text-align: justify;">
7. Once the ArcMap is open go to customise code and in the command tab add the tool to your window</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
8.click on the tool will add an flag symbol to the map(use f5 to refresh the map)</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-58717916461767855342014-12-06T15:02:00.003-08:002014-12-24T04:46:19.609-08:00Addin Setting flow direction in Geometric Network<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<h1 style="text-align: left;">
<span style="color: blue;">Addin source code for setup flow direction </span></h1>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br />
<br />
1.Create an c# object with establish flow as a function<br />
<br />
2.Call this function from the addin on click method by passing the application reference and the type of flow direction you wish to set to your network<br />
<br />
To know more about geometric network setting flow direction setting flow direction<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm9uy5NBrgtLybugGP5zlnjnPbbMCrpoNJR6GgW6fvrYpkVp4Q5uvzvhvKpz_aPN8kJaqyDOhUrzblSPFI-Vovt0DmoibrnQsdt1YrTljdtL1LI4SHc9Ke0-H69DWI0g0SKQexXV6nlc5s/s1600/flow_Direction.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="source code for setup flow direction " border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm9uy5NBrgtLybugGP5zlnjnPbbMCrpoNJR6GgW6fvrYpkVp4Q5uvzvhvKpz_aPN8kJaqyDOhUrzblSPFI-Vovt0DmoibrnQsdt1YrTljdtL1LI4SHc9Ke0-H69DWI0g0SKQexXV6nlc5s/s1600/flow_Direction.jpg" height="252" title="Addin source code for setup flow direction " width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Setting Flow Direction through ArcObjects Code</td></tr>
</tbody></table>
<br />
<br />
public static void EstablishFlow(Globals.GNFlowDirection flowDirection, IApplication app)<br />
{<br />
IProgressDialog2 progressDialogs= default(IProgressDialog2);<br />
IProgressDialogFactory progressDialogFactorys = null;<br />
IEditor editing = null;<br />
<br />
IMouseCursor appCursor = null;<br />
INetworkAnalysisExt netExt = null;<br />
UID pUID = null;<br />
<br />
List<IGeometricNetwork> geonetworklist= null;<br />
ITrackCancel trackCancel = null;<br />
Int32 int32_hWnd;<br />
IStepProgressor stepProgressorobj= null;<br />
IMxDocument mxdoc = null;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> IEditLayers eLayers = null;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> IMap pMap = null;<br />
try<br />
{<br />
<br />
<br />
<br />
<br />
int calcCount = 0;<br />
<br />
//Get editing<br />
<br />
editing = Globals.geteditor(ref app);<br />
<br />
if (editing.EditState != esriEditState.esriStateEditing)<br />
{<br />
MessageBox.Show(Teamgeofunctions.Localizer.GetString("MustBEditg"), Teamgeofunctions.Localizer.GetString("GeoNetToolsLbl_2"));<br />
return;<br />
}<br />
<br />
eLayers = editing as IEditLayers;<br />
<br />
//Change mouse cursor to wait - automatically changes back (ArcGIS Desktop only)<br />
appCursor = new MouseCursorClass();<br />
appCursor.SetCursor(2);<br />
<br />
ESRI.ArcGIS.esriSystem.IStatusBar statusBar = app.StatusBar;<br />
statusBar.set_Message(0, Teamgeofunctions.Localizer.GetString("GeoNetToolsWait_1"));<br />
<br />
//Get NA Extension in order to update the current network with the first visible network<br />
pUID = new UIDClass();<br />
pUID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";<br />
netExt = app.FindExtensionByCLSID(pUID) as INetworkAnalysisExt;<br />
<br />
//Get Visible geometric networks<br />
pMap = editing.Map;<br />
geonetworklist= Globals.GetGeometricNetworksCurrentlyVisible(ref pMap);<br />
<br />
<br />
if (gnList.Count > 0)<br />
{<br />
<br />
<br />
//ProgressBar<br />
progressDialogFactorys= new ProgressDialogFactoryClass();<br />
<br />
// Create a CancelTracker<br />
trackCancel = new CancelTrackerClass();<br />
<br />
// Set the properties of the Step Progressor<br />
int32_hWnd = app.hWnd;<br />
stepProgressorobj= progressDialogFactory.Create(trackCancel, int32_hWnd);<br />
stepProgressor.MinRange = 0;<br />
stepProgressor.MaxRange = gnList.Count;<br />
stepProgressor.StepValue = 1;<br />
stepProgressor.Message = "";<br />
stepProgressor.Hide();<br />
<br />
// Create the ProgressDialog. This automatically displays the dialog<br />
progressDialogs= (ESRI.ArcGIS.Framework.IProgressDialog2)stepProgressor; // Explict Cast<br />
<br />
// Set the properties of the ProgressDialog<br />
progressDialog.CancelEnabled = false;<br />
progressDialog.Description = Teamgeofunctions.Localizer.GetString("GeoNetToolsDesc_1");<br />
progressDialog.Title = Teamgeofunctions.Localizer.GetString("GeoNetToolsTitle_1");<br />
progressDialog.Animation = ESRI.ArcGIS.Framework.esriProgressAnimationTypes.esriProgressSpiral;<br />
<br />
bool editStarted = false;<br />
try<br />
{// Create an edit operation enabling undo/redo<br />
editing.StartOperation();<br />
editStarted = true;<br />
}<br />
catch<br />
{<br />
editStarted = false;<br />
}<br />
IGeometricNetwork gn = null;<br />
IEnumFeatureClass enumFC = null;<br />
INetwork net = null;<br />
IUtilityNetworkGEN unet = null;<br />
IEnumNetEID edgeEIDs = null;<br />
//IFeatureLayer fLayer = null;<br />
try<br />
{<br />
<br />
for (int i = 0; i < gnList.Count; i++)<br />
{<br />
<br />
gn = gnList[i] as IGeometricNetwork;<br />
<br />
stepProgressor.Message = Teamgeofunctions.Localizer.GetString("GeoNetToolsProc_1");// +fLayer.Name;<br />
//Establish flow using AncillaryRole values<br />
<br />
<br />
if (flowDirection == Globals.GNFlowDirection.AncillaryRole)<br />
{<br />
enumFC = gn.get_ClassesByNetworkAncillaryRole(esriNetworkClassAncillaryRole.esriNCARSourceSink);<br />
if (enumFC.Next() == null)<br />
MessageBox.Show(Teamgeofunctions.Localizer.GetString("GeoNetToolsError_1a") + gn.FeatureDataset.Name + Teamgeofunctions.Localizer.GetString("GeoNetToolsError_1b") + Environment.NewLine +<br />
Teamgeofunctions.Localizer.GetString("GeoNetToolsError_1c"), Teamgeofunctions.Localizer.GetString("GeoNetToolsProc_2"));<br />
else<br />
{<br />
gn.EstablishFlowDirection();<br />
calcCount += 1;<br />
}<br />
}<br />
<br />
//Establish flow direction based on digitized direction.<br />
else<br />
{<br />
net = gn.Network;<br />
unet = net as IUtilityNetworkGEN;<br />
edgeEIDs = net.CreateNetBrowser(esriElementType.esriETEdge);<br />
edgeEIDs.Reset(); int edgeEID;<br />
for (long j = 0; j < edgeEIDs.Count; j++)<br />
{<br />
edgeEID = edgeEIDs.Next();<br />
unet.SetFlowDirection(edgeEID, esriFlowDirection.esriFDWithFlow);<br />
}<br />
calcCount += 1;<br />
}<br />
stepProgressor.Step();<br />
<br />
}<br />
}<br />
<br />
catch (Exception ex)<br />
{<br />
editing.AbortOperation();<br />
MessageBox.Show(Teamgeofunctions.Localizer.GetString("GeoNetToolsProc_2") + "\n" + ex.Message, ex.Source);<br />
}<br />
finally<br />
{<br />
if (enumFC != null)<br />
Marshal.ReleaseComObject(enumFC);<br />
<br />
gn = null;<br />
enumFC = null;<br />
net = null;<br />
unet = null;<br />
edgeEIDs = null;<br />
//fLayer = null;<br />
}<br />
if (editStarted)<br />
{ // Stop the edit operation<br />
if (flowDirection == Globals.GNFlowDirection.AncillaryRole)<br />
editing.StopOperation(Teamgeofunctions.Localizer.GetString("GeoNetToolsProc_2"));<br />
else<br />
editing.StopOperation(Teamgeofunctions.Localizer.GetString("GeoNetToolsProc_3"));<br />
}<br />
object Missing = Type.Missing;<br />
mxdoc = app.Document as IMxDocument;<br />
mxdoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, Missing, mxdoc.ActiveView.Extent);<br />
<br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
<br />
return;<br />
<br />
<br />
}<br />
finally<br />
{<br />
// delete the references to cleanup the memory<br />
if (progressDialogs!= null)<br />
progressDialog.HideDialog();<br />
progressDialogs= null;<br />
progressDialogFactorys= null;<br />
editing = null;<br />
eLayers = null;<br />
appCursor = null;<br />
netExt = null;<br />
pUID = null;<br />
pMap = null;<br />
geonetworklist= null;<br />
trackCancel = null;<br />
<br />
stepProgressorobj= null;<br />
mxdoc = null;<br />
}</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-41314819292961193092014-11-26T10:28:00.001-08:002014-12-24T04:37:41.530-08:00Custom Geoprocessing Tool<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"></span><br />
<h1>
<span style="font-size: large;">Arcobjects Geoprocessing Procedure:</span></h1>
<br />
<br />
1. Create a geoprocessor object and set its properties.<br />
2. Set the appropriate values for the tool’s parameters.<br />
3. Execute a tool using the geoprocessor object’s Execute() method.<br />
<br />
In order to create a geoprocessor object, the IGeoProcessor2 interface can be used. This interface<br />
is defined in the geoprocessing library of ArcObjects and is implemented by the GeoProcessor<br />
CoClass.<br />
<br />
IGeoProcessor2 gp = new GeoProcessorClass();<br />
//add the result of geoprocessing as a new layer to Map<br />
gp.AddOutputsToMap = true;<br />
//if output of geoprocessing exists before the execution of tool<br />
//it will be overwritten<br />
gp.OverwriteOutput = true;<br />
<br />
Assume that you want to create Thiessen polygons for the cities FeatureClass to create proximal<br />
zones for all cities. The proximal zones represent full areas where any location inside the zone is<br />
closer to its associated city than any other city. Based on the Create Thiessen Polygons reference<br />
page, you have to provide at least an input point FeatureLayer and the path to the output<br />
FeatureClass.<br />
In order to create and set each parameter, the IVariantArray interface of the System library must<br />
be used.<br />
<br />
IVariantArray parameters = new VarArrayClass();<br />
<br />
Each parameter has to be added to the IVariantArray interface in the exact order that is specified<br />
on the tool’s reference page.<br />
<br />
//in_features<br />
parameters.Add(@"D:\DataFolder\fileGDB.gdb\cities");<br />
//out_feature_class<br />
parameters.Add(@"D:\DataFolder\fileGDB.gdb\citiesThiessen");<br />
//fields_to_copy(Optional)<br />
parameters.Add("ALL");<br />
<br />
As it is illustrated on the Create Thiessen Polygons reference page, the third parameter is optional.<br />
You can simply not add any value to IVariantArray or, as shown in the preceding code, you can<br />
provide an appropriate value for the optional parameter. You can skip the optional parameter<br />
using an empty string as input to IVariantArray’s Add() method. For example, look at the<br />
reference page of the Buffer tool; you can see that three of the seven available parameters are<br />
mandatory. The following code demonstrates how to skip the fourth parameter and specify the<br />
fifth parameter:<br />
<br />
//1-in_features<br />
parameters.Add(@"D:\test.gdb\cities");<br />
//2-out_feature_class<br />
parameters.Add(@"D:\test.gdb\citiesBuffer");<br />
//3-buffer_distance_or_field<br />
parameters.Add("50 kilometers");<br />
//4-line_side(Optional)<br />
parameters.Add("");<br />
//5-line_end_type(Optional)<br />
parameters.Add("ROUND");<br />
//6 &7 there is no need to provide empty string<br />
//for the rest of parameters since you don't want to set them<br />
After setting all the required parameters, all you need to run a tool is to call the Execute() method<br />
of the geoprocessor object. The Execute() method solicits the name of the tool and its parameters.<br />
<br />
gp.Execute("CreateThiessenPolygons_analysis", parameters, null);<br />
The following code shows the complete code for this example. In order to run the code, you need to<br />
add references to the Geoprocessing and System libraries of ArcObjects:<br />
IGeoProcessor2 gp = new GeoProcessorClass();<br />
//add the result of geoprocessing as a new layer to Map<br />
gp.AddOutputsToMap = true;<br />
//if output of geoprocessing exists before the execution of tool<br />
//it will be overwritten<br />
gp.OverwriteOutput = true;<br />
IVariantArray parameters = new VarArrayClass();<br />
//in_features<br />
parameters.Add(@"D:\DataFolder\fileGDB.gdb\cities");<br />
//out_feature_class<br />
parameters.Add(@"D:\DataFolder\fileGDB.gdb\citiesThiessen");<br />
//fields_to_copy(Optional)<br />
parameters.Add("ALL");<br />
//or parameters.Add("");<br />
gp.Execute("CreateThiessenPolygons_analysis", parameters, null);<br />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br />
<br />
The Geoprocessing library of ArcObjects is accessible through the ESRI.ArcGIS.Geoprocessing<br />
namespace. This library contains a few hundred types which can be used to run and manage tools<br />
and GIS workfl ows. You learned earlier in this section that IGeoProcessor2 is the main interface of<br />
this library and the easiest way to run a geoprocessing tool is to call its Execute() method.<br />
However, using IGeoProcessor2 is not the only approach to run a geoprocessing tool or model.<br />
There are some managed assemblies created by Esri to performing geoprocessing in a managed<br />
way. A managed way means there is a native .NET assembly (the Geoprocessor assembly) that is<br />
a wrapper for some types in the Geoprocessing library of ArcObjects, and there are other .NET<br />
assemblies for each system toolbox.<br />
These native .NET assemblies provide an even easier way to run a system tool. In general, the<br />
procedure for running a tool using the Geoprocessor-managed assembly is the same as running a tool</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-79201242308944801132014-11-25T10:31:00.001-08:002014-12-07T04:23:28.762-08:00<div dir="ltr" style="text-align: left;" trbidi="on"><h2 style="text-align: left;"><b><u>Working with Group layers through Python</u></b></h2><h4 style="text-align: left;"><b>TOOL USED</b>: arcpy.mapping</h4>Python script will be deployed in the ARC Toolbox to create the Conversion Tool<br />
WORKING OF THE TOOL:<br />
This tool will iterate through each layer in the group layer and perform operation on each layer for every iterations<br />
<h4 style="text-align: left;"><b>PROCEDURE</b>:</h4><br />
<ul style="text-align: left;"><li>Create a New Script tool in your toolbox of your ArcCatalog </li>
<li>Set any empty python code file as source file in which you are going to write your script</li>
<li>Set Output layer as input parameter and group layers as the data Type</li>
<li>Copy the following code into your python code file</li>
</ul><br />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br />
<br />
import arcpy<br />
from arcpy import env<br />
arcpy.env.overwriteOutput=1<br />
outputgrouplayer=arcpy.GetParameter(0)<br />
<br />
#Assign the output group layer to a variable, to be used later<br />
lyrs =outputgrouplayer<br />
<br />
print lyrs<br />
#Create a Mapping Layer out of the Group Layer<br />
groupLayer = arcpy.mapping.Layer(lyrs)<br />
<br />
#Get a list of all the mappping layers, the first return will be the Group Layer itself<br />
newLyrs = arcpy.mapping.ListLayers(groupLayer)<br />
<br />
#Iterate through all of the Layers (mapping layers)<br />
for lyr in newLyrs:<br />
#Because the first return is the group layer itself, we check for this, and move on<br />
if not lyr.isGroupLayer:<br />
print "Layer name is: {0}. Count is: {1}.".format(lyr.name, str(arcpy.GetCount_management(lyr)))<br />
<br />
<ul style="text-align: left;"><li><span class="Apple-tab-span" style="white-space: pre;"> </span>This will print the layer name and count of feature for every layer in the Group layer inputted</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>Run the script tool and target your group layer as the input in the parameter box. Click on Ok</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>Now it is Party time. Happy Coding</li>
</ul></div>Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-85062308218448567512014-11-25T10:21:00.002-08:002014-12-07T04:23:39.538-08:00Google Maps Photosphere<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><h2 style="clear: both; text-align: center;"><u><b><a href="http://bit.ly/1vJPpfe" rel="nofollow" target="_blank">Take a look Inside the Photosphere of Italian Mountains </a></b></u></h2><div class="separator" style="clear: both; text-align: center;"><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br />
</div><div class="separator" style="clear: both; text-align: center;"><img border="0" src="http://1.bp.blogspot.com/-1BORDslqMS8/VHISmhrWZpI/AAAAAAABg_A/x1ctbM19M6s/w737-h553-no/281e59d3-9beb-4886-9fb8-43b88e834027" height="300" width="400" /></div><div class="separator" style="clear: both; text-align: center;"> Click here---------<a href="http://bit.ly/1vJPpfe" rel="nofollow" target="_blank">http://bit.ly/1vJPpfe</a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><h2 style="clear: both; text-align: center;"><b><a href="https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAA&url=https%3A%2F%2Fwww.google.co.in%2Fmaps%2Fabout%2Fcontribute%2Fphotosphere%2F&ei=XMZ0VJbzJIGdugSEp4GoCw&usg=AFQjCNGCfVmL3K5SDIwowCV4V97Yj5kw2A&sig2=Bij4SjLrJC6Zd_HhhQStfA&bvm=bv.80185997,d.c2E" rel="nofollow" target="_blank">Create your Own Google Photosphere</a></b></h2><div style="clear: both; text-align: justify;"> The method of creating a attractive google photosphere is easy now. Now a days google is setting up camera mode to Android powered devices make user to create their own photosphere and publish and share online</div></div>Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-27802249175591317532014-11-23T09:07:00.003-08:002014-12-07T04:23:48.309-08:00Simple Geometric Network Tracing<div dir="ltr" style="text-align: left;" trbidi="on"><h2 style="text-align: left;"><u><span style="color: #3d85c6;">Trace Geoprocessing Model for Custom Tracing on your Geometric Network</span></u></h2><div><span style="color: blue; text-decoration: underline;">Tools Required:</span> Arcmap 10.0 + </div><div><br />
</div><div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br />
</div><h3 style="text-align: left;"><span style="color: #6fa8dc;"><u>Procedure</u></span></h3><div>To start with building geoprocessing Model for Tracing functionality you must first need an Geometric Network</div><div><br />
</div><div>If you doesn't have your own geometric Network with you.Please download a sample network from the Internet.Please refer arcgis site for various geometric network samples</div><div><br />
</div><div>For creating a own geometric Network for representing your own network of real world data.Please follow the steps in this link <a href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_geometric_networks/002r00000002000000/" rel="nofollow" target="_blank">Create Geometric Network</a></div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOhp9FWtRZL67d3_CtQhtJ6hSzvBfkStv09xmG4YnjFs__o0tPnvb24BeCDlda6gS_MfjmY6y0ZQMgTc7MHPdtSMWPcu8Zy1-5regjyvdbvveDGxnxSTNqG8r4dSDMkvtsBebeIf0SCd5O/s1600/tracemao.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOhp9FWtRZL67d3_CtQhtJ6hSzvBfkStv09xmG4YnjFs__o0tPnvb24BeCDlda6gS_MfjmY6y0ZQMgTc7MHPdtSMWPcu8Zy1-5regjyvdbvveDGxnxSTNqG8r4dSDMkvtsBebeIf0SCd5O/s1600/tracemao.JPG" height="179" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">Once Geometric network is downloaded or Created please add it in to the ArcMap Table of Contents.</div><div class="separator" style="clear: both; text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">To perform a tracing on your network , the network should be ready with the flow directions which help the tracing tool to perform a trace</div><div class="separator" style="clear: both; text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">Setting up a flow direction for a Network can be done in Two ways: 1.Digitized flow direction 2.Flow direction through Source and Sink</div><div class="separator" style="clear: both; text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">Follow the basic python code to setup your network Flow Direction</div><div class="separator" style="clear: both; text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: justify;"><span style="background-color: #f4cccc;"> import arcpy </span></div><div><span style="background-color: #f4cccc;"><br />
</span></div><div><span style="background-color: #f4cccc;">Water_Net = "C:/testing/GeometricNetworks/Montgomery.gdb/Water/Water_Net" </span></div><div><span style="background-color: #f4cccc;"><br />
</span></div><div><span style="background-color: #f4cccc;"> Set Flow Direction arcpy.SetFlowDirection_management(Water_Net, "WITH_DIGITIZED_DIRECTION")</span></div><div><br />
</div><div>Once the flow direction is Set. Create a new toolbar with a new model in it named as Trace model Tool</div><div><br />
</div><div>Open the model by right clicking it and select EDIT</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn-Ezzm6pD7u-sPAh2IrTxbu2oJHy81UHVC6xdv6tnYxkbOaFYJBBheibYr3mvgd0d4afhNNNQHUUaAxH5L-aVtkw30QBrIl5uRiH28d7noHEwfme95ORSs1_9T7HOsYbCkSYTOLh4GFzK/s1600/model.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn-Ezzm6pD7u-sPAh2IrTxbu2oJHy81UHVC6xdv6tnYxkbOaFYJBBheibYr3mvgd0d4afhNNNQHUUaAxH5L-aVtkw30QBrIl5uRiH28d7noHEwfme95ORSs1_9T7HOsYbCkSYTOLh4GFzK/s1600/model.JPG" height="235" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">Build the model as shown in the Figure.</div><div class="separator" style="clear: both; text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">For creating feature set .Right click and click on CREATE VARIABLE> select FEATURE SET (This features will be generated interactively during the runtime to get the flag and barrier Locations)</div><div class="separator" style="clear: both; text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">Set the Snapping environment as desired.Select the major network element such as Mains in a Water Network as the snapping feature.So that the flag and Barrier will snapping if it is placed within the snapping Tolerance</div><div class="separator" style="clear: both; text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: justify;">The Snap model Tool will work only with model builder and not with Python</div><div><br />
</div><div>Set the Trace Results as the Model parameter if you want the Traced Results to placed on the TOC.So that it will appear on the Active S<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAii5GQ-zmgnUoqfUxleKB_l3PboYJC6hFy0ofPXYKaK5ivevvk0R2C71Nn00ZaT2KewIMo_aDayAHAlnZHmHEjE04Y7XI6GPPaF9rRsm99q-AzzGnPaseDeEWFJN6wWCzKthP-qaARFXB/s1600/Model+Intercace.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAii5GQ-zmgnUoqfUxleKB_l3PboYJC6hFy0ofPXYKaK5ivevvk0R2C71Nn00ZaT2KewIMo_aDayAHAlnZHmHEjE04Y7XI6GPPaF9rRsm99q-AzzGnPaseDeEWFJN6wWCzKthP-qaARFXB/s1600/Model+Intercace.JPG" height="180" width="320" /></a></div><br />
creen.</div><div><br />
</div><div>The Model displayed above will select only the junction traced results and add the created feature layer to the map</div><div><br />
</div><div>To access the Traced Results.Please Go to GEOPROCESSING>RESULTS and Current Session will give access to the flags and Barriers Used by the Model Tool</div><div><br />
</div><div>Final Model when opened will look like this.</div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAii5GQ-zmgnUoqfUxleKB_l3PboYJC6hFy0ofPXYKaK5ivevvk0R2C71Nn00ZaT2KewIMo_aDayAHAlnZHmHEjE04Y7XI6GPPaF9rRsm99q-AzzGnPaseDeEWFJN6wWCzKthP-qaARFXB/s1600/Model+Intercace.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAii5GQ-zmgnUoqfUxleKB_l3PboYJC6hFy0ofPXYKaK5ivevvk0R2C71Nn00ZaT2KewIMo_aDayAHAlnZHmHEjE04Y7XI6GPPaF9rRsm99q-AzzGnPaseDeEWFJN6wWCzKthP-qaARFXB/s1600/Model+Intercace.JPG" height="180" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;">Traced Results</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg40ADLgBf1ZBSLLrj9Q3I3F5ijoWKeMzqgbMcYWtUCgS_pO7RMs6A-7f1u_yDGMo8l5Wra_b7CMWst1RJGKarQO711yZuoqOBoAcsJtPhiHSJrrR72nrFpinxOOqWKB5FHeAL5flOzi7e4/s1600/Results.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg40ADLgBf1ZBSLLrj9Q3I3F5ijoWKeMzqgbMcYWtUCgS_pO7RMs6A-7f1u_yDGMo8l5Wra_b7CMWst1RJGKarQO711yZuoqOBoAcsJtPhiHSJrrR72nrFpinxOOqWKB5FHeAL5flOzi7e4/s1600/Results.JPG" height="180" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;">HAPPY TRACING.,,Please comments your suggestions</div><div><br />
</div></div>Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-54817254402671579892014-11-22T11:53:00.002-08:002014-11-22T11:54:17.152-08:00Where is that ATM? <div dir="ltr" style="text-align: left;" trbidi="on">
<h1 style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-weight: normal; margin: 18px 0px 14px;">
<a href="http://www.geoconnexion.com/publications/geo-uk/issue/november-december-2014-uk-issue/article/where-is-that-atm" rel="nofollow" target="_blank"><span style="font-size: x-small;">To read the source Content</span></a></h1>
<h1 style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-weight: normal; margin: 18px 0px 14px;">
Where is that ATM? </h1>
<div class="abstract" style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-size: 16px;">
Mike Sanderson suggests how Big Data can help us make better decisions - provided we can crack the thorny issue of ontology </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
About thirty years ago we had this marketing strapline for a multi-dimensional cube analyser. It went along the lines of being able to carry out work efficiently (doing the job right) and effectively (doing the right job). Twenty years ago Hammer & Champy1 set the IT consultancy world alight with the concept of business process re-engineering (BPR). This was about doing the job right and re-organising processes accordingly. </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
The IT industry now has the tools to identify what the right job is, to go alongside our ability to engineer business processes. It’s known as Big Data in the industry. My proposition is simple, we now have tools to analyse structured and unstructured data to make better decisions, like where to find an ATM at the local supermarket. </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
Like BPR, its origins came from the consultancy world. In the Big Data phenomenon, McKinsey2 grabbed a large share of the <i>zeitgeist</i> at day one. Like most in our industry I suppose, I groaned inwardly as the cynic in me read the column inches on Big Data. After all, as Henderson said in September’s issue3, we have always had big data in spatial. The trouble is that McKinsey’s view of big data is built around personal location data – that coming from tablets and mobiles. What must we do so that the location industry plays a part? </div>
<h2 style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-size: 17px; font-weight: normal; margin: 20px 0px 5px;">
About co-ordinates </h2>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
Using location data is dangerous. Examine the two images at the top of the next page concerning the possible range of North Korean missiles. That on the left might equate to a big data answer without geodesy playing a part. That on the right ... well make up your own mind. </div>
<h2 style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-size: 17px; font-weight: normal; margin: 20px 0px 5px;">
About scale </h2>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
In thinking about this subject I came across the Data Science@Berkeley Blog on What is Big Data? The first contributor (John Akred, CTO of Silicon Valley Data Science) included these words in his contribution: </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
<i>“Advances in sensing technologies, the digitization of commerce and communications, and the advent and growth in social media are a few of the trends which have created the opportunity to use large scale, fine grained data…”. </i></div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
So I have no need to be worried about scale. It seems they get it after all, or perhaps not? As with the geodesy example, the unwary will not necessarily get the right answer. We can smile knowingly about these issues or we can help the big data users out. But before we get to how we might do this, there is one area with which the spatial industry and the big data industry both struggle. </div>
<h2 style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-size: 17px; font-weight: normal; margin: 20px 0px 5px;">
About semantics </h2>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
We can’t get to the right answer if we can’t frame a question that big data and the spatial industry jointly understand. This is not about a point-in-polygon search it’s about the ontology word that frightens everyone off. What do I mean when I say St. Pancras station? It could be the façade, the concourse, the tracks, the platforms, the hotel or all of these. But unless we know we will arrive at either the wrong answer or the wrong location. Big data will need to solve this issue if it is going to succeed. </div>
<h2 style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-size: 17px; font-weight: normal; margin: 20px 0px 5px;">
What next? </h2>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
I can think of three options where the spatial industry can play a part. There are probably others, but I do not have space for them here. Some of these ideas were also discussed last month by Millard (Frankenstein’s Data, GeoConnexion, Sep 2014) I am just trying to formalise them here. They are: </div>
<ul style="background-color: white; border-top-width: 0px; color: #222222; float: left; font-family: OpenSansSemibold, Verdana; font-size: 12px; list-style-position: outside; margin: 0px 0px 5px; padding: 10px 0px 10px 20px; text-decoration: underline; width: 580px;">
<li style="float: left; margin-bottom: 4px; width: 580px;">Intermediate </li>
<li style="float: left; margin-bottom: 4px; width: 580px;">Add co-ordinates to enterprise data </li>
<li style="float: left; margin-bottom: 4px; width: 580px;">Provide a platform to assure data quality. </li>
</ul>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
<b>Intermediate:</b> This involves taking the complexity of scale and geodesy out of spatial data for the non-spatial user. The user interface will have to solve the ontology issue described above and as Millard describes the customer will want to know what the costs and benefits are of using open data only, a mixture of open and licensed data or licensed data only. </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
<b>Add co-ordinates to enterprise data:</b> The biggest issue is that most enterprise data does not have geo co-ordinates attached. So all those work orders in asset intensive industries raised through Enterprise Management work management applications; the financial markets buy and sell orders are two examples where geo co-ordinates are not entered typically. In these examples we may be trying to optimise work planning or detect fraud in the latter example. The 1990s solution to these challenges involved heavy lifting of data and trying to integrate GIS and work management applications. That hasn’t worked effectively. </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
Our industry has been good at geocoding and reverse geocoding but tended to internalise the results of these operations within the GIS. It’s time to do it the other way around and if a map is the required output, then interface. </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
<b>Provide a platform to assure data quality:</b> I would contend that it is not enough to let the market decide what represents a good quality data set. As I have described above, and others have also, spectacular failures can occur when spatial data are misused. 1Spatial has provided a cloud-based platform for nearly five years for users to test data for geometric and topological consistency as part of a triple A data approach. </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
The genie is out of the bottle in terms of personal location data being available to big data decision-makers (and it has been to governmental decision-makers for even longer), so I can do no better than quote Dr. Brian T. Gray, Assistant Deputy Minister, Earth Sciences Sector, Natural Resources Canada: </div>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
<i>“Canadian government departments are working together to launch the Federal Geospatial Platform to enable online discovery, access, integration and visualization of multiple layers of accurate, authoritative and accessible geospatial information. That way users can search once and find everything.”</i> </div>
<h2 style="background-color: white; color: #222222; font-family: AdelleBasic-Bold, Times, Georgia; font-size: 17px; font-weight: normal; margin: 20px 0px 5px;">
Conclusion </h2>
<div style="background-color: white; color: #222222; font-family: OpenSansSemibold, Verdana, Arial, sans-serif; font-size: 12px; margin-bottom: 10px; margin-top: 5px;">
So will the combination of BPR and Big Data make organisations more effective and more efficient? The answer to that is yes if the GIS industry helps the enterprise handle location more easily. And we will both benefit from working together to crack the ontology problem.</div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-91503014935270308262014-11-21T11:13:00.000-08:002014-12-07T04:24:30.438-08:00Working with Group layers through Python<div dir="ltr" style="text-align: left;" trbidi="on"><h1><br />
<u><span lang="EN-US" style="font-size: 20.0pt; line-height: 115%; mso-bidi-font-size: 14.0pt;">Working with Group layers through Python<o:p></o:p></span></u></h1><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br />
<div class="MsoNormal"><span lang="EN-US"> This tool will be helpful in accessing the Trace Managaement Results</span></div><div class="MsoNormal"><b><u><span lang="EN-US" style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">TOOL USED</span></u></b><span lang="EN-US" style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">:</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"> arcpy.mapping</span><span lang="EN-US"><o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">Python script will be deployed in the ARC Toolbox to create the Conversion Tool <o:p></o:p></span></div><div class="MsoNormal"><b><u><span lang="EN-US" style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">WORKING OF THE TOOL</span></u></b><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">:<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">This tool will iterate through each layer in the group layer and perform operation on each layer for every iterations </span><span lang="EN-US"><o:p></o:p></span></div><div class="MsoNormal"><b><u><span lang="EN-US" style="color: #548dd4; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">PROCEDURE:<o:p></o:p></span></u></b></div><div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">Create a New Script tool in your toolbox of your ArcCatalog <o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">Set any empty python code file as source file in which you are going to write your script<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">Set Output layer as input parameter and group layers as the data Type<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">Copy the following code into your python code file<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast"><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span lang="EN-US">import arcpy<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">from arcpy import env<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">arcpy.env.overwriteOutput=1<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">outputgrouplayer=arcpy.GetParameter(0)<o:p></o:p></span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span lang="EN-US">#Assign the output group layer to a variable, to be used later<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">lyrs =outputgrouplayer<o:p></o:p></span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span lang="EN-US">print lyrs<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">#Create a Mapping Layer out of the Group Layer<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">groupLayer = arcpy.mapping.Layer(lyrs)<o:p></o:p></span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span lang="EN-US">#Get a list of all the mappping layers, the first return will be the Group Layer itself<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">newLyrs = arcpy.mapping.ListLayers(groupLayer)<o:p></o:p></span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span lang="EN-US">#Iterate through all of the Layers (mapping layers) <o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US">for lyr in newLyrs:<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US"> #Because the first return is the group layer itself, we check for this, and move on<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US"> if not lyr.isGroupLayer:<o:p></o:p></span></div><div class="MsoNormal"><span lang="EN-US"> print "Layer name is: {0}. Count is: {1}.".format(lyr.name, str(arcpy.GetCount_management(lyr)))<o:p></o:p></span></div><div class="MsoNormal"></div><ul style="text-align: left;"><li>This will print the layer name and count of feature for every layer in the Group layer inputted</li>
<li> Run the script tool and target your group layer as the input in the parameter box. Click on Ok</li>
<li>Now it is Party time. Happy Coding</li>
</ul><br />
</div>Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-67733558209180470202014-11-20T09:56:00.002-08:002014-12-07T04:24:42.586-08:00Feature Count using Model Builder<div dir="ltr" style="text-align: left;" trbidi="on"><div><h2 style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; margin: 0.75em 0px; padding: 0px; position: relative;"><div style="color: red; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;"><span style="color: red;">Software Required:</span></div><div style="color: red; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;"><ol style="list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; outline: none; padding: 0px 0px 0px 2em;"><li style="margin: 0px; outline: none; padding: 0px;"><span style="line-height: 19.6000003814697px;">ArcMap 10.2 or more</span></li>
</ol></div><div style="color: red; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;"><br />
</div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br />
<div style="color: red; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;"><b>Procedure:</b></div><div style="margin: 0px; outline: none; padding: 0px;"><ul style="font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; outline: none; padding: 0px 0px 0px 2em;"><li style="margin: 0px; outline: none; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small; font-weight: normal;">Open ArcMap 10.2+ </span></li>
<li style="margin: 0px; outline: none; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small; font-weight: normal;">Goto Window > Show ArcCatalog</span></li>
<li style="margin: 0px; outline: none; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small; font-weight: normal;">ArcCatalog Right Click on the Default GeoDatabase and Create New Feature Class.Give a name for the new feature class and Click Finish</span></li>
<li style="margin: 0px; outline: none; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small; font-weight: normal;">Add a New Model to the Database New > Model Tool after creating a New ToolBox</span></li>
<li style="margin: 0px; outline: none; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small; font-weight: normal;">Add Get Count and Calculate Value to the New Model</span></li>
<li style="margin: 0px; outline: none; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small; font-weight: normal;">Set GetCount Ouput Value as the Precondition for Calculate Value</span></li>
<li style="margin: 0px; outline: none; padding: 0px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: small; font-weight: normal;">Add the following procedure for the Calculate value Model</span></li>
</ul></div></h2></div><span style="color: red;"></span><br />
<div style="font-weight: bold;"><span style="color: red;"><br />
</span></div><span style="color: red;"></span><br />
<div style="font-weight: bold;"><span style="color: red;"><br />
</span></div><div class="separator" dir="rtl" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp3PdMUBJ6QzeZDgP183832e692xOImbPDWdwLTKbYq2orXvlmhnCxUK4KASu260hHfnycgkD1HYybazzy0F6_ReiJfS8bAZg22TwtEiWqdD0str_PlFTi6xW-dxDAm7fEc-n-y5fSe-fV/s1600/IfelseStatement.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp3PdMUBJ6QzeZDgP183832e692xOImbPDWdwLTKbYq2orXvlmhnCxUK4KASu260hHfnycgkD1HYybazzy0F6_ReiJfS8bAZg22TwtEiWqdD0str_PlFTi6xW-dxDAm7fEc-n-y5fSe-fV/s1600/IfelseStatement.PNG" height="390" width="640" /></a></div><div style="font-weight: bold;"><b><span style="color: red;"><br />
</span></b></div><span style="color: red;"><b>Expression</b></span><br />
<br />
CountMe(%RowCount%)<br />
<div><br />
</div><div><b><span style="color: red;">Code Block</span></b></div>def CountMe(n):<br />
<div> if n > 0: </div><div> return "true" </div><div> else: </div><div> return "false"</div><div><br />
</div><div><br />
</div><div><br />
</div><div>The Output of the Calculate Value Model is Boolean(True or False).Setting the output value of Calculate Value as the Precondition for the desired Model will make it model to run only when the output is True</div></div>Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0tag:blogger.com,1999:blog-6160704651188967740.post-2760796495441091902014-11-19T10:11:00.000-08:002014-12-07T03:00:04.815-08:00ESRI Addin Button to Zoom to Selected Layer in TOC<div dir="ltr" style="text-align: left;" trbidi="on">
<h2>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;">
<span style="color: red; font-size: small;">Software Required:</span></div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;">
<ol style="text-align: left;">
<li><span style="font-size: small; line-height: 19.6000003814697px;">Microsoft Visual Studio 2010 +</span></li>
<li><span style="font-size: small; line-height: 19.6000003814697px;">ArcMap 10.2 or more</span></li>
<li><span style="font-size: small; line-height: 19.6000003814697px;">ArcObjects SDK for .Net Installed</span></li>
</ol>
</div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;">
<span style="font-size: small;"><br /></span></div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;">
<b><span style="color: red; font-size: small;">Procedure:</span></b></div>
<div style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; margin: 0px; outline: none; padding: 0px;">
<span style="font-size: small;"><br /></span></div>
<div style="background-color: white; margin: 0px; outline: none; padding: 0px;">
<ul style="font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: normal; line-height: 19.6000003814697px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; outline: none; padding: 0px 0px 0px 2em;">
<li style="color: #333333; margin: 0px; outline: none; padding: 0px;"><span style="font-size: small;">Open Visual Studio 2010</span></li>
<li style="color: #333333; margin: 0px; outline: none; padding: 0px;"><span style="font-size: small;">Create a <b><span style="color: #274e13;">New Project > Visual C#> ArcGIS>Desktop Addins >ArcMap </span></b><span style="color: #274e13;"><b>Add In</b></span></span></li>
<li style="color: #333333; margin: 0px; outline: none; padding: 0px;"><span style="font-size: small;">ArcMap Addin Wizard will appear on the Screen.Give a desired name for your Addin and click <span style="color: magenta;">Next</span></span></li>
<li style="color: #333333; margin: 0px; outline: none; padding: 0px;"><span style="font-size: small;">In the Addin Types <b>Enable Button </b>checkbox and provide description for it.This will appear as a button tooltip in your ArcMap application.Click finish to end the wizard.</span></li>
<li style="color: #333333; margin: 0px; outline: none; padding: 0px;"><span style="font-size: small;">Now go the Solution Explorer(View>Soln Explorer) and open the Addinname.cs file if it doesn't appear in your screen.</span></li>
<li style="margin: 0px; outline: none; padding: 0px;"><span style="font-size: small;"><span style="color: #333333;">Replace the content of the file with the following data on the</span><span style="color: purple;"> onclick() method </span><span style="color: #333333;">of the button.cs file.</span></span></li>
<li style="color: #333333; margin: 0px; outline: none; padding: 0px;"><span style="font-size: small;">Add the References(Right click references in Solution Explorer and select Add References) based on your classes usage</span></li>
</ul>
<div>
<span style="color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19.6000003814697px;">C#</span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19.6000003814697px;"></span></span><br />
<div>
<span style="color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19.6000003814697px;">protected override void OnClick()</span></span></div>
<span style="color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19.6000003814697px;">
</span></span>
<div>
<span style="color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19.6000003814697px;"> {</span></span></div>
<span style="color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; line-height: 19.6000003814697px;">
</span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; font-weight: normal; line-height: 19.6000003814697px;">IMxDocument mdoc = ArcMap.Application.Document as IMxDocument;</span></span></div>
<div>
<span style="font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; font-weight: normal; line-height: 19.6000003814697px;"></span></span><br />
<div>
<span style="font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; font-weight: normal; line-height: 19.6000003814697px;"><span style="color: blue;">//the following two lines of code are the same</span></span></span></div>
<span style="font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; font-weight: normal; line-height: 19.6000003814697px;">
</span></span>
<div style="color: #333333;">
<span style="font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; font-weight: normal; line-height: 19.6000003814697px;">IActiveView activeView = mdoc.ActiveView;</span></span></div>
<span style="font-family: Helvetica Neue Light, HelveticaNeue-Light, Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="font-size: 14px; font-weight: normal; line-height: 19.6000003814697px;">
<div style="color: #333333;">
//IActiveView activeView = mdoc.FocusMap as IActiveView;</div>
<div>
<span style="color: blue;">//get the selected layer in the Table of Contents</span></div>
<div style="color: #333333;">
ILayer lr = mdoc.SelectedLayer;</div>
<div>
<span style="color: blue;">//check if there is a selected layer or not</span></div>
<div style="color: #333333;">
if (lr != null)</div>
<div style="color: #333333;">
{</div>
<div style="color: #333333;">
activeView.Extent = lr.AreaOfInterest;</div>
<div style="color: #333333;">
//invoking Refresh method</div>
<div style="color: #333333;">
//results in redrawing the whole view</div>
<div style="color: #333333;">
activeView.Refresh();</div>
<div style="color: #333333;">
}</div>
<div style="color: #333333;">
}</div>
<div style="color: #333333;">
<ul style="line-height: 19.6000003814697px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; outline: none; padding: 0px 0px 0px 2em;">
<li style="margin: 0px; outline: none; padding: 0px;">Save your Current project .Don't run your Code.</li>
<li style="margin: 0px; outline: none; padding: 0px;">Go to Properties>Addinname Properties>Debug option.Set your ArcMap as the External program for debugging the code</li>
<li style="margin: 0px; outline: none; padding: 0px;">Run the Code.</li>
<li style="margin: 0px; outline: none; padding: 0px;">ArcMap Application will now open.Go to Customize>Customize mode>Command.Right now you will see your Addin name in the category list click on it, respective button will get displayed on the rightcommands window.</li>
<li style="margin: 0px; outline: none; padding: 0px;">Drag the Button and put it in the Menu bar.</li>
<li style="margin: 0px; outline: none; padding: 0px;">You get the ESRI Addin file bin>Debug folder of your project location</li>
<li style="margin: 0px; outline: none; padding: 0px;">Now its party time :) Share your work with other through the Addin file</li>
</ul>
</div>
</span></span></div>
</div>
</h2>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0Asia16.299051014581831 79.8046875-14.485582985418169 38.4960935 47.083685014581832 121.1132815tag:blogger.com,1999:blog-6160704651188967740.post-19584773336816178762014-11-19T09:33:00.000-08:002014-12-24T04:32:31.045-08:00Create a Display Flow Arrows Addin<div dir="ltr" style="text-align: left;" trbidi="on">
<b></b><br />
<h1>
<b>ArcMAP ESRI Add-in for Display flow arrows for Utility Geometric Network</b></h1>
<br />
<div>
</div>
<div>
<span style="color: red;">Software Required:</span></div>
<div>
Microsoft Visual Studio 2010 +</div>
<div>
ArcMap 10.2 or more</div>
<div>
ArcObjects SDK for .Net Installed</div>
<div>
<br /></div>
<div>
<b><span style="color: red;">Procedure:</span></b></div>
<div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57419548-1', 'auto');
ga('send', 'pageview');
</script><br /></div>
<div style="text-align: left;">
<ul style="text-align: left;">
<li>Open Visual Studio 2010</li>
<li>Create a <b><span style="color: #274e13;">New Project > Visual C#> ArcGIS>Desktop Addins >ArcMap </span></b><span style="color: #274e13;"><b>Add In</b></span></li>
<li>ArcMap Addin Wizard will appear on the Screen.Give a desired name for your Addin and click <span style="color: magenta;">Next</span></li>
<li>In the Addin Types <b>Enable Button </b>checkbox and provide description for it.This will appear as a button tooltip in your ArcMap application.Click finish to end the wizard.</li>
<li>Now go the Solution Explorer(View>Soln Explorer) and open the Addinname.cs file if it doesn't appear in your screen.</li>
<li>Replace the content of the file with the following data.</li>
<li>Add the References(Right click references in Solution Explorer and select Add References) based on your classes usage</li>
</ul>
</div>
<div>
<br /></div>
<div>
<div>
<br /></div>
<div>
<span style="color: blue;">//Add the references in to the current namespace</span></div>
<div>
using System;</div>
<div>
using System.Collections.Generic;</div>
<div>
using System.Text;</div>
<div>
using System.IO;</div>
<div>
using ESRI.ArcGIS.ArcMapUI;</div>
<div>
using ESRI.ArcGIS.Carto;</div>
<div>
using ESRI.ArcGIS.EditorExt;</div>
<div>
using ESRI.ArcGIS.Framework;</div>
<div>
using ESRI.ArcGIS.esriSystem;</div>
<div>
using ESRI.ArcGIS.Editor;</div>
<div>
using ESRI.ArcGIS.NetworkAnalystTools;</div>
<div>
using ESRI.ArcGIS.Geometry;</div>
<div>
using ESRI.ArcGIS.Geodatabase;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
namespace Flow</div>
<div>
{</div>
<div>
public class FlowArrow : ESRI.ArcGIS.Desktop.AddIns.Button</div>
<div>
{</div>
<div>
<span style="color: blue;">//Declare the interface Variable</span></div>
<div>
public IUtilityNetworkAnalysisExtFlow utilarr;</div>
<div>
public IUtilityNetworkAnalysisExt utilflow;</div>
<div>
public INetworkAnalysisExt netExt;</div>
<div>
<br /></div>
<div>
public FlowArrow()</div>
<div>
{</div>
<div>
<span style="color: blue;">//Get the reference to the Utility Analyst Toolbar using the UID Reference</span></div>
<div>
UID pUID = new UIDClass();</div>
<div>
pUID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";</div>
<div>
netExt = ArcMap.Application.FindExtensionByCLSID(pUID) as INetworkAnalysisExt;</div>
<div>
<br /></div>
<div>
UID uidutilflow = new UIDClass();</div>
<div>
uidutilflow.Value = "esriEditorExt.UtilityNetworkAnalysisExt";</div>
<div>
utilflow = ArcMap.Application.FindExtensionByCLSID(uidutilflow) as IUtilityNetworkAnalysisExt;</div>
<div>
<br /></div>
<div>
</div>
<div>
</div>
<div>
}</div>
<div>
<br /></div>
<div>
protected override void OnClick()</div>
<div>
{</div>
<div>
message m = new message();</div>
<div>
</div>
<div>
IGeometricNetwork gn = null;</div>
<div>
</div>
<div>
<span style="color: blue;"> // get the current network</span></div>
<div>
<br /></div>
<div>
IMxDocument mxd=ArcMap.Application.Document as IMxDocument;</div>
<div>
IMap map=mxd.FocusMap;</div>
<div>
IActiveView av = map as IActiveView;</div>
<div>
gn = netExt.CurrentNetwork;</div>
<div>
<br /></div>
<div>
if (gn != null && utilflow!= null)</div>
<div>
{</div>
<div>
utilflow = netExt as IUtilityNetworkAnalysisExt;</div>
<div>
utilarr = utilflow as IUtilityNetworkAnalysisExtFlow;</div>
<div>
utilarr.ShowFlow = !(utilarr.ShowFlow);</div>
<div>
av.Refresh();</div>
<div>
}</div>
<div>
<br /></div>
<div>
</div>
<div>
</div>
<div>
// refresh the display to update the flow direction arrows</div>
<div>
IActiveView mapView = ArcMap.Document.ActiveView;</div>
<div>
mapView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);</div>
<div>
<br /></div>
<div>
}</div>
<div>
protected override void OnUpdate()</div>
<div>
{</div>
<div>
//Enable the Button once the operation is Successful</div>
<div>
//Enabled=True;</div>
<div>
}</div>
<div>
<br /></div>
<div>
</div>
<div>
</div>
<div>
}</div>
<div>
<br /></div>
<div>
}</div>
</div>
<div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF44AvrMFTjM111CfZiO9tOo5WJZWEwIj9Vmzad69j8IQBN8zOmwPY5lQrPBWp5-aIMyN-zWTx8y_TeScqXqW4pfTCZ9gOIVQ6qak-0B7jsVtFt3zYPMOniSynTMKm4v09_clst_7tV6tz/s1600/flow+arrow.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Code to get flow arrow using ArcObjects" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF44AvrMFTjM111CfZiO9tOo5WJZWEwIj9Vmzad69j8IQBN8zOmwPY5lQrPBWp5-aIMyN-zWTx8y_TeScqXqW4pfTCZ9gOIVQ6qak-0B7jsVtFt3zYPMOniSynTMKm4v09_clst_7tV6tz/s1600/flow+arrow.jpg" height="228" title="Display flow arrow using ArcObjects" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Display flow arrow using Arcobjects</td></tr>
</tbody></table>
<br /></div>
<div>
<ul style="text-align: left;">
<li>Save your Current project .Don't run your Code.</li>
<li>Go to Properties>Addinname Properties>Debug option.Set your ArcMap as the External program for debugging the code</li>
<li>Run the Code.</li>
<li>ArcMap Application will open.Now go to Customize>Customize mode>Command.Right now you will see your Addin name in the category list click on it.After that the button will get displayed on the commands window.</li>
<li>Drag the Button and put it in the Menu bar.</li>
<li>You get the ESRI Addin file bin>Debug folder of your project location</li>
<li>Now its party time :) Share your work with other through the Addin file</li>
</ul>
</div>
<div>
<br /></div>
<div>
<b><span style="color: #274e13;"><br />
</span></b></div>
<div>
<b><span style="color: #274e13;"><br />
</span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0Asia34.047863 100.61965529999998-41.757562 -64.614719700000023 90 -94.145969700000023tag:blogger.com,1999:blog-6160704651188967740.post-12872449894194480162014-10-20T21:00:00.005-07:002014-12-07T02:56:21.578-08:00News - Global Mapper SDK v16 Released with Dramatically Faster Data Processing<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white;"><strong style="color: #222222; font-family: 'Segoe UI';"><span style="font-size: large;">Hallowell, Maine – October 15, 2014 </span>(source : </strong></span><span style="color: #222222; font-family: Segoe UI;"><b>10.giscafe.com)</b></span><br />
<span style="background-color: white;"><span style="color: #222222;"><span style="font-family: Trebuchet MS, sans-serif;"><br />
</span></span></span> <span style="background-color: white;"><span style="color: #222222;"><span style="font-family: Trebuchet MS, sans-serif;">Blue Marble Geographics (</span></span><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www10.giscafe.com/goto.php?http://bluemarblegeo.com/" style="color: #1155cc; text-decoration: none;" target="_blank">bluemarblegeo.com</a><span style="color: #222222;">) is pleased to announce the release of the Global Mapper Software Development Kit (SDK) version 16. This major release features a significant improvement in data processing speeds and several exciting new options for working with 3D data. Blue Marble's geospatial data manipulation, visualization and conversion solutions are used worldwide by thousands of GIS analysts at software, oil and gas, mining, civil engineering, surveying, and technology companies, as well as governmental and university organizations.</span></span></span><span style="font-family: Trebuchet MS, sans-serif;"><span style="background-color: white;"> </span><br style="background-color: white; color: #222222;" /><br style="background-color: white; color: #222222;" /><span style="background-color: white; color: #222222;">Global Mapper is an affordable and easy-to-use GIS application capable of displaying, converting, and analyzing virtually any type of geospatial data. With the Global Mapper SDK, developers can leverage these powerful functions from within their own software applications, saving time and money in the development process. The SDK includes both native 32-bit and 64-bit DLL's, which can be utilized in any Windows operating system.</span><span style="background-color: white;"> </span><br style="background-color: white; color: #222222;" /><br style="background-color: white; color: #222222;" /><span style="background-color: white; color: #222222;">The version 16 release features dramatically faster data processing speeds for manipulating and analyzing even the largest GIS datasets. Additional improvements include support for multiprocessor architecture allowing developers to leverage multiple cores, significantly reducing the processing time required for operations like contour generation, view shed calculations, and gridding 3D data. In addition to multithreading and the traditional two dimensional data processing enhancements, version 16 also includes many significant updates for working with cutting edge 3D datasets. Some of the most impressive new features include support for creating and enabling the recording of HD fly-through videos, the ability to allow users to create skyboxes in the 3D Viewer, tracking GPS routes in the 3D Viewer, support for 3D textures and meshes and many new 3D formats.</span><span style="background-color: white;"> </span><br style="background-color: white; color: #222222;" /><br style="background-color: white; color: #222222;" /><span style="background-color: white; color: #222222;">"We encourage all geospatial programmers to take a look at the Global Mapper SDK," stated Blue Marble President Patrick Cunningham "Whether you're looking for additional functionality for your software product or a custom project, the tool is powerful and easy to use, and for LiDAR, there is nothing like it on the market today."</span><span style="background-color: white;"> </span><br style="background-color: white; color: #222222;" /><br style="background-color: white; color: #222222;" /><span style="background-color: white;"><span style="color: #222222;">Additionally, there are a host of new LiDAR tools, including automatic reclassification and feature extraction for buildings and trees. For a complete list of new features and enhancements or to download Global Mapper SDK today.</span></span></span><br />
<br style="background-color: white; color: #222222;" />
<span style="font-family: Trebuchet MS, sans-serif;"><span style="background-color: white; color: #222222;"><strong>About Blue Marble Geographics:</strong><br />
<br />
Blue Marble Geographics of Hallowell, Maine is a leading developer and provider of software products and services for highly accurate geospatial data conversion solutions. Blue Marble is known for their coordinate conversion and file format expertise and is the developer of The Geographic Calculator, GeoCalc SDK, Global Mapper, LiDAR Module for Global Mapper, and Global Mapper SDK. The company has been writing GIS software tools and solutions for over twenty years and currently serves hundreds of thousands of users worldwide.</span><span style="background-color: white;"> </span></span></div>
Anonymoushttp://www.blogger.com/profile/00606560498711076550noreply@blogger.com0