I have a python script that is remapping old data to a new schema using Query Layers. Some of the old datasets do not exist so arcpy.MakeQueryLayer_management returns with all the proper fields but no rows - which is what I want. BUT when this happens Arc defaults to geometry type Point - where in some cases I want it to be Polygon or Polyline.
The help says this is correct but can be changed "before executing the tool". This makes no sense to me. Where is it expecting me to do this? I tried setting it to Polygon in the MakeQueryLayer tool but it does nothing (which the help says it should not).
Setting the coordinate system is no problem because it is inheriting from the Feature Dataset when I run arcpy.FeatureClassToFeatureClass_conversion after I make the query layer just fine.
I tried doing an append with a polygon dataset into the blank output but it will not run.
Help text
--------------
If the result of the SQL query does not return any rows, the output query layer will be empty, only containing the schema of the columns returned by the query. In this case, if the columns returned contain a spatial column the tool will use the following defaults to create the query layer:
Geometry type: POINT
SRID: 1
Spatial Reference: NAD1983
It will then be the up to the user to change any of these desired values before executing the tool.
-------------
Other than that it is working really well.
Thanks for any help.
The help says this is correct but can be changed "before executing the tool". This makes no sense to me. Where is it expecting me to do this? I tried setting it to Polygon in the MakeQueryLayer tool but it does nothing (which the help says it should not).
Setting the coordinate system is no problem because it is inheriting from the Feature Dataset when I run arcpy.FeatureClassToFeatureClass_conversion after I make the query layer just fine.
I tried doing an append with a polygon dataset into the blank output but it will not run.
Help text
--------------
If the result of the SQL query does not return any rows, the output query layer will be empty, only containing the schema of the columns returned by the query. In this case, if the columns returned contain a spatial column the tool will use the following defaults to create the query layer:
Geometry type: POINT
SRID: 1
Spatial Reference: NAD1983
It will then be the up to the user to change any of these desired values before executing the tool.
-------------
Other than that it is working really well.
Thanks for any help.