Thursday, June 5, 2008

IScreenDisplay Example with Description

Looking at ScreenDisplay
Both the PageLayout and the Map have an associated ScreenDisplay
object that is used for all graphic rendering. ScreenDisplay maintains a
DisplayTransformation. You can access the properties of DisplayTransformation
such as VisibleBounds and use the methods to convert coordinates
and distances between map and device units. This is illustrated
by the diagram in Figure 4.
Figure 5
Private Sub Hello()
Dim mxDoc As IMxDocument
Set mxDoc = Application.Document
Dim activeView As IActiveView
Set activeView = mxDoc.activeView
‘ set up a text symbol to draw with
Dim sym As ITextSymbol
Set sym = New TextSymbol
‘ change the font size to 18
Dim fnt As IFontDisp
Set fnt = sym.Font
fnt.Size = 18
sym.Font = fnt
‘ draw into the active view’s display
With activeView.ScreenDisplay
.StartDrawing .hDC, esriNoScreenCache
.SetSymbol sym
Dim bnds As IArea
Set bnds =
.DisplayTransformation.VisibleBounds
.DrawText bnds.Centroid, “Hello”
.FinishDrawing
End With
End Sub
Events such as adding a new layer to the map will cause the ScreenDisplay
to trigger a redraw. The drawing process occurs in three phases.
The drawing order is the geography, the selection, and the annotation.
A drawing cache is an off-screen bitmap of the rendered map that is
stamped onto the screen whenever the window is painted. ScreenDisplay
manages several drawing caches. When you initiate drawing to a
ScreenDisplay you must specify the destination cache. If the constant
esriNoScreenCache is specifi ed, the graphics will draw directly on the
ScreenDisplay’s window and will not be cached. If another window
obscures the display, the graphics will be lost. The following script
draws the text “Hello” in the center of the ScreenDisplay using the esri-
NoScreenCache constant.
In the example in Figure 5, note that the drawing calls SetSymbol and
DrawText are bracketed within the StartDrawing and FinishDrawing
methods.
Working with Layers
Maps maintain a collection of layers. A layer is any object that implements
the ILayer interface. Examples of layer objects include Feature-
Layer, GroupLayer, GraphicsLayer, AnnotationLayer, CadLayer, Tin-
Layer, and RasterLayer. The Layer(index) and LayerCount properties
of the IMap interface can be used to navigate the layer collection. The
function illustrated in Figure 6 fi nds and returns the layer with the specifi
ed name.
Figure 6
Function FindLayer(map As IMap, name As String)
As ILayer
Dim i As Integer
For i = 0 To map.LayerCount - 1
If map.Layer(i).name = name Then
Set FindLayer = map.Layer(i)
Exit Function
End If
Next
End Function
Figure 7
Sub AddLayer()
‘ use a workspaceFactory to open the workspace
Dim wksFact As IWorkspaceFactory
Set wksFact = New Shapefi leWorkspaceFactory
Dim wks As IFeatureWorkspace
Set wks = wksFact.OpenFromFile(“c:\Data\shp”, 0)
‘ open the featureClass
Dim fc As IFeatureClass
Set fc = wks.OpenFeatureClass(“BigCypress”)
‘ create a featureLayer
Dim lyr As IFeatureLayer
Set lyr = New FeatureLayer
Set lyr.FeatureClass = fc
‘ name the layer with the featureClass name
Dim ds As IDataset
Set ds = fc
lyr.Name = ds.Name
‘ add the layer to the map
Dim mxDoc As IMxDocument
Set mxDoc = Application.Document
Dim map As IMap
Set map = mxDoc.FocusMap
map.AddLayer lyr
End Sub
A FeatureLayer manages a connection to a vector data source such as
a coverage, shapefi le, or Spatial Database Engine (SDE) layer through
a FeatureClass object. The script in Figure 7 obtains a FeatureClass
object for a shapefi le by opening the Workspace that contains the shapefi
le using Shapefi leWorkspaceFactory. It then creates a FeatureLayer,
attaches the FeatureClass to the layer, and adds it to the FocusMap.

Are You Concious about your Diet?

