TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Cynthia
NA
215
36.1k
Display graphic objects from spatialquery result on arcmap
Dec 19 2013 6:47 AM
Hello experts,
Hey , i am new to arcobject so need a help... I have to display those points on arcmap that lies inside the envelope.I am explainingwhat i have done so far. I have one point feature class say featureclass having (lat/lon)detail.I opened it and used one ARCGIS Snippet i.e. GetActiveviewFromArcmap() and constructed one envelope as mentioned below-:
Iactiveview pactiveview=GetActiveviewFromArcmap(m_application);
Ienvelope penvelope=new EnvelopeClass();
penvelope=pactiveview.extent;
penvelope.QueryCoord(out minx, out miny,out maxX,out maxY);
Ispatialfilter sp=New IspatialfilterClass();
sp.geometry=penvelope;
sp.geometryfield=featureclass.shapefieldname;
sp.spatialrel=esrispatialrelenum.esrispatialrelIntersects;
Ifeaturecursor fc=featureclass.Search(sp,false);
IgraphicContainer pgc;
Ielement pElement;
pElement=new MarkerElementClass();
Ipoint ppoint=new PointClass();
Ifeature feature=featurecursor.NextFeature();
while(feature!=null)
{double x=Convert.ToDouble(feature.get_value(featureclass.fields.findfield("LAT")));
double y=Convert.ToDouble(feature.get_value(featureclass.fields.findfield("LON")));
ppoint.PutCoord(x,y);
pElement.Geometry=ppoint;
ppoint.AddElement(pElement,0);
pActiveview.Refresh();
featurecursor.NextFeature();}
The problem is it is displaying only one graphic object(point) on arcmap though there are 19 features satisfying the spatial query.I want that when i click the tool all features (point)/graphic object display on map at once.
Thanks in advance
Reply
Answers (
0
)
Debugging VB COM objects used in Classic ASP during runtime
Register COM interop