Tuesday, December 8, 2009

ArcTool Box, The Real one :)




Thanks to Mohammad Aouad

Saturday, November 28, 2009

Dynamic Charting for ArcGIS Desktop






Found something interesting about Dynamic Charting in ArcGIS Desktop..finally we could so something like this:




Take a look at the full article HERE

Thursday, November 26, 2009

Advanced Large Scale Applications with Silverlight at PDC 09

Here is a nice presentation by john papa about building large scale silverlight applications, i recommend you to watch it, i will include links for the video, presentation and the source code for a demo presented...Enjoy

Video

Presentation

Demo Source Code

Thursday, November 12, 2009

What is new in ArcGIS 9.4

Hi All,
See this video from Esri site that explains the major 9 features coming in ArcGIS 9.4

Monday, October 12, 2009

Easy ArcGIS Library Initiated

I'm glad to announce the birth of my new project Easy ArcGIS Library or (EAGL) ;)
EAGL is a set for .net assemblies that make working with ArcGIS common tasks easy and direct.
EAGL is an example of the Facade design pattern where you have a complex system with a lot of functionalities (ArcObjects) and you access 20% of this functionality 80% of times.
EAGL will make accessing that 20% part easy an direct.

I've hosted my new project on Google codes, and I'm using subversion as my revision control system.
EAGL was created using C# .net (3.5).

All contributors are welcome, we need for now a documentation writer ;)

Download EAGL 1.0 from here

Sunday, October 11, 2009

Exporting Source Code to HTML

In my previous post I had to post some code in it, so I googled for a tool to export my C# code to HTML, I found a tool called C# Export and used it in combination with MS Word with the save HTML filtered option, the result was fine, but I didn't like writing in Word and decided to search for a good WYSIWYG HTML editor.
Any way to get back to main subject, to export your source code to HTML get Notepad ++, which is a free great editor that has many plug-ins, one of them called NP export did and amazing job in exporting my code to HTML, a lot of programming languages are supported.

Links:
Notepad++ Site
Download Notepad++

Friday, October 9, 2009

Data Tranfer between workspaces

Preface

Copying data between workspaces is a day-to-day piece of work for ArcGIS users, and so for developers.

In this article I’m going to show you how to use ArcObjects to copy data between different workspaces.

Actually there are many approaches for doing so in ArcGIS, each of them has some limitation in its functionality, after doing some research on the subject I found that you could transfer data between workspaces in one of these ways:

1- Write a manual code to do the operation from scratch.

2- Use the IDataset.Copy().

3- Use Geoprocessor object.

4- Use IFeatureDataConverter interface.

5- Use IGeoDBDataTransfer interface.

So as I said each of the above ways has some limitation in functionality, IDataset.Copy as the help says: “should only be used with datasets from file-based data sources, such as shapefiles and coverages”, Geoprocessor is great but I had some difficulties passing an ArcSDE workspace as a parameter to the copy tool, that keep IFeatureDataConverter and IGeoDBDataTransfer, I tried both of them and they seem to work fine. So we will see now two examples on using IFeatureDataConverter and IGeoDBDataTransfer to copy a feature class from workspace to another.

A. Using IFeatureDataConverter

The interface IFeatureDataConverter has only one implementer class which is FeatureDataConverter, the beauty of this class is that it checks for field naming conflicts and removes them using IFieldChecker.

I’ll try to make my examples simple and clear, and this is difficult when working with ArcObjects (You know).

So our main goal is to copy a feature class from one workspace to another using IFeatureDataConverter using ConvertFeatureClass method.

This method is defined like:

public IEnumInvalidObject ConvertFeatureClass (

IFeatureClassName InputDatasetName,

IQueryFilter InputQueryFilter,

IFeatureDatasetName outputFDatasetName,

IFeatureClassName outputFClassName,

IGeometryDef OutputGeometryDef,

IFields OutputFields,

string configKey,

int FlushInterval,

int parentHWND

);

What is important to us is underlined.

So the main steps for this approach would be:

1- Get the FeatureClassName from input FeatureClass.

2- Get the WorkspaceName from input FeatureClass to be used with IFieldChecker later.

3- Create new FeatureClassName with the new name and supplied workspace.

4- Get the fixed Fields from FieldChecker.

5- Call the ConvertFeatureClass method of FeatureDataConverter.

Code

