AnsweredAssumed Answered

Extent on WFS To FeatureClass not working

Question asked by hermangroeneveld on Jun 20, 2019

Hallo, I'm an ArcGIS Desktop 10.7 user and struggling with WFS conversion in ArcPy. When using an extent in combination with WFSToFeatureClass, it raises an error.

The documentation tells me the WFS To Feature Class conversion should work with the extent of a feature class, display or whatever:

 

By default all features from the WFS source are added to the feature class. The extent environment setting can be used to limit the features to just those that intersect a user-defined extent...

 

This example works (without the use of Extent) but returns a complete set of features:

import arcpy

WFS_Service = "https://geodata.nationaalgeoregister.nl/cbspostcode4/wfs?&request=GetCapabilities&service=wfs"
WFS_FeatureType = "postcode42017"
Out_Location = r"C:\GIS data\FGDB_datatest.gdb"
Out_Name = "tmp2"

arcpy.WFSToFeatureClass_conversion(WFS_Service, WFS_FeatureType, Out_Location, Out_Name)

 

This example doesn't work:

import arcpy

fc_ext = r"C:\GIS data\FGDB_datatest.gdb\DS_datatest\test_01"
desc = arcpy.Describe(fc_ext)
arcpy.env.extent = desc.extent

WFS_Service = "https://geodata.nationaalgeoregister.nl/cbspostcode4/wfs?&request=GetCapabilities&service=wfs"
WFS_FeatureType = "postcode42017"
Out_Location = r"C:\GIS data\FGDB_datatest.gdb"
Out_Name = "tmp3"

arcpy.WFSToFeatureClass_conversion(WFS_Service, WFS_FeatureType, Out_Location, Out_Name)

 

The code above raises an error saying:

ERROR 999999: Error executing function

 

 

BTW: the used extent works with a simple featureclass with points and Select_analysis.

 

How can I make the extent setting get to work for me???

Outcomes