Page_Error: The Geometry has no Z values



If you are trying to create a feature and trying to set the feature.shape to the IPoint object , you may get an error "The Geometry has no Z values". In my case , part of my code looks like this

Dim ptargs As PointEventArgs = args
Dim pt As System.Drawing.Point = ptargs.ScreenPoint
Dim np as IPoint = Converter.ToMapPoint(ctx, mapServer,
mapDescription, imageDisplay, pt.X, pt.Y)
Dim geom As IGeometry
Set geom=np

There is another confusion here.. There are two overloaded functions for Convert.ToMapPoint

1. That convert a Screen coordinate x, y to a Geometry IPoint

Public static IPoint ToMapPoint(IServerContext,IMapServer,IMapDescription,IImageDisplay,X,Y)

2. That Coverts screen coordinates to world coordinates


Public static IPoint ToMapPoint(WebMap,X,Y)

So if we want to use the IPoint object returned by ToMapPoint () in setting the shape attribute of a newly created feature , you should use the first type overloaded function above.

After that you should add the following code

IZAware zAware=np
zAware.ZAware=true;
np.Z=0.0


Adding this piece of code will remove the error ' geometry has no Z-Values'. After this you can use the IGeometry object geom to set the shape property of newly created feature like below

Dim featureClass as IFeatureClass = featureLayer.FeatureClass
Dim f as Ifeature = featureClass.CreateFeature()
f.shape = geom

I spent my whole weekend working on this .. Hope I'll find sometime for myself next weekend.. see you all tommorow folks..

GoodNight
Addy

SKMMENU


Hello Folks I'm back. I've spent whole day on developing a menu for my ASP page. As you know arcgis server 9.1 .Net ADF supports only .net framework 1.1 and we dont have menu webcontrol in 1.1. I wish Arcgis server .Net adf 9.2 is release which would have saved my "Today". I remember that I used DHTML menus for my ASP pages long back.

Now I'm looking for a menu which can easily integrate with the .Net framework and supports event triggering. I found a really good opensource menu SKMMENU, http://www.skmmenu.com/menu/ . It has to options of how we create menu. We can either create menu programattically or we can bind the menu with an XML document something like this

So nothing much today..I hope I'll have some good stuff tommorow as I will be working on experting system shell "jess".