The task of making a model, publishing it as a geoprocessing service, and building a web application can be straightforward. Designing a service that is easy to understand and use can be more complicated. Many of us resort to the … Continue reading
Many organizations share public maps on ArcGIS online and have defined a process to update and synchronize the feature layers from their local data. One method is well defined using ArcMap; you select the option to overwrite the hosted feature layers when publishing your updates back to ArcGIS online. In 2013 and 2014 we explained how you could update your hosted feature services automatically, at a prescribed time, using Python. In the spirit of this incredibly popular workflow to schedule updates, this blog will provide simpler Python code to update services using ArcGIS Pro 1.4 and the new ArcGIS API for Python.
We all know the power of using feature services with ArcGIS.com to share our data and maps. These maps become even more powerful when the content automatically updates. GeoRSS feeds allow you to quickly pull content into your map. Well, … Continue reading
In April 2013, we explained how you could use a Python script to automate the publishing and overwriting of your feature service on ArcGIS.com. This post explains how to perform that same workflow using ArcGIS 10.2 or 10.2.1. The following instructions will get you started, or, scroll to the bottom of this post for extra information on what’s changed at 10.2. Continue reading
Do you work with Feature Services? Do you want to use geoprocessing tools or Python to perform analysis with ArcGIS for Desktop? Here’s a few quick tips for using a hosted feature service from arcgis.com or your own ArcGIS for Server … Continue reading
Note: A this workflow has been updated for ArcGIS 10.2/10.2.1. Please read that post depending on your version. [January 24, 2014]
More organizations are moving towards using ArcGIS.com hosted feature services to serve data. One common task that has become a popular question of late is, “How do I automatically update the data within this hosted service?” For example, your organization may want to push nightly updates to keep synchronized with the daily changes made by your Desktop users. One of the easiest ways this can be done as this blog describes, is by overwriting the feature service completely with an updated one.
The following Python script demonstrates how to:
- Turn a map document into a sddraft.
- Modify the XML inside with the appropriate settings.
- Analyze the draft for errors.
- Stage the sddraft into a .sd (service definition) file.
- Upload the service to ArcGIS.com. Note that this code shares the feature service with everyone on ArcGIS.com.
Last week 64-bit Background Geoprocessing was made available for download. We’ve had a few questions from keen Python scripters who want to “get out of the application” and use their big data crunching scripts in 64-bit. If you’re one of those keen scripters, all you need to do is make sure you’re executing against 64-bit Python; no other special commands or tricks needed. Continue reading
At the Esri 2012 User Conference, 64-bit Background Geoprocessing was announced and scheduled to be released with 10.1 service pack 1. Now, with the release of 10.1 service pack 1 the 64-bit Background Geoprocessing installation is available for download from … Continue reading
One of the enhancements to the 10.1 release was the addition of two new environment variables (scratchFolder and scratchGDB) as mentioned in the What’s New for Geoprocessing in 10.1. (If you haven’t read it, check out all enhancements!). While new … Continue reading
The Python language offers a variety of ways to handle and parse XML. Lots of GIS data can be stored in an XML schema. For example, KML is made up of a well known XML structure. Another well known structure includes GPX, the native format that GPS devices typically save too. By using Python and ArcPy, you can create features from XML.
One of my teammates on the Geoprocessing team recently invested in a GPS sports watch. In addition to telling time, his watch could track movement and monitor heart rate. Since we love geography, programming, geoprocessing and fitness so much, another teammate, Ghislain, took to writing a tool to turn the GPX (XML) into feature classes for display on a map. A closer inspection of the GPS output and a look into the schema provided by topographix (http://www.topografix.com/gpx/1/1/) shows that the XML follows a standard format on how latitude, longitude, elevation and time are saved. This particular schema is enhanced to save the heart rate information. Since the information is saved in an expected way, one Python script could be written to handle many different GPS outputs.
Ghislain looked into the Python class ElementTree. ElementTree has many easy to use functions to parse through XML. Python also has other objects like Minidom or XPath which can be used to read XML; however, for this script ElementTree was used. The script looks for the values mentioned previously and hands this information over to an ArcPy cursor which writes the information into a point feature class.
The complete script is available in the Model and Script Gallery: GPS to Layer. Feel free to take it and use it simply to convert your GPX points into a feature class, or break it open and look at how Python can be used in your ArcGIS workflows. Use the comments section here or on the page itself to leave any feedback on this tool.
Well, what good would this GPS to Points tool be if we didn’t use it to evaluate the fitness level of our co-worker? Based on the map show below there is a lot of orange and red, and I’m concerned with a heart rate of 200 beats per minute on the uphill, but according to Wikipedia, he just must be giving his “maximum effort”. At least his maximum effort is an honest effort!
• An excellent blog post by Doug Hellmann http://blog.doughellmann.com/2010/03/pymotw-parsing-xml-documents-with.html explains different ways to walk through XML.
• Python 2.6.x XML ElementTree documentation, http://docs.python.org/library/xml.etree.elementtree.html
• Element Tree Overview from effbot.org, http://effbot.org/zone/element-index.htm