Healing Diet
Following a detoxification diet is critical to good health because our bodies are constantly bombarded with toxicity in our everyday lives. Most people can't avoid everyday pollutants altogether, but they can take steps to protect their health using a healing diet. Once environmental illness is diagnosed, the logical first step to take is removing the offending toxins from a person's environment and begin body detoxification. Only then can healing begin. Detoxification is the key to getting better. There are many ways to detoxify your body using a detoxification diet and I examine some of those here:
First, a good way to protect your health is to not eat harmful foods! Here are foods to avoid if you are to live a long, healthy life:
Foods that Kill
Margarine and other hydrogenated fats,Chlorinated WaterAntibiotics (not always, but in many cases)Aspartame Table salt
MSG - Mono Sodium Glutamate Pesticides CarcinogensHormones which can be present in milkFood additives Refined sugar, sweetenersJunk/processed foods (Processed "food" is life-less food)fried, smoked, grilled foods
Soft drinks - Keep your child away from thisAlcohol drinks
What should a detoxification diet consist of?
An important part of your detoxification diet should be water, healing foods, vegetable juices, fats that heal, and unrefined sea salt.
Eat primarily foods that contain live enzymes, "life force" and nutrients. "Foods" that lack these elements cause the body to become acid, produce mucous, and congest the intestinal tract. Over time, if you keep eating a poor diet, this congestion builds up, layer after layer, eventually forming a hardened layer of plaque in the intestin. This substance is known as "mucoid fecal plaque" and is believed to contribute towards a majority of the obstacles to optimal health.
A good detoxification diet will make your body ALKALINE. The acid/alkaline balance of your body needs to be managed. Most people today have an over acid body, primarily from a diet of acid-forming foods and stress. It's difficult to be acid and totally healthy. Becoming acidic is one of the first steps toward illness. It's almost impossible to find someone with a disease who is not over acid. More about the critical role of body PH here.
Anytime the body drops from full vitality, weakened areas result. Stress alone may create the over acidity which leads to mucoid plaque. And stress often prompts deviation from a good diet as the person seeks comfort or quick energy through acid-forming foods.
Another aspect of the nontoxic diet is avoiding drugs--over-the-counter, prescription, and recreational types--and substituting natural remedies, such as nutrients, herbs, and homeopathic medicines, all of which have fewer side effects.
Other natural therapies, such as acupuncture, massage, and chiropractic may help in treating some problems so that we will not need drugs for them. Avoiding or minimizing exposure to chemicals at home and work is also important. This lessens our total toxic load. Substituting natural cleansers, cosmetics, and clothes is helpful. My favorite source for ayurvedic massage oils and natural cleansers which don't contain harmful ingredient is here
One form of the detoxification diet is one made up exclusively of fresh fruits, fresh vegetables, either raw or cooked, and whole grains, both cooked and sprouted; however, no breads or baked goods, animal foods and dairy products or alcohol are used. This diet keeps fiber and water intake up and helps colon detoxification. Most people can handle this well and make the shift from their regular diet with a few days transition.
The next level of detoxification involves a diet consisting solely of fruits and raw vegetables, all cleansing foods. The green vegetables, especially the chlorophyllic and high-nutrient leafy greens, are very cleansing and supportive for purification of the gastrointestinal tract and the whole body.
I was first introduced to the power of raw, water rich foods such as fruits and vegetables by the popular motivational speaker Tony Robbins . Tony Robbins has helped me make marked improvements in not only my health but other aspects of my life as well. I highly recommend his life-changing programs.
A raw foods diet is fulfilling for many people, very high in energy and nutrition. This type of cleansing diet contains lots of sprouted greens from seeds and grains such as wheat, buckwheat, sunflower, alfalfa, and Red Clover; sprouted beans; soaked or sprouted raw nuts; and fresh fruits and vegetables. Cooking food is not allowed with this diet; eating foods raw maintains the highest concentrations of vitamins, minerals and important enzymes, and allows them to find their way into our body and cells. Many people feel that this is the best of diets; it can be health supportive over quite some time if it is balanced properly.
Another form of cleansing diet is juice fasting.
Whether you are on a detoxification diet or not, it helps to follow those recommended rules while eating.
- While on a cleansing diet, follow these recommended steps to protect yourself from toxins in the environment
Water plays a critical role in a good detoxification dietThere are also many cleansing herbs which may be part of a detoxification diet.
Niacin can play an important in the detoxification of fatty tissue.

Tuesday, June 3, 2008

IQueryFilter Example with Description

