POST
|
I can't see a problem with your code. I took a look at my code (c#) and came accross this line: if (!(intClosestFID == -1))//need to figure out why -1 is coming back on the IndexQuery or find another way to get the pipe I never figured it out. Luckily getting the closest pipe wasn't mission critical to the project. Just a nice feature (that doesn't work all the time).
... View more
05-03-2011
10:55 AM
|
0
|
0
|
495
|
POST
|
I have code that uses IIndexQuery2.NearestFeature as well. Not sure why you're getting -1 for a vlaue. My code queries a file geodatabase where it's the objectid that is taken. What you can do (once you get the -1 issue worked out) is use the FID # to query for the polyline you need and extract the attribues then. Hope that helps. -Joel
... View more
05-03-2011
10:06 AM
|
0
|
0
|
495
|
POST
|
Ah, I didn't catch that it was read-only. I'll consider your approach. Thanks Chris.
... View more
04-13-2011
11:59 AM
|
0
|
0
|
577
|
POST
|
Chris, Sorry for the confusion but I'm not wanting to flip the start with the end. I have some pipes that have shifted off their junctions about .5 feet in two directions for some unknown reason. So instead of manually editing them I'm using the near_analysis to find the closest junction from the end and start points of the pipes ( I created point layers of the start and end points). Now I'd like to 'move' those start and end points of the pipes to the x and y of their nearest junction. The edits are just not 'holding'. Make sense?
... View more
04-13-2011
10:35 AM
|
0
|
0
|
577
|
POST
|
I'm attempting to change the start point and last point of some lines (pipes). The code runs below without an error but when I check the lines in ArcMap I discover that the end points haven't moved at all. Shouldn't I be able to edit/update the geometry of these points this way? desc = arcpy.Describe(pipes2)
PipeCur = arcpy.UpdateCursor(pipes2)
desc= arcpy.Describe(pipes2)
shapefield = desc.ShapeFieldName
cnt = 0
pipe = PipeCur.next()
while pipe:
lngIDSYS = pipe.IDSYS
whereClause = "IDSYS = " + str(lngIDSYS)
print whereClause
pntCursor = arcpy.SearchCursor(EndPoints,whereClause)
EndPnt = pntCursor.next()#return the only point
PipeFeat = pipe.getValue(shapefield)# need the shape field name here
Last = PipeFeat.lastPoint# returns the last point.
print "Changing the x and y"
print str(Last.X) + " is the x value before."
print str(EndPnt.NEAR_X) + " is the x value of Near_X."
Last.X = EndPnt.NEAR_X
print str(Last.X) + " is the x value after."
Last.Y = EndPnt.NEAR_Y
PipeCur.updateRow(pipe)
cnt = cnt + 1
pipe = PipeCur.next()
... View more
04-13-2011
08:55 AM
|
0
|
4
|
1740
|
POST
|
The documentation calls for a a feature layer of type Point, polyline, polygon or multipoint. I know that some geoprocessing tools will let you supply a geometry for input and a object for output, such as obj = arcpy.near_analysis(pPoint,junctionLyr). The error message I'm getting is telling me that my in_features is of the wrong type when I provide a point object. I suspect that the tool wasn't designed to work that way.
... View more
04-13-2011
08:05 AM
|
0
|
0
|
191
|
POST
|
I'm attempting to find the closest junction to the end points of my existing lines. i.e,. I'm using the lastpoint and firstpoint for input_features of my near_analysis and another junction (points) for my near_features. Is this possible? I can't find any documentation. Any ideas how? Thanks.
... View more
04-12-2011
09:21 AM
|
0
|
3
|
735
|
Online Status |
Offline
|
Date Last Visited |
06-15-2023
08:46 PM
|