|
POST
|
ArcGIS Pro (beta) is 3.4 ArcGIS 10.3 (development, not released) is 2.7.5. The only change that may happen between now and release is Python moving to 2.7.7, but I haven't heard discussion one way or another on this. 10.3 will not use 3.4. If you install each product on the same machine, they wont/cant use the other Python.
... View more
06-10-2014
11:56 AM
|
0
|
0
|
3059
|
|
POST
|
Yeah, sorry about this... arcpy.env.scratchWorkspace = r"C:\temp\pppp" I realized after I push submit I had that in my code snippet: I write code in an IDE but like to know where my output is going, so I added that. >Very brief back story on scratchFolder for you and anyone else reading.... When you run a tool in the app (arcmap for example), the scratchFolder and scratchGDB are derived from whatever the applications scratchWorkspace is. When you run a script from command line or an IDE - the scratchworkspace isn't set. So by default this gets set to a folder in your user accounts temp directory (its annoying to go find it). So I can control where the output of the scratchFolder gets put by setting the scratchWorkspace in the script. For GP Services - scratchWorkspace doesn't matter, in fact its set and you can't change it. Its always created as a new directory with the GUID of the executing job. So its simply handled and works when you write to scratchFolder. As for your understanding: yes. Its 2 parts. Its what you have in your script, but more importantly its the parameter type you've set on the tool itself. Like you said, in this case, file. In terms of a PYT - yeah, probably go with that based on your requirements (yes you control params via code inside). The TBX itself is binary, so its unlikely your change system will be able to identify changes made to the file? So a PYT, basically being text would work well for you, I'd guess. Change system aside, PYT vs. TBX+Script for GP Server: it doesn't matter. For GP Services a tool is a tool is a tool. The guts underneath might be different, but these two scenarios may as well be the same thing, so I just say go with what you like most.
... View more
05-29-2014
10:39 AM
|
0
|
0
|
2469
|
|
POST
|
I think you're falling into the mindset a lot of people do when trying to return a file. My first bit of advice is to not over think it (yeah, easier said then done, I know). If you have a tool in Desktop that works...ie, a python script tool that outputs a file, you have a parameter that either is output required or a derived output - either way, its of type FILE. You run this tool in Desktop, open the results window, expand that successful result and there will be the output file you can double click. If you're output a txt file, double clicking it should open it in notepad (or whatever you PC opens .txt files with). Now moving to Server, dont over think it assuming you need to return a URL or worry about virtual directories. The GP/Server framework handles all of this. The only thing that changes in terms of GP Server and file output is the client consuming the service. If your client happens to be ArcMap, run the tool from your server connection. Expand the result in the Results window and double click the result. Exact same experience...ArcMap as a client handled getting the file down from the Server and helped you open it. If your client is the Services Directory (REST Endpoint), a successful result will return a link you can click to download the file. If your client is a web app, you do need to write some code to handle getting the result and saving it (well telling the browser to popup a box and save it). Apologies if I'm off base and you understand this bit - if your question is "how do I write the python code to output a file", well it should be handled as well. In short, your code could be this simple (assuming input parameter of string and derived output parameter of file) import arcpy import os getInputTxt = arcpy.GetParameterAsText(0) txtFile = os.path.join(arcpy.env.scratchFolder, "myTxt.txt") f = open(txtFile, 'w') f.writelines(getInputTxt) f.close arcpy.SetParameterAsText(1, txtFile)
... View more
05-29-2014
09:30 AM
|
3
|
1
|
2469
|
|
POST
|
I thought about just enabling warning level messages and using arcpy.AddWarning to report % completion but that just seems like using an inappropriate messaging system to report informative messages. Thats exactly the method I suggest when presenting the Creating GP Services session if you want fine grain control over what messages come back to a Web App. The web app has no knowledge if a message is info, warning or error, its just a message you get back and display if you want. The example here is using AddWarning and the app just grabs/spits those messages to the window: http://gpdemos.esri.com/demos/uploadcsv/uploadcsv.html Find downloads for that service from here http://gpdemos.esri.com/
... View more
05-27-2014
09:01 AM
|
0
|
0
|
705
|
|
POST
|
Gino, I dont know if you'll see a difference between 10.1 sp1 and 10.2.2 - I dont recall a lot of issues in regards to KML being fixed there. Most of these issues were fixed in 10.0 sp1-5. That said, I went back and tested with a cadastral layer as I thought maybe that has something to do with it. I'm not an expert with the fabric layer, but my output KMZ looks the same as the fabric layer inside ArcMap that has a def query. I put the def query on my yellow colored parcels layer - you can see that the two images look the same. (without the def query all parcels are yellow)
... View more
05-26-2014
05:07 AM
|
0
|
0
|
2629
|
|
POST
|
Your link got garbled, so I'm not sure if you're pointing to the first or 2nd version of the blog. In the 2nd version of the blog, you can enter a description into the INI file. http://blogs.esri.com/esri/arcgis/2014/01/24/updating-your-hosted-feature-service-for-10-2/ As for the thumbnail, I see its part of the item common parameters: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000009v000000 That said, you could enhance the script to upload a thumbnail when uploading the SD. You could go as far as generating a new thumbnail everytime you run the script (from the MXD). There is an arcpy command: http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000000n000000 or some code examples in this Q&A: http://mappingcenter.esri.com/index.cfm?fa=ask.answers&q=1504
... View more
05-23-2014
05:09 AM
|
0
|
1
|
656
|
|
POST
|
Which version are you using? I believe the crash when overwriting was fixed in 10.2 or 10.2.1
... View more
05-23-2014
04:57 AM
|
0
|
0
|
790
|
|
POST
|
What version are you using? I just tried in 10.2.2 and a def query on the layer in an mxd is honored.
... View more
05-23-2014
04:51 AM
|
0
|
0
|
2629
|
|
POST
|
Your code looks good. Try saving a copy of the MXD and pass that into the tool. #-------------------PARAMETERS--------------------------------------------------
textfilePath = r"C:\_TEMP_SSD_PERFORMANCE\ToKML Test\SLATS1011_LotPlans2.txt"
mxdPath = r"C:\_TEMP_SSD_PERFORMANCE\ToKML Test\ExportToKMZ.mxd"
outputFolder = r"C:\_TEMP_SSD_PERFORMANCE\ToKML Test\Outputs"
#-------------------------------------------------------------------------------
import arcpy
import os
import re
def ReadTextFile(path):
textFile = open(path, "r")
lines = textFile.readlines()
textFile.close
return lines
def Extract(lotplan, extent, tempMXD):
try:
outKMZ = os.path.join(outputFolder, lotplan + ".kmz")
if arcpy.Exists(outKMZ):
os.remove(outKMZ)
cleanextent = re.sub('[A-Za-z]', '', str(extent))
arcpy.MapToKML_conversion(tempMXD,"KMZExportMap", outKMZ,"0","NO_COMPOSITE","VECTOR_TO_IMAGE",cleanextent,"1024","96","CLAMPED_TO_GROUND")
except Exception, e:
print e.message
# Get parcel description from .txt file
lotplanList = ReadTextFile(textfilePath)
# Get MXD, etc.
mxd = arcpy.mapping.MapDocument(mxdPath)
df = arcpy.mapping.ListDataFrames(mxd, "KMZExportMap") [0]
subjectLayer = arcpy.mapping.ListLayers(mxd,"Subject Area", df)[0]
# Iterate parcels, apply definition query and export
for lotplan in lotplanList:
cleanlotplan = lotplan.strip()
whereClause = """"LOTPLAN" = '""" + cleanlotplan + "'"
subjectLayer.definitionQuery = whereClause
extent = subjectLayer.getSelectedExtent(False)
print cleanlotplan
#save a copy of the mxd with the updated def query
tempMXD = os.path.join(arcpy.env.scratchFolder, "tempmxd.mxd")
mxd.saveACopy(tempMXD)
Extract(cleanlotplan,extent, tempMXD)
#delete that temp mxd
os.remove(tempMXD)
subjectLayer.definitionQuery = None
del subjectLayer
del mxd
del lotplanList
... View more
05-22-2014
05:43 AM
|
0
|
0
|
2629
|
|
POST
|
I haven't worked with BeagleBone, but if it can do php hosting, I dont see why it wouldn't be able to host a simple javascript app. These tiny embedded PCs are great for projects like this (web hosting). With "google" and your "sysadmin" available, I think you should be quite successful. Looks like you'll even learn a little linux while you're at it. Best of luck, I agree about how valuable hands on learning is.
... View more
05-20-2014
12:03 PM
|
0
|
0
|
1290
|
|
POST
|
The (hopefully brilliant) idea I have is to host my own JavaScript apps at home. I want to configure an application or two and use them as examples/demos in conjunction with my resume and host everything on a personal webserver. My thinking is I could purchase an ArcGIS for Home Use license for map creation, publish services to ArcGIS Online, host the JavaScript, browser-based application on my home webserver and configure it to consume services from AGOL. Is this something that would work or would I actually need ArcGIS for Server? Are there aspects I possibly don't know about/haven't thought of to make this idea work? Very briefly, you can post feature services and tiled services to ArcGIS Online. IE. serve features or cached tiles. If what you want to serve through a webmap falls into that category, then ArcGIS Online would probably be enough. Besides the data you want to publish to ArcGIS Online, my feeling your biggest hurdle will be your "home web server". Does your current internet provider (IP) allow you to serve HTTP requests, can you open up your router/modem/firewall to serve those requests, does your IP assign you a dynamic or static IP address (or are you purchasing a domain and referencing it to your computer). I believe you can serve web content from a personal computer through most IP's, just note that some are more complicated than others to get setup. The alternative to hosting your own app is to host it in ArcGIS.com: http://doc.arcgis.com/en/arcgis-online/create-maps/create-map-apps.htm (apologies if you're already savvy to the whole hosting at home. I just consider it an area that most people wouldn't be familiar with. However, this point on serving content would be true for webapps, or if you installed ArcGIS Server on your home network.) Also, can you tell me if it's been sorted out yet that when one pays for ArcGIS for Home Use they actually do receive an AGOL account? I remember reading last year there were some issues with that... I'm not an expert, but I'd say "yes" based on this link: http://www.esri.com/software/arcgis/arcgis-for-home: ArcGIS Online Named User account and 100 Service Credits
... View more
05-20-2014
09:42 AM
|
0
|
0
|
1290
|
|
POST
|
If you let Arc install Python for 10.0, then used the uninstaller for Data Interop, then uninstaller for ArcMap - everything should have been left in a good state. Its possible you're still seeing stuff in the Python 2.6 directories because you installed 3rd party modules after the fact (Arc wont clean those up). If you did your own Python install for 10.0, Arc uninstaller wont remove it. Because you dont have the option to uninstall, again it sounds like you let Arc install it and the core pieces of it went away when you removed 10.0 If I were to tell you to go and delete directories without understanding your system completely it would be irresponsible of me. I'd suggest contacting Support and they you can help you "clean up" and most likely do a "re-install". Thinking more about this though - within the Python window, can you do an "import arcpy"? If you can do that, it might not be as bad as it seems. It could be something specifically in your script (like a dependency on a 3rd party module) which you haven't yet installed for your Python 2.7 deployment. The error you posted might be cryptically saying that.
... View more
05-09-2014
07:47 AM
|
0
|
0
|
1341
|
|
POST
|
Based on your screen shot - I see both Python2.6 and Python2.7 paths trying to be called. I'm not certain how this has happened. Did you manually install Python 2.6 (when you were using it with 10.0)? Could you uninstall it to see if that fixes it? If you go here: C:\Python26\ArcGIS10.2\Lib\site-packages // C:\Python27\ArcGIS10.1\Lib\site-packages ....do you see a "desktop10.0.pth" or "destop10.1.pth" in either directory? Since you only have DT 10.1 installed, you should only have desktop10.1.pth in the Python27\ArcGIS10.1\Lib\site-packages folder.
... View more
05-09-2014
05:59 AM
|
0
|
0
|
1341
|
|
POST
|
I'm not a licensing expert, but last I heard, I'm 99% sure that would be a violation of your license. "Web GIS" must be done through ArcGIS for Server, using a Server license. If you want the absolute 100% answer, contact your Account Rep: they're in the know for these questions.
... View more
05-08-2014
01:20 PM
|
0
|
0
|
433
|
|
POST
|
Background processing wouldn't have any impact on the publishing process. Background is a mechanism to run tools. The publishing process doesn't use it. For anyone who crashes while publishing: if it also crashes when the Package Result tool, could you zip up your model/data and send it to me? khibma@esri.com
... View more
04-21-2014
07:06 AM
|
0
|
8
|
1668
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2023 06:37 AM | |
| 1 | 09-18-2025 07:07 AM | |
| 3 | 09-18-2025 06:52 AM | |
| 1 | 03-23-2023 12:07 PM | |
| 1 | 10-21-2024 12:40 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-30-2025
06:25 AM
|