IQueryFilter filters data based on an attribute query. A string defining a where clause is required. An optional list of columns may be included to specify the column values to be retrieved. If no columns are specified, all values will be returned.
When To Use
When you need to filter data based on attribute values or the relationships between attributes.
Let's do it by one example
Dim pQueryFilter As IQueryFilter
Set pQueryFilter = New QueryFilter
Setting the SubFields and WhereClause: pQueryFilter.SubFields = "STATE_NAME,POPULATION"
pQueryFilter.WhereClause = "STATE_NAME = 'California'"
Using a query filter to search a feature class:Dim pFeatureCursor As IFeatureCursor
Set pFeatureCursor = pFeatureClass.Search(pQueryFilter, False)

GIS Product

Open source software Most widely used open source applications:
GRASS – Originally developed by the U.S. Army Corps of Engineers, open source: a complete GIS
MapServer – Web-based mapping server, developed by the University of Minnesota.
Other open source GIS applications:

gvSIG 1.0
SAGA GIS – – System for Automated Geoscientific Analyses- a hybrid GIS software. SAGA has a unique Application Programming Interface (API)and a fast growing set of geoscientifc methods, bundled in exchangeable Module Libraries.
Quantum GIS – QGIS is a user friendly Open Source GIS that runs on Linux, Unix, Mac OS X, and Windows.
MapWindow GIS – Free, open source GIS desktop application and programming component.
ILWIS – ILWIS (Integrated Land and Water Information System) integrates image, vector and thematic data.
uDig
gvSIG – Open source GIS written in Java.
Chameleon – Environments for building applications with MapServer.
GeoNetwork opensource – A catalog application to manage spatially referenced resources
GeoTools – Open source GIS toolkit written in Java, using Open Geospatial Consortium specifications.
JUMP GIS – Java Unified Mapping Platform. (See end of page for JUMP derivative projects, like Kosmo and OpenJUMP)
MapGuide Open Source – Web-based mapping server.
OpenLayers – open source AJAX library for accessing geographic data layers of all kinds, originally developed and sponsored by MetaCarta
PostGIS – Spatial extensions for the open source PostgreSQL database, allowing geospatial queries.
TerraView – GIS desktop that handles vector and raster data stored in a relational or geo-relational database.
Xastir A special purpose Open Source GIS application used as an APRS client by Amateur radio operators, written in C for X Window environments.

[edit] Notable commercial or proprietary GIS software
Most widely used notable proprietary software applications and providers:
Hydro GeoAnalyst— Environmental data management and visualization software by Schlumberger Water Services.
Autodesk – Products include MapGuide and other products that interface with its flagship AutoCAD software package.
Cadcorp – Developers of GIS software and OpenGIS standard (e.g. Read/Write Open Source PostGIS database).
Intergraph – Products include GeoMedia, GeoMedia Profesional, GeoMedia WebMap, and add-on products for industry sectors, as well as photogrammetry.
ERDAS IMAGINE – A proprietary GIS, Remote Sensing, and Photogrammetry software developed by ERDAS, Inc.
ESRI – Products include ArcView 3.x, ArcGIS, ArcSDE, ArcIMS, and ArcWeb services.
IDRISI – Proprietary GIS product developed by Clark Labs.
MapInfo – Products include MapInfo Professional and MapXtreme. integrates GIS software, data and services.
MapPoint – Proprietary GIS product developed by Microsoft.
GISNet— A web-based GIS system developed by MRF Geosystems Corporation.
Caliper – Products include Maptitude, TransCAD and TransModeler. Develops GIS and the only GIS for transportation.
Pictometry – Proprietary software which allows oblique images to be draped with shapefiles. Many gov't applications (fire, 911, police, assessor) as well as commercial.
Black Coral Inc — a leading edge product company developing geospatial collaboration capabilities that enable better outcomes for personnel and tactical teams operating in emergency response and military environments.
Other notable proprietary software applications and providers:
CARIS (Computer Aided Resource Information System) – GIS systems for hydrography and cadastral systems.
DeLorme – Producer XMap and other GIS tools, data, and GPS hardware.
GMS – Three-dimensional environment for building geologic and groundwater models
Manifold System – Low-cost GIS software package.
Oracle Spatial – Product allows users to perform basic geographic operations and store common spatial data types in a native Oracle environment.
Orbit GIS Generic and multi-purpose GIS toolkit, written using 100% Java.
Safe Software – Spatial ETL products including FME, SpatialDirect and the ArcGIS Data Interoperability Extension.
Smallworld – developed in Cambridge, England (Smallworld, Inc.) and purchased by General Electric and used primarily by public utilities.
AvisMap @ – Products include AvisMap GIS Engine, AivsMap Desktop, AvisMap Free Viewer, and SDM(Spatial Database Management).

