<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Project shapefile returns blank output in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668287#M51875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ogr2ogr isn't that bad after all! If anyone else is having difficulty using the project tool in arcpy than I would recommend calling ogr2ogr from subprocess.call(). gdal isn't in my path so I need to call it using the full path to the executable. Here is a post on how to do to the conversion:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.mercatorgeosystems.com/blog-articles/2008/05/30/using-ogr2ogr-to-re-project-a-shape-file/"&gt;http://www.mercatorgeosystems.com/blog-articles/2008/05/30/using-ogr2ogr-to-re-project-a-shape-file/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;easy, fast, straightforward and free!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jan 2014 21:01:24 GMT</pubDate>
    <dc:creator>JasonTaylor</dc:creator>
    <dc:date>2014-01-10T21:01:24Z</dc:date>
    <item>
      <title>Project shapefile returns blank output</title>
      <link>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668284#M51872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Pretty simple here, hopefully the solution is obvious to the community. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. make event layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. export event layer to shapefile&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. re-project shapefile&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;InterpolationCSV = "path-to-csv"
XCoord = "Long"
YCoord = "Lat"
ZValue = "Result"
WorkingDirectory = "path-to-wd"

spRefWGS84 = "path-to-prj"
spRefSPN = "path-to-prj"

arcpy.MakeXYEventLayer_management(InterpolationCSV, XCoord, YCoord, "outXY_Layer", spRefWGS84)
arcpy.FeatureClassToFeatureClass_conversion("outXY_Layer", WorkingDirectory, "processpoints.shp")
arcpy.Project_management(WorkingDirectory + "processpoints.shp", WorkingDirectory + "processpoints2.shp", spRefSPN)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This yields a blank output for processpoints2.shp, no matter where I run it, without error.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 18:00:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668284#M51872</guid>
      <dc:creator>JasonTaylor</dc:creator>
      <dc:date>2014-01-09T18:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Project shapefile returns blank output</title>
      <link>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668285#M51873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;And the first shapefile turns out ok?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 19:35:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668285#M51873</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2014-01-09T19:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Project shapefile returns blank output</title>
      <link>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668286#M51874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, the first shapefile works just fine. I'm certain the problem is in the project tool. I'm currently using ogr2ogr as an alternative but it's a messy solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 20:12:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668286#M51874</guid>
      <dc:creator>JasonTaylor</dc:creator>
      <dc:date>2014-01-09T20:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Project shapefile returns blank output</title>
      <link>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668287#M51875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ogr2ogr isn't that bad after all! If anyone else is having difficulty using the project tool in arcpy than I would recommend calling ogr2ogr from subprocess.call(). gdal isn't in my path so I need to call it using the full path to the executable. Here is a post on how to do to the conversion:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.mercatorgeosystems.com/blog-articles/2008/05/30/using-ogr2ogr-to-re-project-a-shape-file/"&gt;http://www.mercatorgeosystems.com/blog-articles/2008/05/30/using-ogr2ogr-to-re-project-a-shape-file/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;easy, fast, straightforward and free!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 21:01:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668287#M51875</guid>
      <dc:creator>JasonTaylor</dc:creator>
      <dc:date>2014-01-10T21:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Project shapefile returns blank output</title>
      <link>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668288#M51876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you have trailing slashes or back slashes in your WorkingDirectory variable string?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It is surely not really "path-to-wd"...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is best to avoid them. There are a number of ways to do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I usually just explicitly include them inside the string,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;even when I am connatenating two or more path strings&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for example:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
path = r"D:\GIS_Utilities\Tasks\WebProductsImage"&amp;nbsp;&amp;nbsp; # mxd &amp;amp; gdb path
mxdName = "web_chart_6.mxd"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # mxd name
theMXD = r"%s\mxd\%s" % (path, mxdName)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # mxd full path
mxd = arcpy.mapping.MapDocument(theMXD)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # mxd object&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are various reasons I do this, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ansd there are more elenet ways to do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but the important one here is that there&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;are no \ or / or \\ at the end of any string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for a start, try passing explicit path\shapefile strings to the project tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh, and USE THE CODE FORMATING BUTTON when inserting code in a forum post.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:14:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/project-shapefile-returns-blank-output/m-p/668288#M51876</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2021-12-12T04:14:36Z</dc:date>
    </item>
  </channel>
</rss>

