POST
|
SELECT sqrt(pow(inputxvalue - fieldx,2) +(pow(inputyvalue - fieldy,2)) AS Distance FROM tablename ORDER BY Distance LIMIT Thansk, anthony. This query involves full table scan (I think). Is there a way to avoid that?
... View more
09-18-2012
02:01 PM
|
0
|
0
|
552
|
POST
|
Due to some reasons, I am required to store X,Y point data in a database (and not convert them to point features). The X,Y data represents points in a UTM projection. I need to search for a point that is nearest to a given point in a query. The given point is also in the same UTM projection. Is there an efficient way of accomplishing this using SQL query? Thanks!
... View more
09-18-2012
11:36 AM
|
0
|
11
|
952
|
POST
|
I am doing some custom drawing in the pagelayout view. In that connection, I need to find out the coordinates (or extents) of the map frame that in rendered in the pagelayout view in screen coordinates. Is there a way to find that out?
... View more
04-22-2011
04:49 PM
|
0
|
2
|
817
|
POST
|
I am seeing a strange behavior with the Caption property of IDockableWindowDef. I have implemented IDockableWindowDef. I notice that the Caption of the window doesn't change even if I return a new value for the caption from the implementation. I have to unregister the dll, run ArcMap, re-register the dll, and then run ArcMap again - then only I see that the new caption is displayed in the caption area of the dockable window. I place a break point in the Caption property implementation of my class, and I see that the break point is only hit the very first time the ArcMap is run after registering the dll. After that if I change the Caption value in the code, the break point is never hit again unless I carry out the above steps I listed. Can anyone explain this? Am I missing some step or doing something wrong? Anyone please? Can anyone confirm this behavior? Just change the Caption property, recompile the code and see if the Caption of the Dockable Window actually changes when it is shown. Thanks!
... View more
03-04-2011
03:32 PM
|
0
|
0
|
105
|
POST
|
I create a personal geodatabase and then a FeatureClass in that gdb to store the results of an analysis. When I call <FeatureClass>.CreateFeature() I get an exception message "Item not found in this collection." I've ensured my fields are set correctly, I physically open the .mdb and the table looks correct. Here's my code (I'm using properties from an existing SDE featureclass (pipeFittingFeatureClass) to construct the new FeatureClass):
//create the 'ServicePointCount' field
IFieldEdit servicePointCountFieldEdit = new FieldClass();
servicePointCountFieldEdit.Name_2 = "ServicePointCount";
servicePointCountFieldEdit.Type_2 = esriFieldType.esriFieldTypeInteger;
//create ORIG_OID field
IFieldEdit origOIDFieldEdit = new FieldClass();
origOIDFieldEdit.Name_2 = "ORIG_OID";
origOIDFieldEdit.Type_2 = esriFieldType.esriFieldTypeInteger;
//create OID field
IFieldEdit OIDFieldEdit = new FieldClass();
OIDFieldEdit.Name_2 = "ObjectID";
OIDFieldEdit.Type_2 = esriFieldType.esriFieldTypeOID;
//create shape field
IFieldEdit shapeFieldEdit = new FieldClass();
shapeFieldEdit.Name_2 = this.pipeFittingFeatureClass.ShapeFieldName;
shapeFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
IGeometryDef shapeFieldGeometryDefinition = new GeometryDefClass();
IGeometryDefEdit shapeFieldGeometryDefinitionEdit = (IGeometryDefEdit)shapeFieldGeometryDefinition;
shapeFieldGeometryDefinitionEdit.GeometryType_2 = this.pipeFittingFeatureClass.ShapeType;
ISpatialReferenceFactory3 spatialRefFactory = new SpatialReferenceEnvironmentClass();
ISpatialReference origRef = this.pipeFittingFeatureClass.Fields.get_Field(this.pipeFittingFeatureClass.Fields.FindField("SHAPE")).GeometryDef.SpatialReference;
shapeFieldGeometryDefinitionEdit.SpatialReference_2 = spatialRefFactory.ConstructHighPrecisionSpatialReference(origRef, -1, 0, 0);
shapeFieldEdit.GeometryDef_2 = shapeFieldGeometryDefinitionEdit;
//create new fields class
IFieldsEdit fieldsEdit = new FieldsClass();
fieldsEdit.FieldCount_2 = 4;//this.pipeFittingFeatureClass.Fields.FieldCount + 2;
fieldsEdit.set_Field(0, (IField)OIDFieldEdit);
fieldsEdit.set_Field(1, (IField)origOIDFieldEdit);
fieldsEdit.set_Field(2, (IField)servicePointCountFieldEdit);
fieldsEdit.set_Field(3, (IField)shapeFieldEdit);
//create the featureclass
IFeatureClass EFVValvesFeatureClass = workspace.CreateFeatureClass("EFVValves", (IFields)fieldsEdit, null,
null, this.pipeFittingFeatureClass.FeatureType, this.pipeFittingFeatureClass.ShapeFieldName, "");
//THIS THROWS THE "Item not found in this collection." EXCEPTION
IFeature newFeature = EFVValvesFeatureClass.CreateFeature();
I tried searching for this error and got a few hits but none of the fixes applied to my situation so I am at a loss as to ideas. My suspicion is the how I define the Shape field, but if I do not create a high precision spatial reference (the template spatial reference I use is low), it won't even allow me to create the featureclass. For reference, I'm using ArcGIS 9.3.1 Sp1, and this is just a small console app that does some custom tracing and stores the results in this personal GDB. I have had this error in the past - almost always the problem was with the incorrect field name. Check all the field names in your code, number of fields being set, etc. etc.
... View more
03-04-2011
03:11 PM
|
0
|
0
|
535
|
POST
|
Thanks Neil, I will give it a try and report. Thank you , Neil. It has worked as per your suggestion.
... View more
03-04-2011
06:08 AM
|
0
|
0
|
464
|
POST
|
This code uses the tool's ProgId: pUID.value = "esriCore.SketchTool" It has been my experience that using the ProgId requires the command or tool to be on a toolbar or menu somewhere. If you use the actual class GUID, then the command or tool does not have to be on a toolbar or menu: pUID.value = "{" & yourClass.ClassId & "}" The code above is .NET and assumes the command/tool class is in your code project. You can also just use the hard-coded GUID (you'll have to do this for built-in tools and tools whose code is not in your project). Thanks Neil, I will give it a try and report.
... View more
03-03-2011
06:33 PM
|
0
|
0
|
464
|
POST
|
I am seeing a strange behavior with the Caption property of IDockableWindowDef. I have implemented IDockableWindowDef. I notice that the Caption of the window doesn't change even if I return a new value for the caption from the implementation. I have to unregister the dll, run ArcMap, re-register the dll, and then run ArcMap again - then only I see that the new caption is displayed in the caption area of the dockable window. I place a break point in the Caption property implementation of my class, and I see that the break point is only hit the very first time the ArcMap is run after registering the dll. After that if I change the Caption value in the code, the break point is never hit again unless I carry out the above steps I listed. Can anyone explain this? Am I missing some step or doing something wrong?
... View more
03-03-2011
06:32 PM
|
0
|
1
|
498
|
POST
|
Not totally sure you can do this, but if it's registered already then you should be able to execute it via it's GUID just like any other registered command. For example, this code would initiate the Sketch Tool: 'set the current tool to be the editor Sketch tool Dim pCommandItem As ESRI.ArcGIS.Framework.ICommandItem Dim pUID As New ESRI.ArcGIS.esriSystem.UID pUID.value = "esriCore.SketchTool" pCommandItem = m_pApp.Document.CommandBars.Find(pUID) m_pApp.CurrentTool = pCommandItem m_pEditEvents = pEditor Thanks, I will give it a try, all online examples show this technique. But would it work even if the command has not been added to the CommandBar - because the example tries to find the command by ICommandBars.Find().
... View more
02-28-2011
05:33 AM
|
0
|
0
|
464
|
POST
|
I have developed a command that implements ICommand and ITool. This command is registered in the ESRI MX Commands category. How can I execute this command programmatically without having to add it to a toolbar or a commandbar?
... View more
02-24-2011
01:14 PM
|
0
|
6
|
1172
|
POST
|
Thanks, I get the idea for spatial selection from your post.
... View more
02-24-2011
09:38 AM
|
0
|
0
|
158
|
POST
|
I want to be able to select a single feature based upon where user clicks on the screen. How can I do this using ArcObjects? Thanks!
... View more
02-19-2011
01:17 PM
|
0
|
2
|
535
|
POST
|
Hi All, I have problems with programming ArcObjects in ArcGIS10 with Delphi 7(using COM). Essentially, what happens is that the Type Library (invoked from View->Type Library) fails to list any of the ESRI libraries (except two, which are not useful to me). as a result, my existing code cannot be compiled or built. I have installed ArcGIS 10 PreRelease on Windows 7 Ultimate 64bit, installed the Developer Kit (.NET) and VBA. I used Microsoft OLE Viewer to verify this, and it correctly lists all the ESRi type libraries (.OLB). Also, I was able to compile ESRI's Custom Tree Feature sample in VS2008 which uses COM interaces and references these libraries). This means that this problem is only for Delphi 7. Any idea what could be wrong here? how can I reference these ESRI type libraries in Delphi if they are not listed in the Type Library? I have re registered all the OLB, but that hasn't helped. I know there are some good experienced Delphi programmers lurking here - can you guys please help me out with this problem? Thank you, Gagag Well, anyone? Has anyone successfully used Delphi to code against ArcGIS 10 ArcObjects? Thanks! Gagag
... View more
05-10-2010
08:43 AM
|
0
|
0
|
927
|
POST
|
Hi All, I have problems with programming ArcObjects in ArcGIS10 with Delphi 7(using COM). Essentially, what happens is that the Type Library (invoked from View->Type Library) fails to list any of the ESRI libraries (except two, which are not useful to me). as a result, my existing code cannot be compiled or built. I have installed ArcGIS 10 PreRelease on Windows 7 Ultimate 64bit, installed the Developer Kit (.NET) and VBA. I used Microsoft OLE Viewer to verify this, and it correctly lists all the ESRi type libraries (.OLB). Also, I was able to compile ESRI's Custom Tree Feature sample in VS2008 which uses COM interaces and references these libraries). This means that this problem is only for Delphi 7. Any idea what could be wrong here? how can I reference these ESRI type libraries in Delphi if they are not listed in the Type Library? I have re registered all the OLB, but that hasn't helped. I know there are some good experienced Delphi programmers lurking here - can you guys please help me out with this problem? Thank you, Gagag
... View more
05-07-2010
08:58 AM
|
0
|
7
|
3543
|
POST
|
COM will follow the same path that VB6 and VBA have. Have you noticed that the C++ SDK for 10 has been relegated to a few notes in help? Not much love there either. For Microsoft platforms, ESRI is moving towards pure .NET. Look at add-ins in 10. Look how they removed component catagories from the registry. Everything that ESRI (and Microsoft) is doing and showing is .NET. How many books in print can you still buy on COM? The death of COM cometh. At the recent developers summit, ESRI provided additional hints of this in their work on 10.1 and beyond. Thank you.
... View more
04-28-2010
12:24 PM
|
0
|
0
|
194
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|