[edit] Other GIS software
CrossView for ArcGIS – created by A-Prime Software, CrossView is a wizard-based ArcGIS plug-in, which enables map cross-sectioning and profile creation.
GeoBase – Geospatial platform developed by Telogis. A particular focus is placed on real-time processing for reverse-geocoding, geofencing, etc.
GGP GIS – created by GGP Systems Ltd, GGP GIS is a GIS application used mainly by UK local authorities.
GeoAgro GIS – created by GeoAgro, GeoAgro GIS is a GIS specialized for agriculture and environmental applications.
ILOG JViews Maps, Java library for map display with overlays as symbols and diagrams.
LandSerf – Free GIS written in Java. Source available but not strictly open source.
Panorama – Russian GIS for military uses.
SPRING – GIS software developed at INPE - Instituto Nacional de Pesquisas Espaciais and available free of charge.
TC Technology – GO! Sync Mapbook, A Mobile GIS mapping application built on ArcGIS Engine. Redlining, Inspections, GPS, Tracing functionality. Eliminates paper maps for field personnel.
TerraLib – GIS class and functions library, available from the Internet as open source, allowing a collaborative environment and its use for the development of multiple GIS tools.
TNTmips – Geospatial analysis system providing a GIS, RDBMS, and automated image processing system with CAD, TIN, surface modeling, and data publishing tools.
SavGIS – Free and complete GIS software available in French, English and Spanish, developed since 1984 by the Development Research French Institute (IRD)
Tilcon GIS Maps – Tilcon - an embedded graphical user interface company produces a GIS application development module.
Scenome – Software for building geo-referenced terrain databases from industry standard GIS formats such as DEM and GEOTIFF.
GDAL – Geo-Data Abstraction Library. Popular open-source product for managing GIS data.
PROJ4 – Popular, open-source product for converting GIS data between projections.
MapTools – Suite of open-source GIS products and platforms.
Spatial Communication – Spatcom (Spatial Communication) is a Free and Share GIS Software with Digital Map Data Made in Indonesia.
OpenStreetMap – Online map viewer, with map editing capability.
Elshayal Smart GIS – The First Arabian GIS Software
Netcad is the first Turkish GIS Software, owned by ULUSAL, with English and Turkish support.

Sunday, June 1, 2008

ArcObject Defintion


Are You new in ArcObject or You are hearing first time this world, then read this it will help you a lot about understanding Arcobject.


ArcObjects is the collection of COM components that provides
the underpinning for two new ArcInfo 8 applications—ArcMap and
ArcCatalog. This set of components includes more than 1,200 objects
that may be used to customize, extend, or construct GIS applications.
Initially, an object model of this size can seem a little overwhelming.
Taking a close look at the object model for ArcMap will familiarize you
with some of the fundamental components in the larger object model.

The Basic Structure
Figure 1 shows a conceptual object model for ArcMap. The top-level
object, MxApplication, represents ArcMap itself. MxApplication manages
a single document, MxDocument. ArcMap uses a Single Document
Interface (SDI) in contrast to ArcView GIS, which uses a Multiple
Document Interface (MDI). MxDocument manages a collection of Map
objects and a PageLayout object. When ArcMap is in geographic view,
the ActiveView is a Map. When it’s in layout view, the ActiveView is
the PageLayout. Regardless of the type of view, there is always a single
FocusMap.
If ArcMap displays a document with three data frames in layout view,
there will be three Maps attached to the MxDocument, the ActiveView
property will return the PageLayout, and the FocusMap will return the
Map corresponding to the data frame that is highlighted. The VBA
script listed in Figure 2 illustrates this part of the object model. The
script changes the ActiveView’s extent and zooms in by 75 percent.
This script is fairly straightforward. The real work is getting the current
extent, which is an IEnvelope interface, from the ActiveView, shrinking
it, and making the modifi ed envelope the new extent. This script operates
on the ActiveView through the IActiveView interface. The ActiveView
can be either the PageLayout or a Map depending on what the end user is
looking at. This script will function correctly in either case.

