Select to view content in your preferred language

Python code ERROR 000670

3562
14
Jump to solution
05-12-2014 04:17 AM
CezaryGorczynski
Deactivated User
Hi,
I'm learning to write scripts and I have now some problem.

import arcpy

arcpy.env.workspace = "c:/wtyczka/"
arcpy.env.overwriteOutput = True
outWorkspace = "c:/wtyczka/"

#dane
Wybor_gminy = "'Wyszków'"
Warstwa_zabudowy = arcpy.GetParameterAsText(0)
Bufor_od_zabudowy = arcpy.GetParameterAsText(1)
Warstwa_sieci_drog = arcpy.GetParameterAsText(2)
Bufor_od_sieci_drog = arcpy.GetParameterAsText(3)
Warstwa_sieci_kolejowej = arcpy.GetParameterAsText(4)
Bufor_od_sieci_kolejowej = arcpy.GetParameterAsText(5)
Warstwa_inna = arcpy.GetParameterAsText(6)
Bufor_od_inna = arcpy.GetParameterAsText(7)
Warstwa_inna_1 = arcpy.GetParameterAsText(8)
Bufor_od_inna_1 = arcpy.GetParameterAsText(9)
gminy = "c:/wtyczka/gminy_92.shp"
gmina = "c:/wtyczka/gmina.shp"
selekcja = '"GMINA"'+ " = " + "'Wyszków'"
lista = []

# Local variables:
zabudowa_clip = Warstwa_zabudowy
zabudowa_clip_bufor = zabudowa_clip
drogi_clip = Warstwa_sieci_drog
drogi_clip_bufor = drogi_clip
kolej_clip = Warstwa_sieci_kolejowej
kolej_clip_bufor = kolej_clip
inna_clip = Warstwa_inna
inna_clip_bufor = inna_clip
inna1_clip = Warstwa_inna_1
inna1_clip_bufor = inna_clip

#selekcja
arcpy.Select_analysis(gminy, gmina, '"GMINA" = \'Wyszków\'')

# Process: Clip zabudowa
if arcpy.Exists(Warstwa_zabudowy):
arcpy.Clip_analysis(Warstwa_zabudowy, gmina, zabudowa_clip, "0") - line 41
else:
print "false"

When I'm trying run this stript in ArcMap is an ERROR 000670: output Output Feature Class is same as input Input Features
Failed to execute (Clip).
I don't know why because input and out put Features has other names.

Please help! 🙂
Tags (2)
0 Kudos
14 Replies
CezaryGorczynski
Deactivated User
It's strange for me too.

I changed the worspace for personal geodatabase and script was running but ArcGIS get frozen at some moment. Was created only
zabudowa_clip, zabudowa_clip_bufor, drogi_clip, drogi_clip_bufor and obviously gmina.

I don't know what to do with this.
0 Kudos
CezaryGorczynski
Deactivated User
I wrote this script - zzzzz.py
But when I'm running it every process is false.

[ATTACH=CONFIG]33959[/ATTACH]
0 Kudos
CezaryGorczynski
Deactivated User
I wrote this script - zzzzz.py

But I have this problems:
[ATTACH=CONFIG]33960[/ATTACH]
0 Kudos
JoshuaChisholm
Frequent Contributor
I can spot two possible problems:

  1. I'm not sure if this is an error or not.
    kolej_clip_bufor = "c:/wtyczka/New Personal Geodatabase.mdb/gminy_92"

  2. #Change to:
    kolej_clip_bufor = "c:/wtyczka/New Personal Geodatabase.mdb/kolej_clip_bufor"
  3. You should be using the variable names, not strings in quotes.

  4. lista.append("zabudowa_clip_bufor")
    #Change to:
    lista.append(zabudowa_clip_bufor)

    Do this for ALL lista.append lines.

Let me know if that fixes it.
0 Kudos
CezaryGorczynski
Deactivated User
Sorry I was sailing 2 weeks.

I still have the same problem with this script 😕
0 Kudos