GithubHelp home page GithubHelp logo

bthaman / update-hosted-feature-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arcpy/update-hosted-feature-service

0.0 1.0 0.0 165 KB

Update and overwrite a hosted feature service on ArcGIS.com

License: Apache License 2.0

Python 100.00%

update-hosted-feature-service's Introduction

update-hosted-feature-service

This Python script turns an MXD into a service definition (SD) file. Your ArcGIS.com account is searched for a matching service. The SD file is uploaded to your ArcGIS.com account, the existing service is overwritten with new content.

Note! Update as of August, 2015 - A major overhaul to the entire workflow, but it'll continue updating your hosted feature service just the same as it did previously! The script no longer requires Requests, it uses built-in Python libraries. It will now push your SD file to arcgis.com using a multipart upload (10mb chunks). This means it should support really big uploads without running out of memory!

(old)Note! This script was updated August 29, 2014 - The script no longer deletes and re-creates the feature service. It now will overwrite it in place. This means the original itemID of the feature service is maintained and any webmaps that referenced the feature service will continue to work.

See more information on the associated ArcGIS Blog post. The original blog post for ArcGIS 10.1 can be found here.

Instructions

  1. Download the update.py and settings.ini files. (Hint: Click the Download ZIP button on the right)
  2. Save these files to your local working directory
  3. Note! You no longer need to download requests. The script will run using built-in Python modules now!
  4. Update the settings.ini file to values for your service. App
  5. Run the python script
c:\>c:\Python27\ArcGIS10.2\python.exe c:\myLocalDirectory\update.py
...
Starting Feature Service publish process
found Feature Service : 7ac9e68e9cd341e0a0a217590e4f6265
found Service Definition : bb2261fe2d684e7cb950c6d29372642e
Created D:\myLocalFolder\MyMaps\tempDir\MyMapService.sd
updated SD:   bb2261fe24684e7cb950c6d29372642e
successfully deleted...7ac9e68e9cd34fe0a0f217590e4f6265...
successfully updated...[{u'encodedServiceURL': u'http://services1.arcgis.com/hLJbHVsas2rDIzK0I/arcgis/rest/services/MyMapService/FeatureServer', u'jobId': u'c886b86c-46d4-4be2-95ab-32b284b72dfb', u'serviceurl': u'http://services1.arcgis.com/hLJbHVsas2rDIzK0I/arcgis/rest/services/MyMapService/FeatureServer', u'type': u'Feature Service', u'serviceItemId': u'7df087dfea1b4c7bad2ba372faeefc1c', u'size': 75344}]...
successfully shared...7df087dfea1b4c7bad2ba372faeefc1c...
finished.

Requirements

  • ArcGIS 10.2, 10.2.1, 10.3, 10.3.1, 10.4
  • Python 2.7 (not currently configured to work with Python 3+)

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

Copyright 2013 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.

[](Esri Tags: ArcGIS.com Online Update Hosted Feature Services Automate Python Publish) [](Esri Language: Python)โ€‹

update-hosted-feature-service's People

Contributors

khibma avatar arcpy avatar bandit253 avatar amarinelli avatar

Watchers

Bill Thaman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.