POST
|
I'm thoroughly baffled! I'm using ITopologicalOperator.Cut to cut polyline road segments that cross polyline boundaries.
While Not pFeature Is Nothing
pCuttingPolygonBoundary = ConvertPolygonToPolyline(pFeature.Shape)
If pCuttingPolygonBoundary.SpatialReference Is Nothing Then
pCuttingPolygonBoundary.SpatialReference = pPublicMap.SpatialReference
End If
pCuttingPolygonBoundary.SnapToSpatialReference()
pTopoOp = pCuttingPolygonBoundary
pTopoOp.IsKnownSimple_2 = False
pTopoOp.Simplify()
pSF = New SpatialFilter
pSF.Geometry = pCuttingPolygonBoundary
pSF.GeometryField = m_OutputFeatureClass.ShapeFieldName
pSF.SpatialRel = esriSpatialRelEnum.esriSpatialRelCrosses
pPolylineFeatureCursor = m_OutputFeatureClass.Search(pSF, False)
pPolylineFeature = pPolylineFeatureCursor.NextFeature()
sOIDList = ""
While Not pPolylineFeature Is Nothing
pLeftPolyline = New Polyline
pRightPolyline = New Polyline
pPolyline = pPolylineFeature.ShapeCopy
If pPolyline.SpatialReference Is Nothing Then
pPolyline.SpatialReference = pPublicMap.SpatialReference
End If
pPolyline.Project(pCuttingPolygonBoundary.SpatialReference)
pPolyline.SnapToSpatialReference()
pTopoOp = pPolyline
pTopoOp.IsKnownSimple_2 = False
pTopoOp.Simplify()
pTopoOp.Cut(pCuttingPolygonBoundary, pLeftPolyline, pRightPolyline)
I then put the resulting left and right polylines into the featureclass and delete the original polyline. It seems to work however when I do a spatial selection using the crossed by the outline selection method some of the polylines are still selected. Its my understanding that the split lines no longer cross the boundary put simply touch it. Is there something I'm missing?
... View more
01-30-2013
12:40 PM
|
0
|
1
|
1122
|
POST
|
Did anyone resolve this issue. I recently updated to ArcGIS10 SP3 and when I run the default MapControlApplication and try to use the Add Data button i get the following error: Problem signature: Problem Event Name: APPCRASH Application Name: MapControlApplication1.vshost.exe Application Version: 9.0.21022.8 Application Timestamp: 473168a0 Fault Module Name: StackHash_662c Fault Module Version: 6.1.7600.16695 Fault Module Timestamp: 4cc7ab86 Exception Code: c0000374 Exception Offset: 000cea27 OS Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033 Additional Information 1: 662c Additional Information 2: 662c4de66d5f651fda05e09f48208564 Additional Information 3: 1bcb Additional Information 4: 1bcbe069c732b722e4d29f8893cd56a1
... View more
10-31-2011
01:32 PM
|
0
|
0
|
347
|
POST
|
I'm building a model using the Model Builder interface. The model has many input parameters that can be logically grouped. Rather than have a big long list of parameters in the tool dialog I wanted to use a drop down system similar to the Environment Settings. There is an example in the help (Expand.xsl) that shows how to implement grouping however it uses the <PropertyGroup> identifier to group the parameters. If you look at the XML generated when you look at the Environment Settings dialog there are multiple PropertyGroups representing each of the parameter groups. I would love to implement this method however I can't seem to find any way to create PropertyGroups via the Model Builder interface. They all end up under PropertyGroup0. Is there a way to create separate Property Groups via model builder or can anyone point me in the right direction as to how to modify the XSL code to make it look like they're grouped. I tried to use a choose function to test individual property labels and put a group prefix on each of the labels. I think there's a viable solution there but my knowledge of XSL is limited making it difficult for me to work out.
<xsl:for-each select="Property">
<xsl:choose>
<xsl:when test='starts-with(PropertyLabel, "Group1 - ")'>
<xsl:apply-templates select="." />
</xsl:when>
</xsl:choose>
</xsl:for-each>
... View more
04-28-2010
12:37 PM
|
0
|
1
|
453
|
POST
|
Thanks shitijmehta, That certainly does the trick and gives me the reclassified raster that I'm looking for. I just wish I could do it through the Reclassify tool as it would give me alot more flexibility!
... View more
04-21-2010
02:18 PM
|
0
|
0
|
380
|
POST
|
This may not be what you're looking for and its certainly not what I would call concise however the attached code generates a trend plane through all the points within each drainage area. It then calculates the slope and aspect of the trend plane and enters them into the drainage area feature. I used point geometry as the input to the IInterpolationOp.Trend method but I believe you may be able to use a grid instead. Cheers!
Public Sub CreateTrendPlane()
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pSF As ISpatialFilter
Dim pLiDARPointsLayer As IFeatureLayer
Dim pDALayer As IFeatureLayer
Dim pDAFeatCur As IFeatureCursor
Dim pDAFeat As IFeature
Dim pSelectionSet As ISelectionSet
Dim pArea As IArea
Dim pPoint As IPoint
Dim pArray As IArray
Dim pRasterIdentify As IRasterIdentifyObj
Dim pSurfaceOp As ISurfaceOp
Dim pRasterLayer As IRasterLayer
Dim pOutputRaster As IRaster
Dim pAspectRaster As IRaster
Dim pSlopeRaster As IRaster
Dim pIdentify As IIdentify
Dim lAspectFieldIndex As Long
Dim lSlopeFieldIndex As Long
Const ElevationFieldName = "GRID_CODE"
Set pMxDoc = ThisDocument
Set pMap = pMxDoc.FocusMap
Set pDALayer = pMap.Layer(0) ' put DA layer at top of TOC
Set pLiDARPointsLayer = pMap.Layer(1) ' put LidarPoints layer next
lAspectFieldIndex = pDALayer.FeatureClass.FindField("MyAspect")
lSlopeFieldIndex = pDALayer.FeatureClass.FindField("MySlope")
Dim iCount As Integer
Dim iNumber As Integer
iCount = 1
iNumber = pDALayer.FeatureClass.FeatureCount(Nothing)
Set pDAFeatCur = pDALayer.FeatureClass.Search(Nothing, False)
Set pDAFeat = pDAFeatCur.NextFeature
While Not pDAFeat Is Nothing
Set pSF = New SpatialFilter
Set pSF.Geometry = pDAFeat.Shape
pSF.GeometryField = pLiDARPointsLayer.FeatureClass.ShapeFieldName
pSF.SpatialRel = esriSpatialRelContains
Set pSelectionSet = pLiDARPointsLayer.FeatureClass.Select(pSF, esriSelectionTypeIDSet, esriSelectionOptionNormal, Nothing)
Dim pFDescr As IFeatureClassDescriptor
Set pFDescr = New FeatureClassDescriptor
pFDescr.CreateFromSelectionSet pSelectionSet, Nothing, ElevationFieldName
Dim pInterpolationOp As IInterpolationOp
Set pInterpolationOp = New RasterInterpolationOp
Dim pRasterAnalysisEnv As IRasterAnalysisEnvironment
Set pRasterAnalysisEnv = pInterpolationOp
pRasterAnalysisEnv.SetCellSize esriRasterEnvValue, CVar(15)
pRasterAnalysisEnv.SetExtent esriRasterEnvMaxOf
Dim pInputPoints As IGeoDataset
Set pInputPoints = pFDescr
Set pOutputRaster = pInterpolationOp.Trend(pInputPoints, esriGeoAnalysisLinearTrend, 1)
Set pSurfaceOp = New RasterSurfaceOp
Set pAspectRaster = pSurfaceOp.Aspect(pOutputRaster)
Set pSlopeRaster = pSurfaceOp.Slope(pOutputRaster, esriGeoAnalysisSlopePercentrise)
Set pRasterLayer = New rasterLayer
pRasterLayer.CreateFromRaster pAspectRaster
Set pIdentify = pRasterLayer
Set pArea = pDAFeat.Shape
Set pPoint = pArea.Centroid
Set pArray = pIdentify.Identify(pPoint)
Set pRasterIdentify = pArray.Element(0)
pDAFeat.Value(lAspectFieldIndex) = pRasterIdentify.Name
pDAFeat.Store
Set pRasterLayer = New rasterLayer
pRasterLayer.CreateFromRaster pSlopeRaster
Set pIdentify = pRasterLayer
Set pArray = pIdentify.Identify(pPoint)
Set pRasterIdentify = pArray.Element(0)
pDAFeat.Value(lSlopeFieldIndex) = pRasterIdentify.Name
pDAFeat.Store
Set pDAFeat = pDAFeatCur.NextFeature
ThisDocument.Parent.StatusBar.Message(0) = "Calculated " & CStr(iCount) & " of " & CStr(iNumber)
iCount = iCount + 1
Wend
MsgBox "Done"
End Sub
... View more
04-21-2010
01:15 PM
|
0
|
0
|
320
|
POST
|
I prefer to override the Enabled property of the BaseTool class..... The following example enables the tool only when a raster layer is added to the map.
Public Overrides ReadOnly Property Enabled() As Boolean
Get
Dim i As Integer
For i = 0 To pMap.LayerCount - 1
If TypeOf pMap.Layer(i) Is IRasterLayer Then
MyBase.m_enabled = True
Exit For
Else
MyBase.m_enabled = False
End If
Next i
Return MyBase.Enabled
End Get
End Property
... View more
04-21-2010
12:59 PM
|
0
|
0
|
171
|
POST
|
I'm trying to build a model that will be run every year or so on data that will be regularly updated. I'm trying to do a proof of concept model that does a Kernel Density on a point file and then reclassifies the density map from 1 - 10 using an equal interval. Unfortunately the reclassify tool does not seem to generate the classes on the fly each time the model is run. As a result when the point data changes (to give a higher maximum density) then there is an error or warning to say that the maximum value is out of range. When I open the Reclassify tool to check the classifications, the classification method has returned to Manual and the classes have changed. Is there a way to have the Reclassify tool generate the equal interval classes based on the newly calculated input raster that may have a different minimum/maximum value???
... View more
04-21-2010
12:37 PM
|
0
|
2
|
921
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|