public void ConvertFeatureClass(IFeatureClass inFeatureClass, IWorkspace outWorkspace, string newName)
{
// get FeatureClassName for input
IDataset inDataset = inFeatureClass as IDataset;
IFeatureClassName inFeatureClassName = inDataset.FullName as IFeatureClassName;
IWorkspace inWorkspace = inDataset.Workspace;

// get WorkSpaceName for output
IDataset outDataset = outWorkspace as IDataset;
IWorkspaceName outWorkspaceName = outDataset.FullName as IWorkspaceName;

// Create new FeatureClassName
IFeatureClassName outFeatureClassName = new FeatureClassNameClass();
// Assign it a name and a workspace
IDatasetName datasetName = outFeatureClassName as IDatasetName;
datasetName.Name = newName == "" ? (inFeatureClassName as IDatasetName).Name : newName;
datasetName.WorkspaceName = outWorkspaceName;

// Check for field conflicts.
IFieldChecker fieldChecker = new FieldCheckerClass();
IFields inFields = inFeatureClass.Fields;
IFields outFields;
IEnumFieldError enumFieldError;
fieldChecker.InputWorkspace = inWorkspace;
fieldChecker.ValidateWorkspace = outWorkspace;
fieldChecker.Validate(inFields, out enumFieldError, out outFields);
// Check enumFieldError for field naming confilcts

//Convert the data.
IFeatureDataConverter featureDataConverter = new FeatureDataConverterClass();
featureDataConverter.ConvertFeatureClass(inFeatureClassName, null, null,
outFeatureClassName, null, outFields, "", 100, 0);
}


The above function converts (Copy) the supplied feature class to the targeted workspace, if no name provided it will use the name of the supplied feature class.

B. Using IGeoDBDataTransfer

The use of GeoDBDataTranfer is used in ArcCatalog for copy and paste oprations, so I really prefer this way.

The main steps for this approach would be:

1- Get the name Objects from input.

2- Prepare Transfer parameters (IEnumName and IName).

3- Generate Name Mappings.

4- Do the transfer.

Code:

private void transferData(IFeatureClass sourceFeatureClass, IWorkspace targetWorkspace)
{
// Get Name Objects
IDataset ds1 = sourceFeatureClass as IDataset;
IDataset ds2 = targetWorkspace as IDataset;
IFeatureClassName fcName = ds1.FullName as IFeatureClassName;
IWorkspaceName2 targetWSName = ds2.FullName as IWorkspaceName2;

// Prepare Transfer Parameters
IName fromName = fcName as IName;
IName toName = targetWSName as IName;

// Prepare input enum and add fromName to it
IEnumName fromNameEnum = new NamesEnumerator();
IEnumNameEdit fromNameEnumEdit = (IEnumNameEdit)fromNameEnum;
fromNameEnumEdit.Add(fromName);

// Generate name Mapping
IGeoDBDataTransfer transferer = new GeoDBDataTransferClass();
IEnumNameMapping fromMapping;
bool v = transferer.GenerateNameMapping(fromNameEnum, toName, out fromMapping);

// Do The Transfer
transferer.Transfer(fromMapping, toName);
}


Note: The above approach doesn’t support old file based Workspaces (Shape Files, Coverages), to copy those you can use IDataset.Copy method.

Note: The class GeoDBDataTransfer implements the interface IFeatureProgress so you can show a user a feedback about the copy operation progress, but although they say in the help that Step is an event of type some delegate you can’t use this interface in .net because it is not supported.


I hope this was useful for you, and hope to see some feed back.

Wednesday, October 7, 2009

Not Only ArcGIS Server

Hello all again,
It seems very difficult to have free time for blogging, especially when you have such a pressure on a "Lgical" dead line...

Anyway this is not a techical article, it is just a warm up...

Our Blog title says ArcGIS server, but never mind you will find articles on many subjects, not considering ArcGIS server is the main topic in this blog...

We will focus on:
- ArcObjects programming for Desktop, Engine, Server, Mobile platforms.
- ADF
- General articles and tutorials in programming using C#, ASP.net
- Some non-technical articles

I know .. I know it seems good... I just hope this was a real warming up...

Monday, October 5, 2009

Hello

Hello All,,
Thanks Nour for the invitation.

Sunday, March 22, 2009

ArcGIS API for Microsoft Silverlight™/WPF™ is available as a public BETA

as i heard, it was suppose to be after the developer summit, but its been released as a BETA and version 1.0 BETA will be released in the developer summit Match 26.

what Silverlight API Can Do:

The ArcGIS API for Microsoft Silverlight™/WPF™ enables you to create rich internet and desktop applications that utilize the powerful mapping, geocoding, and geoprocessing capabilities provided by ArcGIS Server and Microsoft Virtual Earth™ services. The API is built on the Microsoft Silverlight/WPF platform which is integrated with Visual Studio 2008 and Visual Web Developer Express 2008. The Microsoft Silverlight platform includes a lightweight version of the .NET Framework CLR (CoreCLR) and the Silverlight runtime - all hosted via a browser plug-in.


Download the Silverlight API HERE

Getting Started with Silverlight API HERE

Silverlight API Samples HERE

Live Samples HERE

ArcGIS Server Silverlight Resource Page

Saturday, February 14, 2009

Arcgis Server Network Analyst Extension (Shortest Path)

GID Directory (Network Analyst Extension) - Still Under Development

Silvelight API OR Flex API ?? Confused ?

With the announcement that Silverlight API is to be released soon with almost the same capabilities as Flex API, I Was at the beginning bit confused which path to take, for me, i guess that popularity matters, Flash has 90% of the market, well 90% becauase its been out since almost 10 years, will silverlight be popularand used by others, well i have to say, just like flash when it started, Im a .NET guy, so why to start over a new thing, i'll do silverlight to ArcGIS Server since its based on the .NET Framework. I Found an Article that is really good and makes good sense. here

