Make Feature Layer from Query Layer yields an ArcPy error?Listing Elements or Datasets of Layer gives ERROR...

How do spaceships determine each other's mass in space?

Finitely many repeated replacements

Source permutation

What is the population of Romulus in the TNG era?

Specifying a starting column with colortbl package and xcolor

After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?

Which situations would cause a company to ground or recall a aircraft series?

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

I can't die. Who am I?

Getting the || sign while using Kurier

Does a difference of tense count as a difference of meaning in a minimal pair?

Gaining more land

From an axiomatic set theoric approach why can we take uncountable unions?

What problems would a superhuman have who's skin is constantly hot?

MySQL importing CSV files really slow

Can't make sense of a paragraph from Lovecraft

Why is a very small peak with larger m/z not considered to be the molecular ion?

School performs periodic password audits. Is my password compromised?

Are there historical instances of the capital of a colonising country being temporarily or permanently shifted to one of its colonies?

What do *foreign films* mean for an American?

Are all players supposed to be able to see each others' character sheets?

Is it possible to find 2014 distinct positive integers whose sum is divisible by each of them?

How do electrons receive energy when a body is heated?

Doubts in understanding some concepts of potential energy



Make Feature Layer from Query Layer yields an ArcPy error?


Listing Elements or Datasets of Layer gives ERROR 000840 value is not Feature Layer?Script exported from ModelBuilder gives ERROR 000733 at SelectByLocation?Error 999999 on FeatureClass To FeatureClass conversion in ArcPy?Creating layers for each attribute value via Arcpy scriptRecursively getting all lyr file properties from group layer on disk using ArcPy?How to detect Query Layer for toolvalidation using arcpy?Using ArcPy to add all unique values from TIFsIf/then statement with layer definition querySQL query new feature within definition within loop of cursorIs there a way to list all the layers created using the arcpy.MakeFeatureLayer_Management() method?













2















My project starts from a MXD containing Query Layers. I have to prepare the data in this "MasterMXD" for use in an offline application. Working with ArcMap 10.2.1 for this project. My Python script follows a simple structure:




  • Loop over all layers in the MasterMXD.

  • MakeFeatureLayer from the Query layer.

  • FeatureClassToFeatureClass to store feature layer as a feature class.

  • Continue from there to CreateRuntimeContent later in the script.


Here is part of my Python script:



for df in arcpy.mapping.ListDataFrames(master_mxd):
for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
lyrName = lyr.name.encode("ascii", "ignore")
lyrName = lyrName.replace(" ", "")
featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)
arcpy.FeatureClassToFeatureClass_conversion(featureLyr, outFolder, lyrName)


The problem I am facing is that some of the layers in the MXD pass through the script without problem, while others give an error 000229:




ERROR 000229: cannot open GPL0 for the MakeFeatureLayer_management tool.




It is always the same layers that give the error.



I cannot see any differences between layers that give this error and the layers that do not give it. I did not construct the database that serves the query layers and cannot find any 'GPL0' anywhere. I'm puzzled!



Does anyone have an idea what is causing this ERROR 000229 showing up for some of my query layers in the MakeFeatureLayer_management tool?










share|improve this question




















  • 1





    Also, and this may be incidental since you stated your code works part of the time, but I've always used .getOutput(0) or simply a call by index [0] on MFL to return the layer result: featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)[0]

    – T. Wayne Whitley
    Feb 23 '17 at 0:56













  • Thanks guys. Midavalo, skipping the MakeFeatureLayer line worked. I thought I would not be able to use a query layer in the FeatureClassToFeatureClass.

    – Wout
    Feb 28 '17 at 8:17
















2















My project starts from a MXD containing Query Layers. I have to prepare the data in this "MasterMXD" for use in an offline application. Working with ArcMap 10.2.1 for this project. My Python script follows a simple structure:




  • Loop over all layers in the MasterMXD.

  • MakeFeatureLayer from the Query layer.

  • FeatureClassToFeatureClass to store feature layer as a feature class.

  • Continue from there to CreateRuntimeContent later in the script.


Here is part of my Python script:



for df in arcpy.mapping.ListDataFrames(master_mxd):
for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
lyrName = lyr.name.encode("ascii", "ignore")
lyrName = lyrName.replace(" ", "")
featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)
arcpy.FeatureClassToFeatureClass_conversion(featureLyr, outFolder, lyrName)


The problem I am facing is that some of the layers in the MXD pass through the script without problem, while others give an error 000229:




ERROR 000229: cannot open GPL0 for the MakeFeatureLayer_management tool.




It is always the same layers that give the error.



I cannot see any differences between layers that give this error and the layers that do not give it. I did not construct the database that serves the query layers and cannot find any 'GPL0' anywhere. I'm puzzled!



Does anyone have an idea what is causing this ERROR 000229 showing up for some of my query layers in the MakeFeatureLayer_management tool?










