Hi,
as the header says, I do have a problem in getting only the datasets I want. In the following my parameter definition is shown, where from I would expect to get only feature classes of type point to be shown.
p_envWorkS = arcpy.Parameter(
displayName = 'Workspace',
name = 'in_ws',
datatype = 'DEWorkspace',
parameterType = 'Required',
direction = 'Input',
category = '1. Input Settings')
p_envPoints = arcpy.Parameter(
displayName = 'Input FeatureClass',
name = 'in_fc',
datatype = 'DEFeatureClass',
parameterType = 'Required',
direction = 'Input',
category = '1. Input Settings')
p_envPoints.parameterDependencies = [p_envWorkS.name]
p_envPoints.filter.list = ['POINT']
However, the following screenshot shows all kind of content. Even feature datasets are listed... hence the name 'roads' shows twice.
Does some of you know where I am going wrong or what I am missing the get the correct feature type shown?
Best regards,
Thomas
Solved! Go to Solution.
I have responded to this question on GIS Stack exchange.
Use GPFeatureLayer as your datatype instead.
Hi Jason,
there is no difference in the resulting list if I replace DEFeatureClass in line 12 by GPFeatureLayer.
Reading the definition below it looks to me as if GPFeatureLayer is in my case actually a detour to the datasets requested.
What escapes me at this point as well is why GPFeatureLayer should work, respectively why does it work anyway.
According to the Resource Center
DEFeatureClass = A collection of spatial data with the same shape type: point, multipoint, polyline, and polygon.
GPFeatureLayer = A reference to a feature class, including symbology and rendering properties.
finally,
a DEFeatureDataset = A collection of feature classes that share a common geographic area and the same spatial reference system.
By my understanding, GPFeatureClass would be the way to go, FeatureDatasets should not appear, and the filter list set should only populate the list of FeatureClasses with datasets of type point.
Any other suggestions for the problem at hand?
I tried to create a minimal example and wrapped it in the attached file. It contains a minimalistic FGDB and the toolbox.
Cheers, Thomas
I have responded to this question on GIS Stack exchange.