Silverlight 2.0 Books Remommedation

Silverlight API for ArcGIS Server was announced to be realeased in the Developer Summit March 26, so i thought i'll learn some Silverlight, im currently reading the from the following books and recommending them to others.

Wiley - Silverlight 2 Bible
APress - Pro Silverlight 2 in C#

Tuesday, February 3, 2009

Getting Familiar with LINQ

As i keep hearing more and more about silverlight API for ArcGIS Server, i thought i'll start learning silverlight seriously since that i really couldn't go deep into flex due to load of projects, one of the things you really need to know in .NET 3.5 frame in LINQ, i have been always doing SQL but in LINQ you have to reverse the QUERY, :)

I Found a perfect LINQ Samples for C# HERE and i hope that it helps others.

Monday, February 2, 2009

Google Earth 5 BETA Release

Google Earth version 5 has just been released with some new features

* Historical imagery from around the globe
* Ocean floor and surface data from marine experts
* Simplified touring with audio and voice recording

you can download it HERE

Saturday, January 31, 2009

ArcGIS Silverlight Demo Video

If you are still wondering what's coming up in the ArcGIS API for Silverlight,, ESRI has released a video peaking at the new features, showing some animation capabilities and announcing the it will be released after the Dev Summet 2009

You Can Find the video HERE

Thursday, January 29, 2009

ArcGIS API for Microsoft Silverlight (Coming Soon)

The ArcGIS API for Microsoft Silverlight enables you to integrate ArcGIS Server and Microsoft Virtual Earth services and capabilities in a rich interactive application. With the ArcGIS API for Microsoft Silverlight.. read more Here

also take a look at the mapping capability with SilverLight Here

Wednesday, January 28, 2009

ArcGIS API for Microsoft Silverlight

it seems that ESRI is releasing the ArcGIS API for Microsoft Silverlight soon as they are discussing it in the developer summit in March 26

Take a look at Introduction to the ArcGIS API for Microsoft Silverlight here

Take a look at Patterns and Best Practices for Building Applications with the ArcGIS API for Microsoft Silverlight here

Saturday, January 24, 2009

Saturday, January 17, 2009

ArcGIS Server 9.3 & Windows 7 Beta Build 7000

Likewise i installed ArcGIS Server 9.3 on Windows 7 Beta and everything works fine.

here are some screenshots


ArcGIS Server Manager




ArcGIS Server Connection Through ArcCatalog

ArcGIS Desktop 9.3 & Widnows 7 Beta Build 7000

I downloaded windows 7 Beta build 7000 last week and installed it on a virtual box with 512MB of RAM and everything went smooth, the performance is so good just like XP, then i thought to try installing ESRI products on it, i started with ArcGIS Desktop 9.3, i went all right without any problems, infact i feel that performace wise it little faster then XP or Windows 2003, didn't run any performance analysis program but just felt it. here are some screen shots

ArcMap 9.3 Installation



ArcMap Up and Running

Tuesday, January 13, 2009

How to accept an invalid SSL certificate programmatically

In my Arclogistics Navigator application, im sending the location of the vehicles to back to our servers in able to see where the vehicles, i created a web service that receives the raw data and process it but it turns out that the web service that is being called over a web service with a certificate that its name doesn't match the server name, calling the client support to resolve this issue would take ages since people here in kuwait are very slow. so i though i'll google a bit to to to know how to accept any certificate no matter what is the error, well this is a POC ;)

here is how you do it

// callback used to validate the certificate in an SSL conversation
private static bool ValidateRemoteCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors policyErrors
)
{
if (Convert.ToBoolean(ConfigurationManager.AppSettings["IgnoreSslErrors"]))
{
// allow any old dodgy certificate...
return true;
}
else
{
return policyErrors == SslPolicyErrors.None;
}
}



what u need to do is to create a parameter in the app.config and give it a key
"IgnoreSslError" and set this to true or false up to ur conviniece and here is how you

streetmps_buffered.TrackingWS.Service m_proxy = new streetmps_buffered.TrackingWS.Service();

ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);

m_proxy.WriteDataAsync(m_DriverName, m_CurrentGPSPoint.X.ToString(), m_CurrentGPSPoint.Y.ToString(), (int)SMNavigation.MilesToKilometers(m_CurrentSpeed), DateTime.Now.ToString());


hope it helps others

Friday, January 2, 2009

Creating an ESRI Toolbar With ArcGIS Server Flex API

My First Flex ArcGIS Server App was to create a reusable Toolbar with (zoomin , zoomout , pan , zoom to full extent , zoom next , zoom previous) that i can use in all my Flex applications with the ability to set the orientation of the Toolbar (vertical or horizontal), anytime u need toolbar u just have to drag and drop from custom and set two proprties and ur done.

you can view a sample HERE and as its goning to be always you can get the source code HERE

just set 2 properties, ApplicationMap to you Map Id and the ToolbarDirection to horizontal or vertical and ur done