share|improve this question




















  • 1





    Also, and this may be incidental since you stated your code works part of the time, but I've always used .getOutput(0) or simply a call by index [0] on MFL to return the layer result: featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)[0]

    – T. Wayne Whitley
    Feb 23 '17 at 0:56













  • Thanks guys. Midavalo, skipping the MakeFeatureLayer line worked. I thought I would not be able to use a query layer in the FeatureClassToFeatureClass.

    – Wout
    Feb 28 '17 at 8:17














2












2








2








My project starts from a MXD containing Query Layers. I have to prepare the data in this "MasterMXD" for use in an offline application. Working with ArcMap 10.2.1 for this project. My Python script follows a simple structure:




  • Loop over all layers in the MasterMXD.

  • MakeFeatureLayer from the Query layer.

  • FeatureClassToFeatureClass to store feature layer as a feature class.

  • Continue from there to CreateRuntimeContent later in the script.


Here is part of my Python script:



for df in arcpy.mapping.ListDataFrames(master_mxd):
for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
lyrName = lyr.name.encode("ascii", "ignore")
lyrName = lyrName.replace(" ", "")
featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)
arcpy.FeatureClassToFeatureClass_conversion(featureLyr, outFolder, lyrName)


The problem I am facing is that some of the layers in the MXD pass through the script without problem, while others give an error 000229:




ERROR 000229: cannot open GPL0 for the MakeFeatureLayer_management tool.




It is always the same layers that give the error.



I cannot see any differences between layers that give this error and the layers that do not give it. I did not construct the database that serves the query layers and cannot find any 'GPL0' anywhere. I'm puzzled!



Does anyone have an idea what is causing this ERROR 000229 showing up for some of my query layers in the MakeFeatureLayer_management tool?










share|improve this question
















My project starts from a MXD containing Query Layers. I have to prepare the data in this "MasterMXD" for use in an offline application. Working with ArcMap 10.2.1 for this project. My Python script follows a simple structure:




  • Loop over all layers in the MasterMXD.

  • MakeFeatureLayer from the Query layer.

  • FeatureClassToFeatureClass to store feature layer as a feature class.

  • Continue from there to CreateRuntimeContent later in the script.


Here is part of my Python script:



for df in arcpy.mapping.ListDataFrames(master_mxd):
for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
lyrName = lyr.name.encode("ascii", "ignore")
lyrName = lyrName.replace(" ", "")
featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)
arcpy.FeatureClassToFeatureClass_conversion(featureLyr, outFolder, lyrName)


The problem I am facing is that some of the layers in the MXD pass through the script without problem, while others give an error 000229:




ERROR 000229: cannot open GPL0 for the MakeFeatureLayer_management tool.




It is always the same layers that give the error.



I cannot see any differences between layers that give this error and the layers that do not give it. I did not construct the database that serves the query layers and cannot find any 'GPL0' anywhere. I'm puzzled!



Does anyone have an idea what is causing this ERROR 000229 showing up for some of my query layers in the MakeFeatureLayer_management tool?







arcpy layers feature-layer query-layer error-000229






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 19 at 23:10









Andre Silva

7,725113685




7,725113685










asked Feb 22 '17 at 16:46









WoutWout

597




597








  • 1





    Also, and this may be incidental since you stated your code works part of the time, but I've always used .getOutput(0) or simply a call by index [0] on MFL to return the layer result: featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)[0]

    – T. Wayne Whitley
    Feb 23 '17 at 0:56













  • Thanks guys. Midavalo, skipping the MakeFeatureLayer line worked. I thought I would not be able to use a query layer in the FeatureClassToFeatureClass.

    – Wout
    Feb 28 '17 at 8:17














  • 1





    Also, and this may be incidental since you stated your code works part of the time, but I've always used .getOutput(0) or simply a call by index [0] on MFL to return the layer result: featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)[0]

    – T. Wayne Whitley
    Feb 23 '17 at 0:56













  • Thanks guys. Midavalo, skipping the MakeFeatureLayer line worked. I thought I would not be able to use a query layer in the FeatureClassToFeatureClass.

    – Wout
    Feb 28 '17 at 8:17








1




1





Also, and this may be incidental since you stated your code works part of the time, but I've always used .getOutput(0) or simply a call by index [0] on MFL to return the layer result: featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)[0]

– T. Wayne Whitley
Feb 23 '17 at 0:56







Also, and this may be incidental since you stated your code works part of the time, but I've always used .getOutput(0) or simply a call by index [0] on MFL to return the layer result: featureLyr = arcpy.MakeFeatureLayer_management(lyr, lyrName)[0]

– T. Wayne Whitley
Feb 23 '17 at 0:56















Thanks guys. Midavalo, skipping the MakeFeatureLayer line worked. I thought I would not be able to use a query layer in the FeatureClassToFeatureClass.

– Wout
Feb 28 '17 at 8:17





Thanks guys. Midavalo, skipping the MakeFeatureLayer line worked. I thought I would not be able to use a query layer in the FeatureClassToFeatureClass.

– Wout
Feb 28 '17 at 8:17










1 Answer
1






active

oldest

votes


















0














Take a look at What is a query layer?:




Query Layers behave like any other feature layer or stand-alone table, so they can be used to display data, used as input into a geoprocessing tool, or accessed programmatically using developer APIs.




