chrisjcantire

beginner command/scripting/python help, 9.3

Discussion created by chrisjcantire on Mar 22, 2013
Latest reply on Mar 25, 2013 by chrisjcantire
hi guys, long time lurker occasional poster...

if the information I'm after is already elsewhere, please point me in the right direction if it's faster.

I've just started using arcgis 9.3 + arcinfo after years of using mapinfo. what I'd like to do is just type my commands in arc much like the command line in mapinfo; sql commands for one would be amazing. this doesn't seem apparent in arcgis 9.3 but I could be wrong. I see the command line window but I'm not familiar with the syntax or functions found therein yet. what I used to do in mapinfo was write code in mapbasic, then run those mapbasic programs in mapinfo; can something similar be done here? if python is what I need to learn I don't mind, it's the linking of a working python script (and validation/compilation of that script) to arcmap9.3 that concerns me.

perhaps my first task can give you some insight into where I should post this, quickly...

point layer1 has say 10 points
point layer2 has say 100 points spread over the same area as layer1
what I want is to know the five closest points from layer2 for each point in layer1...

for each layer1.obj, i <=5, i++
find next closest layer2.obj
end loop

results would be something like:

layer1 item1 (1,2,3,4,5 closest points from layer2 and their distances)
layer1 item2 (1,2,3,4,5 closest points from layer2 and their distances)
...
layer1 item10 (1,2,3,4,5 closest points from layer2 and their distances)

with admittedly whimsical syntax that is what i'm picturing; if someone could translate that into an arc environment I'd be very grateful, or point me to the proper forum.  I understand that the point distance tool would be a start, but, can this be extended to include for loops/SQL, that sort of thing; I'm obviously stuck on mapinfo/mapbasic in my mind.

thanks very much for reading,

cj

Outcomes