Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

MakeFeatureLayer_management where_clause input by the user

$
0
0

I want to convert a script into a toolbox and one of the parameters is selecting cities with a population > than 500000 hab. I’m using the function MakeFeatureLayer_management.

How can I do to introduce the value of the {where_clause} (‘”POP_MAX” > 500000′) using arcpy.GetParameterAsText?

import arcpy    
from arcpy import env    
env.overwriteOutput = True

wsp = env.workspace = arcpy.GetParameterAsText(0)    
wsp_result = arcpy.GetParameterAsText(1)

try:    
  arcpy.MakeFeatureLayer_management ("cities" + "layer_cities",'"POP_MAX" > 500000')

Viewing all articles
Browse latest Browse all 767

Latest Images

Trending Articles



Latest Images