That is why using it directly (as input parameter) in Feature Class to Feature Class worked (as suggested by Midavalo).



for df in arcpy.mapping.ListDataFrames(master_mxd):
for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
lyrName = lyr.name.encode("ascii", "ignore")
lyrName = lyrName.replace(" ", "")
arcpy.FeatureClassToFeatureClass_conversion(lyr, outFolder, lyrName)


About the ArcPy Error 000229: Cannot open <value>, this article lists possible causes:





  • The data is inaccessible, unavailable, or invalid.

  • There are unsupported data types in 64-bit background processing.

  • Unsupported tools are unable to run in background processing.

  • The 64-bit background geoprocessing does not have the necessary 64-bit libraries.







share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "79"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f229469%2fmake-feature-layer-from-query-layer-yields-an-arcpy-error%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Take a look at What is a query layer?:




    Query Layers behave like any other feature layer or stand-alone table, so they can be used to display data, used as input into a geoprocessing tool, or accessed programmatically using developer APIs.




    That is why using it directly (as input parameter) in Feature Class to Feature Class worked (as suggested by Midavalo).



    for df in arcpy.mapping.ListDataFrames(master_mxd):
    for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
    lyrName = lyr.name.encode("ascii", "ignore")
    lyrName = lyrName.replace(" ", "")
    arcpy.FeatureClassToFeatureClass_conversion(lyr, outFolder, lyrName)


    About the ArcPy Error 000229: Cannot open <value>, this article lists possible causes:





    • The data is inaccessible, unavailable, or invalid.

    • There are unsupported data types in 64-bit background processing.

    • Unsupported tools are unable to run in background processing.

    • The 64-bit background geoprocessing does not have the necessary 64-bit libraries.







    share|improve this answer






























      0














      Take a look at What is a query layer?:




      Query Layers behave like any other feature layer or stand-alone table, so they can be used to display data, used as input into a geoprocessing tool, or accessed programmatically using developer APIs.




      That is why using it directly (as input parameter) in Feature Class to Feature Class worked (as suggested by Midavalo).



      for df in arcpy.mapping.ListDataFrames(master_mxd):
      for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
      lyrName = lyr.name.encode("ascii", "ignore")
      lyrName = lyrName.replace(" ", "")
      arcpy.FeatureClassToFeatureClass_conversion(lyr, outFolder, lyrName)


      About the ArcPy Error 000229: Cannot open <value>, this article lists possible causes:





      • The data is inaccessible, unavailable, or invalid.

      • There are unsupported data types in 64-bit background processing.

      • Unsupported tools are unable to run in background processing.

      • The 64-bit background geoprocessing does not have the necessary 64-bit libraries.







      share|improve this answer




























        0












        0








        0







        Take a look at What is a query layer?:




        Query Layers behave like any other feature layer or stand-alone table, so they can be used to display data, used as input into a geoprocessing tool, or accessed programmatically using developer APIs.




        That is why using it directly (as input parameter) in Feature Class to Feature Class worked (as suggested by Midavalo).



        for df in arcpy.mapping.ListDataFrames(master_mxd):
        for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
        lyrName = lyr.name.encode("ascii", "ignore")
        lyrName = lyrName.replace(" ", "")
        arcpy.FeatureClassToFeatureClass_conversion(lyr, outFolder, lyrName)


        About the ArcPy Error 000229: Cannot open <value>, this article lists possible causes:





        • The data is inaccessible, unavailable, or invalid.

        • There are unsupported data types in 64-bit background processing.

        • Unsupported tools are unable to run in background processing.

        • The 64-bit background geoprocessing does not have the necessary 64-bit libraries.







        share|improve this answer















        Take a look at What is a query layer?:




        Query Layers behave like any other feature layer or stand-alone table, so they can be used to display data, used as input into a geoprocessing tool, or accessed programmatically using developer APIs.




        That is why using it directly (as input parameter) in Feature Class to Feature Class worked (as suggested by Midavalo).



        for df in arcpy.mapping.ListDataFrames(master_mxd):
        for lyr in arcpy.mapping.ListLayers(master_mxd, data_frame = df):
        lyrName = lyr.name.encode("ascii", "ignore")
        lyrName = lyrName.replace(" ", "")
        arcpy.FeatureClassToFeatureClass_conversion(lyr, outFolder, lyrName)


        About the ArcPy Error 000229: Cannot open <value>, this article lists possible causes:





        • The data is inaccessible, unavailable, or invalid.

        • There are unsupported data types in 64-bit background processing.

        • Unsupported tools are unable to run in background processing.

        • The 64-bit background geoprocessing does not have the necessary 64-bit libraries.








        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 9 mins ago

























        answered Feb 19 at 23:00









        Andre SilvaAndre Silva

        7,725113685




        7,725113685






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f229469%2fmake-feature-layer-from-query-layer-yields-an-arcpy-error%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Щит и меч (фильм) Содержание Названия серий | Сюжет |...

            Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

            Meter-Bus Содержание Параметры шины | Стандартизация |...