##incident-import-tools
Toolbox and scripts for importing spreadsheets to a gdb and optionally publishing out to ArcGIS Online (feature service) or ArcGIS for Server (dynamic map service).
Geometry can be assigned to features using provided coordinate values in a known spatial reference system, or by geocoding an address associated with each incident.
These scripts can be scheduled using Windows Task Scheduler to automatically update the feature class and service.
- Publish features from a spreadsheet to an existing service using ArcGIS Online or ArcGIS for Server
- Features can be located using addresses or coordinate pairs
- Optionally, avoid creating duplicate records by update existing records and only adding new features to the service
- Run the tools manually through ArcMap or ArcCatalog, or schedule them to run regularly using Windows Task Sceduler
- Download and unzip these tools.
- Download and unzip requests-master.zip.
- Open requests-master and copy the requests folder into the scripts folder of the incident import tools.
- In ArcMap or ArcCatalog, open the Configure Incident Imports tool. Complete the parameters and click OK to create a configuration file storing these parameter values.
- Run the Import Incidents tool, using the previously created configuration file as input. Be default this configuration file is saved to the scripts folder, but it may be moved to another location if necessary.
- Examine the output messaging and reports for comments on failures and data errors.
- Optionally, set up Windows Task Scheduler to run import_publish_incidents.py automatically on a schedule with the configuration file as input.
-
ArcGIS for Desktop
-
Requests module v2.2.1 for Python
-
ArcGIS Online organizational account or ArcGIS for Server if data is to be published (optional)
-
Tool imports spreadsheet data to a point feature class in a file, enterprise, or workgroup geodatabase with a similar schema. Only values in fields that exist in both the spreadsheet and feature class will be copied. Field names are case-sensitive.
-
Spreadsheet and feature class must have fields with a unique identifier for each record. These fields must have the same field name.
-
To filter for duplicates, both the spreadsheet and the feature class must have fields with the date, and optionally time, of the incident or incident report. These fields must have the same field name and dates must be in a the format mm/dd/yyyy hh:mm. This format can be modified by changing the value of the timestamp variable at the top of the import_publish_incidents.py script.
-
All date, time, and timestamp fields must be formatted in the spreadsheet to display, in order of requirement:
- year
- month
- day
- hour
- minute
For example, a field containing only the time 16:45 will cause the tool to fail because it is missing the year, month and day information associated with that time.
-
These tools are set up to use the World Geocode service, which requires, and consumes credits from, an ArcGIS Online organizational account.
Learn more about setting up a connection to the World Geocode Service
Optionally, use your own locator or geocode service. This requires some additional configuration of the scripts. Open import_publish_incidents.py in IDLE or a text editor and modify the values of the following parameters located near the top of the script:
- all_locator_fields: in order, all the input address fields accepted by your locator
- loc_address_field: Your locator's input address field that looks for the house number and street name information
- loc_city_field: Your locator's input address field that looks for the city information
- loc_state_field: Your locator's input address field that looks for the state or province information
- loc_zip_field: Your locator's input address field that looks for the ZIP or postal code information
Find a bug or want to request a new feature? Please let us know by submitting an issue.
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
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.