POST
|
I wrote a testcase which demonstrates a problem where the arcpy.geocoding.GeocodeAddresses function is not mapping fields correctly. This function only appears to work when the field names are mapped with exactly the same names. I created this python script which reads in 2 CSV files which are exactly the same except one of the CSV files named the address column as ADDRESSX which causes the mapping to fail. If you run this script (after entering your ArcGIS Online userId and Password) you will notice that you will have 2 Resulting feature classes with different results. This is because the ADDRESSX column was skipped by GeocodeAddresses because it was mapped incorrectly. I believe this is a bug. I am using ArcGIS v10.2.2.3552. Attached is my python script and the 2 CSV files. # Note: This Geocoding Testcase will consume credits on ArcGIS Online. import arcpy import sys import os cwd = sys.path[0] # Read CVS files # These files are the same except the customersx.csv ADDRESS column is named ADDRESSX input_table = os.path.join(cwd, "customers.csv") input_tablex = os.path.join(cwd, "customersx.csv") # Create a file geodatabase to store the output feature class output_gdb_name = "Outputs.gdb" output_gdb = os.path.join(cwd, output_gdb_name) if not os.path.exists(output_gdb): arcpy.management.CreateFileGDB(cwd, output_gdb_name) # Store results in 2 separate Feature Classes output_feature_class = os.path.join(output_gdb,"CustomerLocations") output_feature_classx = os.path.join(output_gdb,"CustomerLocationsx") # Create the ArcGIS Server connection file server_url = "https://geocode.arcgis.com/arcgis/services" conn_file_name = "arcgis_online_batch_geocoding.ags" conn_file = os.path.join(cwd, conn_file_name) username = "[My Enterprise ArcGIS Online ID]" password = "[My Password]" arcpy.mapping.CreateGISServerConnectionFile("USE_GIS_SERVICES", cwd, conn_file_name, server_url, "ARCGIS_SERVER", username=username, password=password) address_locator = os.path.join(conn_file, "World.GeocodeServer") # Geocode both CSV files arcpy.geocoding.GeocodeAddresses(input_table, address_locator, "Address Address;City City;Region State;Postal Zip", output_feature_class) arcpy.geocoding.GeocodeAddresses(input_tablex, address_locator, "Address Addressx;City City;Region State;Postal Zip", output_feature_classx) print arcpy.GetMessages()
... View more
04-22-2015
09:59 AM
|
0
|
0
|
2666
|
POST
|
I discovered the answer on github. Hopefully this will help someone else with the same question. https://github.com/deelesh/batch-geocoding-python http://proceedings.esri.com/library/userconf/devsummit13/papers/devsummit-183.pdf
... View more
04-21-2015
02:47 PM
|
1
|
0
|
1055
|
POST
|
I am trying to figure out how to batch geocode a table of addresses using the ArcGIS Online World Geocoder using Python. I have an enterprise account. I don't get any errors when I run my script. The result is a point FeatureClass with all the input records but they all have a null shape so nothing displays on a map. Here is my python code: import arcpy
from arcpy import env
env.workspace = "C:/TestData/Geocode.gdb"
try:
arcpy.SignInToPortal_server("<my arcgis online enterprise userid>", "<my password>", "http://www.arcgis.com/")
in_table = r"MYTABLE"
# ArcGIS Online Locator found in ArcCatalog
locator = r"Ready-To-Use Services/Geocoding/World.GeocodeServer"
out_table = r"GEOCODE_RESULTS"
fields = r"Address Address;City City;Region State;Postal Zip"
arcpy.GeocodeAddresses_geocoding(in_table, locator, fields, out_table, "STATIC")
except Exception as e:
print e.message
arcpy.AddError(e.message)
... View more
04-21-2015
02:27 PM
|
0
|
4
|
4674
|
POST
|
I have "shared" the ESRI basemaps with a private group which contains other basemaps from my organization, yet I can only see my basemaps when I query the group from javascript. If I click on the group in ArcGIS Online then I see the ESRI basemaps and my private basemaps. However, if I perform a javascript query against my private group using the group ID then I only get our basemaps and not the ESRI basemaps. As a test, I want to see if I could return only esri basemaps with this query: q: "title: \"ArcGIS Online Basemaps\" AND owner:esri" but no results are returned. How can I return the results of our non-public basemaps and esri basemaps together in one query?
... View more
10-01-2014
02:42 PM
|
0
|
0
|
574
|
POST
|
My map is going to contain sensitive information which is non-public and only for my organization (using an organzational account). Does this mean I cannot create a gallery? If I host the gallery myself internally on my network I should be able to pull in the private maps. Am I correct?
... View more
09-23-2014
02:22 PM
|
0
|
1
|
658
|
POST
|
Is it possible to create a Gallery on ArcGIS Online which contains Private maps for an Organization? We have several maps which we would like to display in the "Carousel Gallery" and/or the "Public Gallery". I get the impression that our maps must be public? Is it possible to have a gallery for our Organization which contains non-public maps?
... View more
09-18-2014
03:25 PM
|
0
|
6
|
4057
|
Title | Kudos | Posted |
---|---|---|
1 | 04-21-2015 02:47 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|