<?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: How to create an Shapefile on ArcGIS Server side? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198233#M15199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Sven,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your script specify the Temp drive using a UNC path.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;\\&amp;lt;ArcGIS Server name\Temp&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note:&amp;nbsp; be sure the Temp drive is shared&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another option is to publish your script to ArcGIS Server.&amp;nbsp; The output shapefile will then be written to you 'arcgisjobs' folder on your ArcGIS Server machine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Nov 2012 14:39:46 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2012-11-26T14:39:46Z</dc:date>
    <item>
      <title>How to create an Shapefile on ArcGIS Server side?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198232#M15198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am developing a script which gets an JSON array with point coordinates. This array is encoded to a python dictionary. From this I filter all points (latitude and longitude) and an ID. This coordinates are converted into arcpy-points by using arcpy.Point(). Now in a next step I want to create a shapefile of these points by using &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;arcpy.CopyFeatures_management(ptList, r"pointTemp.shp")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is how to store this shapefile into a folder which is located on ArcGIS Server side. Do I have to give the skript a special path or location? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One folder that is on ArcGIS Server side in my case is "C:\temp", I have full read and wright rights, but the script doesn´t create the shapefile in this folder. If I run the script local on my pc, all works fine and the shape is created and stored locally on "C:\temp".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions or tips?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sven&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 13:17:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198232#M15198</guid>
      <dc:creator>SvenHarpering</dc:creator>
      <dc:date>2012-11-26T13:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an Shapefile on ArcGIS Server side?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198233#M15199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Sven,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your script specify the Temp drive using a UNC path.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;\\&amp;lt;ArcGIS Server name\Temp&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note:&amp;nbsp; be sure the Temp drive is shared&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another option is to publish your script to ArcGIS Server.&amp;nbsp; The output shapefile will then be written to you 'arcgisjobs' folder on your ArcGIS Server machine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 14:39:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198233#M15199</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-11-26T14:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an Shapefile on ArcGIS Server side?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198234#M15200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, that works! I have a follow-up question. When I want to use the function spatial join, I use as input my point.shp, but how do I have to call a second shape that lies somewhere else on the Server? Sorry, if these are stupid question, but I am new to this stuff.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A Database with FeatureClasses is located here on the Server: C:\arcgisserver\directories\arcgissystem\arcgisinput\project\project.MapServer\extracted\v101\database.gdb&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But this path does not work. Do I have to change something? I call the path with r":\arcgisserver\directories\arcgissystem\arcgisinput\project\project.MapServer\extracted\v101\database.gdb\featureClass"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sven&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 16:08:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198234#M15200</guid>
      <dc:creator>SvenHarpering</dc:creator>
      <dc:date>2012-11-26T16:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an Shapefile on ArcGIS Server side?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198235#M15201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post the code that you're using?&amp;nbsp; Also, what is the error you are receiving?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 16:45:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198235#M15201</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-11-26T16:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an Shapefile on ArcGIS Server side?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198236#M15202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is the code I am using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# -*- coding: cp1252 -*-

# Import modules
import arcpy, arcgisscripting, json

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Workspace
&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.env.workspace = r"C:\temp\\"
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp = arcgisscripting.create()

&amp;nbsp;&amp;nbsp;&amp;nbsp; # ENV Settings
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = 1

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Local variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; i = 0 
&amp;nbsp;&amp;nbsp;&amp;nbsp; value = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; ptList = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; rowNumberList = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; pt = arcpy.Point()

&amp;nbsp;&amp;nbsp;&amp;nbsp; #String input:&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; input = arcpy.GetParameterAsText(0)
 
 #JSON array to Python dictionary
&amp;nbsp;&amp;nbsp;&amp;nbsp; data&amp;nbsp; = json.loads(input)

&amp;nbsp;&amp;nbsp;&amp;nbsp; for entries in data['points']:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowNumberList.append(data['points']&lt;I&gt;['rowNumber'])
 pt.X = data['points']&lt;I&gt;['longitude']
 pt.Y = data['points']&lt;I&gt;['latitude']
 ptList.append(arcpy.PointGeometry(pt))
 i += 1
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(ptList, r"pointTemp.shp")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Add the filed 'rowNumber'
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(r"pointTemp.shp", "rowNumber", "SHORT")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Fill the field 'rowNumber'
&amp;nbsp;&amp;nbsp;&amp;nbsp; cur = gp.UpdateCursor(r"pointTemp.shp")
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = cur.Next()

&amp;nbsp;&amp;nbsp;&amp;nbsp; while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.rowNumber = rowNumberList[value]
 cur.UpdateRow(row)
 row = cur.Next()
 value += 1

&amp;nbsp;&amp;nbsp;&amp;nbsp; del cur

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Spatial Join
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SpatialJoin_analysis(r"pointTemp.shp",r"C:\arcgisserver\directories\arcgissystem\arcgisinput\cresta\lowres_deutschland.MapServer\extracted\v101\cresta.gdb\Cresta_Low_Res",r"join_result.shp")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # FeatureClass / Shapefile,
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = r"join_result.shp"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Fields that should be returned by the cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; field = ["CRESTA_ID"]

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Loop through the attribute table with a cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc, field) as cursor:&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; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(row[0])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SetParameterAsText(1, "Eintrag: " + str(row[0]))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
except Exception, e:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SetParameterAsText(2, e)&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is in the spatial join function. Here I need to tell the script where he has to search for the second shape/feature class to join with the point shape.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:53:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198236#M15202</guid>
      <dc:creator>SvenHarpering</dc:creator>
      <dc:date>2021-12-11T09:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an Shapefile on ArcGIS Server side?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198237#M15203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is the error you receive when you execute this code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 11:21:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198237#M15203</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-11-28T11:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an Shapefile on ArcGIS Server side?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198238#M15204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry for the late answer. I solved the problem. I didn´t register the UNC path in a correct way. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 07:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-create-an-shapefile-on-arcgis-server-side/m-p/198238#M15204</guid>
      <dc:creator>SvenHarpering</dc:creator>
      <dc:date>2012-11-29T07:00:55Z</dc:date>
    </item>
  </channel>
</rss>

