|
POST
|
All, I have developed some code that uses the IGeoProcessor object. It was bombing out when I was adding a Toolbox with an incorrect path. I realised my mistake and decided to add a bit of error trapping by using the Exist method to check if the toolbox exists before trying to add it to the GeoProcessor. So my code looks like this: Dim pGP As IGeoProcessor2
pGP = New GeoProcessor
If pGP.Exists("C:\temp\test.tbx", "Toolbox") Then
pGP.AddToolbox("C:\temp\test.tbx")
End If In the help it says: Test the existence of a given parameter value (GPValue or catalog path) the type of the data is optional. So my catalog path is obviously C:\temp\test.tbx but my data type is not optional I have to put something there. I tried Nothing and even a string that contains nothing or any text I like. So the line of code below is accepted and runs without error returning true (as the toolbox exists). pGP.Exists("C:\temp\test.tbx", "Duncan is ace") So what do all the developers have to say about this? What should I put there for the non-optional parameter? I could just put Nothing or maybe I should put something sensible, but the Help gives NO help about what possible value I should put there, it says it should be a variant that represents pDataType. There is an interface call IGPDataType but as I can put anything there I find myself wondering what should really go there? Duncan
... View more
01-31-2012
07:12 AM
|
0
|
0
|
1995
|
|
POST
|
Gavin, In ArcPad 10 when in ArcMap I can use the Get Data for ArcPad wizard to check out data from different geodatabases into a single axf database and one layer can be editable the other read only. The read only never appears in the editable layers menu on ArcPad. You would set one layer as Action > Export as background data (to AXF layer) > Make read only and for the editable layer you code do Action > check out for disconnected editing > check out schema only. So yes you can have editable and read only in a single axf file. Duncan
... View more
01-31-2012
05:35 AM
|
0
|
0
|
1202
|
|
POST
|
Gavin, If you have layers that are only ever going to be read only maybe you should export those to Shapefile for better performance. AXF may be the all singing and dancing solution to most storage solutions but I have found them to be a bit flaky sometimes, especially when one has more than 4 layers in an AXF (well that's my experience anyway). Check this page out about ArcPad and Shapefiles. Duncan
... View more
01-30-2012
06:42 AM
|
0
|
0
|
1202
|
|
POST
|
Enrico, I think the short answer is no to both of your questions. Duncan
... View more
01-30-2012
05:44 AM
|
0
|
0
|
1154
|
|
POST
|
Demetris, I've restructured your code. Have a look. You should really get into the habit of documenting your code with comments, this is good programing as it allows others to follow the code easier. Duncan Dim pBlockBoundaryFC As IFeatureClass
Set pBlockBoundaryFC = pBlockBoundary.FeatureClass
Dim pBlockBoundaryFields As IFields
Set pBlockBoundaryFields = pBlockBoundaryFC.Fields
' Create Spatialfilter
Dim pGeom As IGeometry
Dim pSpatialFilter As ISpatialFilter
Set pSpatialFilter = New SpatialFilter
' Create a cursor over all BlockBoundary
Dim pBlockBoundaryCursor As IFeatureCursor
Set pBlockBoundaryCursor = pBlockBoundaryFC.Search(Nothing, False)
' Main BlockBoundary loop
Set pBlockBoundaryFeature = pBlockBoundaryCursor.NextFeature
Do Until pBlockBoundaryFeature Is Nothing
' Get block boundary polygon and update spatialfilter
Set pGeom = pBlockBoundaryFeature.Shape
With pSpatialFilter
Set .Geometry = pGeom
.GeometryField = "Shape"
.SpatialRel = esriSpatialRelTouches
End With
' I am assuming you have a NewParcelFC layer
set pNewParcelsCursor = pNewParcelFC.Search(pspatialfilter,False)
Set pNewParcelsFeature = pNewParcelsCursor.NextFeature
Do Until pNewParcelsFeature Is Nothing
FID = pNewParcelsFeature.Value(intposFID)
MsgBox FID
Set pNewParcelsFeature = pNewParcelsCursor.NextFeature
loop
' Get next Block boundary
Set pBlockBoundaryFeature = pBlockBoundaryCursor.NextFeature
Loop
... View more
01-30-2012
01:50 AM
|
0
|
0
|
847
|
|
POST
|
Diss, I created a VB AddIN and in the onclick event I put this code together and got it working. It looks like the input layer has to be a featurelayer object and not a string. Duncan ' Get handle input point layer
Dim pmap As IMap
pmap = My.ArcMap.Document.FocusMap
Dim pLayer As ILayer
pLayer = pmap.Layer(0)
Dim pFeatureLayer As IFeatureLayer
pFeatureLayer = pLayer
' Run geoprocessing tool
Try
' Create Minimum bounding geometry tool
Dim mbg = New ESRI.ArcGIS.DataManagementTools.MinimumBoundingGeometry()
With mbg
.geometry_type = "convex_hull"
.in_features = pFeatureLayer
.out_feature_class = "c:\temp\conhull.shp"
End With
' Cast as a GPProcess
Dim pGPProcess As ESRI.ArcGIS.Geoprocessor.IGPProcess
pGPProcess = mbg
' Create GeoProcessor
Dim GP As New ESRI.ArcGIS.Geoprocessor.Geoprocessor
GP.OverwriteOutput = True
GP.AddOutputsToMap = True
' Execute tool
Dim pResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
pResult = GP.Execute(pGPProcess, Nothing)
Catch ex As Exception
MsgBox(ex.Message)
End Try
MsgBox("finished!")
... View more
01-16-2012
01:08 AM
|
0
|
0
|
1074
|
|
POST
|
Could try the tool feature vertices to points? http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Feature_Vertices_To_Points/00170000003p000000/
... View more
01-15-2012
08:46 AM
|
0
|
0
|
1631
|
|
POST
|
Are you saying the vertices of the polygon contain z values? You could convert your polygon to points with z values then convert these to pixels with their z values.
... View more
01-14-2012
02:35 PM
|
0
|
0
|
1631
|
|
POST
|
Iraklis, There is a geo-processing tool called Polygon to Raster and its found in the Conversion > To Raster toolbox. Duncan
... View more
01-14-2012
05:24 AM
|
0
|
0
|
1631
|
|
POST
|
If you look at the help on this geoprocessing tool it says: The CONVEX_HULL, CIRCLE, and ENVELOPE options are only available with an ArcInfo license. Are you using ArcInfo?
... View more
01-14-2012
05:09 AM
|
0
|
0
|
1074
|
|
POST
|
Jarek, I think its to do with correct topology of the polygon. If you look at the Help on the Check Geometry tool it mentions what direction an outer ring a polygon should be. I guess when you copy the polygon into the polyline featureclass ArcMap is enforcing correct topology for the polygon and consequently your polyline ends up clockwise. Well thats my guess of whats going on... Duncan
... View more
01-13-2012
01:35 PM
|
0
|
0
|
915
|
|
POST
|
James, Is your point data "stacked", i.e. you have lots of points that have the same XY coordinates? I think the tool ignores stacked points so may be this is reducing your dataset to less than 10? Also (not sure about this) may be you have set the output cellsize tool large and eveything falls within one cell? Duncan
... View more
01-13-2012
06:49 AM
|
0
|
0
|
814
|
|
POST
|
David, Can you zip up some sample data that it fails on for others to review? Duncan
... View more
01-12-2012
04:35 AM
|
0
|
0
|
1566
|
|
POST
|
Just a guess here, but could it be possible that the feature to polygon tool is generating a Feature Class that contains no data? A newer geodatabase will support a higher level of precision and so none of your polylines form polygons, whilst an older geodatabase has a lower level of precision and everything "snaps" to form enclosed areas? Duncan
... View more
01-12-2012
12:19 AM
|
0
|
0
|
1566
|
|
POST
|
David, So let me get this straight. At some point your model generates 2 layers each containing 1 polygon and you are using the spatial join tool on these? Have you tried to use the spatial join tool on these layers only (so not part of any model) to see what happens? If these polygons are not top secret maybe you can zip them up and post on this thread? Duncan
... View more
01-11-2012
05:07 AM
|
0
|
0
|
1566
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | Monday | |
| 1 | 02-15-2023 05:45 AM | |
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | 04-15-2026 07:35 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|