Working with Interfaces
In some cases you will want to work specifi cally with either the Map or
the PageLayout through a different interface. In this situation, a COMobject
model differs greatly from a traditional object-oriented model
like Avenue or MapObjects. An interface is a collection of related methods
and properties. COM objects expose multiple interfaces. For example,
the Map exposes not only the IActiveView interface but the IMap
interface and several others

SDEWorkspaceFactory Example with Description

If you want to make a connection with any geodatabase or you want to establish sde connection then follow this code. It will help you a lot
This example opens a Geodatabase featureclass using a property set.

Dim pPropset As IPropertySet
Set pPropset = New PropertySet
Dim pFact As IWorkspaceFactory
Dim pWorkspace As IWorkspace
With pPropset
.SetProperty "Server", "testserver"
.SetProperty "Instance", "sdemss"
.SetProperty "Database", "sde"
' Ignored with ArcSDE for Oracle
.SetProperty "user", "sde"
.SetProperty "password", "go"
.SetProperty "version", "sde.DEFAULT"
End With
Set pFact = New SdeWorkspaceFactory
Set pWorkspace = pFact.Open(pPropset, Me.hWnd)
Dim pFeatureWorkspace As IFeatureWorkspace
Set pFeatureWorkspace = pWorkspace
Dim pFeatureClass As IFeatureClass
Set pFeatureClass = pFeatureWorkspace.OpenFeatureClass("parcels")

ISpatialFilter Example with Description

Here I am Explaining the use of ISpatialFilter Interface
Add a custom UIToolControl onto any toolbar and make sure the names of the control match the code. This sample assumes the control is called UIToolControl1.
Paste the code into VBA.
Select the tool and then click on a feature.
Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
Dim pPoint As IPoint
Dim pFeature As IFeature

Set pMxDoc = Application.Document
Set pActiveView = pMxDoc.FocusMap
'Create a search point
Set pPoint = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)
'Pass the point to the FindFeature function along with the Map and search tolerance
Set pFeature = FindFeature(pMxDoc.SearchTolerance, pPoint, pMxDoc.FocusMap)
'Message box the feature ID and feature class alias name
If Not pFeature Is Nothing Then MsgBox pFeature.OID & " " & pFeature.Class.AliasName
End Sub
Private Function FindFeature(SearchTol As Double, pPoint As IPoint, pMap As IMap) As IFeature
Dim pEnvelope As IEnvelope
Dim pSpatialFilter As ISpatialFilter
Dim pEnumLayer As IEnumLayer
Dim pFeatureLayer As IFeatureLayer
Dim pFeatureClass As IFeatureClass
Dim pFeatureCursor As IFeatureCursor
Dim pFeature As IFeature
Dim pUID As New UID
Dim ShapeFieldName As String

If pMap.LayerCount = 0 Then Exit Function

'Expand the points envelope to give better search results
Set pEnvelope = pPoint.Envelope
pEnvelope.Expand SearchTol, SearchTol, False

'Create a new spatial filter and use the new envelope as the geometry
Set pSpatialFilter = New SpatialFilter
Set pSpatialFilter.Geometry = pEnvelope
pSpatialFilter.SpatialRel = esriSpatialRelIntersects
'Search each selectable feature layer for a feature
'Return the first feature found
pUID = "{40A9E885-5533-11D0-98BE-00805F7CED21}" 'IFeatureLayer
Set pEnumLayer = pMap.Layers(pUID, False)
pEnumLayer.Reset
Set pFeatureLayer = pEnumLayer.Next
Do While Not pFeatureLayer Is Nothing
'Only search the selectable layers
If pFeatureLayer.Selectable Then
ShapeFieldName = pFeatureLayer.FeatureClass.ShapeFieldName
Set pSpatialFilter.OutputSpatialReference(ShapeFieldName) = pMap.SpatialReference
pSpatialFilter.GeometryField = pFeatureLayer.FeatureClass.ShapeFieldName
Set pFeatureClass = pFeatureLayer.FeatureClass
Set pFeatureCursor = pFeatureClass.Search(pSpatialFilter, False) 'Do the search
Set pFeature = pFeatureCursor.NextFeature 'Get the first feature
If Not pFeature Is Nothing Then
Set FindFeature = pFeature 'Exit if feature is valid
Exit Do
End If
End If
Set pFeatureLayer = pEnumLayer.Next
Loop
End Function