Problems with the OSM Attribute Selector

Dec 2, 2010 at 7:45 PM

Problems with the OSMAttributeSelector of the OSMEditorPlugin for ArcGis10 and comparison of its usage with stored data in the osm xml format and with data downloaded via the tool of this plugin.


Editor Version 1.0

ArcEditor Version 10.0


Task: adding attribute “name” to attribute table of point-, line- and polygonfeature by using the OSM Attribute Selector Tool

bbox=8.37679,50.03455,8.40115,50.04703  (test example)


  1. osm xml data

          downloaded from: via wget, via wget (data not as up to date as api) or export from

          results when adding „name“:

              pt: doesn’t work, Error: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt

              ln: works

              ply: works


  1. data downloaded via downloadtool of OSM Editor Plugin

          results when adding “name”:

              pt: works,

              ln: works,

              ply: “name” is not available as attribute to select. Only very few attributes available, which already are in the Attributtable of the ply feature


for 1 and 2 true:

By testing this matter, I experienced, if any error occurs, further work will unfortunately be followed by a crash of ArcGis10. Using the Selector for a different feature as the previous (eg. adding “name” to the ln and then to the ply afterwards) causes a runtime error (R6025) without a previous error having been shown. The second selection was shown to be successful, but wasn’t. The Attribute “name” was not added to the ply in this case. It only works, if you close and restart ArcGIS after being done with the selections for one feature.


I hope anyone might know how to solves this or might have alternatives. I am thankful for every hint.


Motivation: Diploma-thesis

My first step is to write a python-script, which runs the download of osm-data of a certain large area, converts the data to ArcGIS10, filters certain Attributes out of the raw data and adds those to the attributetables, merges all data

(the most up to date osm data is available at, but the limit for a single download is 50 000 points within the data. The area I need to work with, has more than 2 000 000 points. Therefore I have to split the downloads and merge the data later.)

and symbolizes the data in a desired style. This shall be realized by using ArcGIS10 and various other necessary programs controlled by the python-script.


Thanks in advance


Dec 3, 2010 at 4:23 AM


the tool doesn't know any difference between data downloaded through the channel or through the live API. Both is valid OSM data.

Yes, I am aware that the attribute selector is buggy at 1.0 and it has been fixed in conjuction with other projects. The plan is to release a beta1 version for 1.1 shortly, in the meantime you might want to give this build a try

With respect to your approach I am afraid this won't work. Depending on the geographic area you are working in, the point density of the OSM data might vary greatly and as such the download grids might or might not work. Merging the data is not a trivial exercise either. I think your best bet is to get the data with a wget and xapi (so you have the data for the area that you are interested in) and then use the attribute selector tool with the version listed above.

Until I have the beta1 ready you might want to try either using a layer to extract the attributes with a definition query or use the feature class directly. When using the layer inside of ArcMap (for example test_osm_ln ) set a definition query on the layer such that supportingNode = "no" and only relevant nodes are parsed.

- Thomas


Dec 15, 2010 at 3:16 AM


thanks a lot for your answer and the improved build. I have been trying out the suggested build for some days now and want to give a little feedback. The attribute selector in this build works fine with the point feature now. Even working with large data works fine. Just takes a while as expected.

1. Unfortunately, it still has big problems when it's used to select attributes from another features than the previous whithin one ArcGIS session. Eg: when the work with the point feature is done and you want to continue working with the line or polygon feature, most of the time arcGIS crashes with a   runtime error. When restarted, the work with the second feature works just fine.

2. Also trouble brings trying to select multiple features at once. It sometimes works and sometimes crashes ArcGIS with a runtime error. Sometimes even a proper restart isn't possible without closing ArcMap.exe, ArcSOCP.exe, ArcSOMP.exe over the Task Manager before the restart.

3. Sometimes attributes aren't shown in the attributetable after a successful selection. Then, often a runtime error occurs during further work. After a restart of ArcGIS those attributes are shown in the table.

4. The xml-data of my example contains "fixme" and "FIXME" as tags. I chose fixme first and all (fixme and FIXME) values where taken. Afterwards I chose FIXME and ArcGIS crashed. I could send my example if you want (about 3 MB)?


I think this Editor is allready an impressive Tool. Those are my experiences with the attribute selector of this build and I hope this somehow helps to make newer versions more stable and available for automated procedures.

with best regards, Tilo


PS: When playing with the data I tried to symbolize a little bit by using the attributes osmsupportingnode and power. I was surprised, that some power-towers weren't symbolized as all others (as if they were "no power objects") although the values in the attributetable and in the osm-xml text data looked the same as the ones of the others, which were symbolized as intended. Any idea?



Dec 15, 2010 at 6:00 AM


yes, if possible I would like to get the example data. Please compress it as much as possible before posting the data.

The current plan is to have beta2 of the 1.1 release done by the end of this week (December 17th) and if there are any issues remaining I would definitely like to put the fix into the beta2 version. I have just tried the attribute selector tool with the current version on my development machine (current in a state between beta1 and beta2) and I was able to run the tool multiple times in the same ArcMap session with different types of layers and feature classes.

With respect to the symbology I am not sure. It kind of sounds like a bug to me - if you could tell me the osm id number of the feature in question I'll take a closer look at it when I receive the sample data.


Dec 15, 2010 at 5:25 PM


I'm looking forward to the release at the end of the week :). I listed my problems in the previous post, but I'll keep testing and will post, if I discover further problems.

I created a new account on to provide my raw testdata, the filegeodatabase and mxd which shows the power problem. you just have to change the data source. Visit and enter username and password (I sent you).

here examplenodes for the power problem:

false sym: id 268342111

correct sym: id 265602705



Dec 15, 2010 at 6:04 PM


I had a quick look at the data and there doesn't seem to by anything wrong with it. I changed the power pole point layer from a unique value renderer using osmSupportingNode and highway as the unique fields to a simple renderer and having a definition query on the layer for "power" = 'tower' AND "osmSupportingNode" = 'no'. After the change the symbols did show up as expected. There seems to be a rendering issue with the core software.

I'll submit a bug on our support site and let you know.

- thomas

Dec 18, 2010 at 3:27 PM


I'd really appreciate it. thanks!

enjoy the holidays



Dec 21, 2010 at 9:29 PM


I just got off the phone with one of our support analysts and we have determined that the core software works as expected. The situation with your dataset is that you have 2 attribute fields with a field alias called "power". The first field attribute is generated by default as one of the default OSM mapping themes and the second one derives its existence from running the attribute selector which creates an additional field with a different name but unfortunately the same alias.

In your dataset the content values for the original OSM field and the generated field are not identical. I am assuming that you did some computation on the data.

So for the rendering using the unique value renderer you have picked the second (user generated) field but compared it to the content of the first field in the identify dialog. In order to avoid this confusion in the future I'll add a little additional text to the field aliases generated by the "OSM attribute selector" tool in beta2.

Hope that resolves the issue,




Jan 25, 2011 at 7:28 AM

Hi Thomas,

the additional text (tag value) to the added Attributes is very convenient. I compared the power, power (tag value) and osmSupportingElement and found out, that the tag value field power has lots of towers, which are supportingElements (rather small towers within living areas, i guess). None of the original power values are supporting elements. Thats the whole difference. Thanks for your help.


Now testing beta2, I have a new problem and unfortunately still an old one which was considered solved. I am writing a python-script, which should combine download (works fine with wget/xapi), loading into a fileGDB, selecting attributes, symolizing. 

At the moment, the download-script (userInputs, foldermanagement, download, fileGDBcreation) is seperate and stands alone and works fine (no open ArcGIS needed and executable via PythonWin, IDLE or just doubleclicking, which is desired for the whole script). This is the part of the script, which is only partially working in the python window of ArcGis:


import arcpy

out_folder_path = "C:/testfolder/output"
out_name = "py_testbeta2.gdb"
arcpy.CreateFileGDB_management(out_folder_path, out_name)

arcpy.ImportToolbox("C:/Users/t/AppData/Roaming/ESRI/Desktop10.0/ArcToolbox/My Toolboxes/OpenStreetMap Toolbox.tbx")      

OSM_data_in = "C:/testfolder/download/test.osm"
OSM_dataset_out = out_folder_path + "/" + out_name + "/t1"

arcpy.OSMGPFileLoader(OSM_data_in, OSM_dataset_out, OSM_dataset_out +"/t1_osm_pt", OSM_dataset_out + "/t1_osm_ln",OSM_dataset_out + "/t1_osm_ply")

arcpy.OSMGPAttributeSelector(OSM_dataset_out + "/t1_osm_pt","name")

          until here it works fine (from the python window within ArcGis. The second time OSMGPAttributeSelector is called, ArcGis crashes with a runtime error.

arcpy.OSMGPAttributeSelector(OSM_dataset_out + "/t1_osm_ln","name")               
arcpy.OSMGPAttributeSelector(OSM_dataset_out + "/t1_osm_ply","name")


Even when I tried to use the attribute selector tool (over the toolwindow) multiple times in a row on different layers (pt, ln and ply) for different attributes it still crashed ArcGis most of the time. I am surprised, that it didn't crash on your development machine.

1. Do I have to close a process after OSMGPAttributeSelector was executed to be able call it again, or is this a bug? and if, will there be a fix in near future?

2. Is it possible to make this script work as a stand alone script out of arcgis? In PythonWin creating GBDs with the code above works fine and Importing the OSMToolbox results in: module built in. But trying to use the OSM functions, which work whithin arcgis, result in the error:

File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework\", line 312, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\testfolder\", line 22, in <module>
    arcpy.OSMGPFileLoader(OSM_data_in, OSM_dataset_out, OSM_dataset_out +"/t1_osm_pt", OSM_dataset_out + "/t1_osm_ln",OSM_dataset_out + "/t1_osm_ply")
  File "C:\Users\t\AppData\Roaming\ESRI\Desktop10.0\ArcToolbox\My Toolboxes\OpenStreetMap Toolbox.tbx", line 210, in OSMGPFileLoader
    ExecuteError: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei ESRI.ArcGIS.OSM.GeoProcessing.OSMGPFileLoader.Execute(IArray paramvalues, ITrackCancel TrackCancel, IGPEnvironmentManager envMgr, IGPMessages message)
Failed to execute (OSMGPFileLoader).

3. Those Warnings always occur when executing the FileLoader:

WARNING 000461: Repaired feature 800 because of short segments

WARNING 000461: Repaired feature 64 because of incorrect ring ordering

I hope thats unsual.

I would be glad about an answer.

with best regards,


ps. for using the OSMToolbox functions in python it would be very helpful to have an example for each parameter in addition to the description on the right side of the python window

Jan 26, 2011 at 8:03 AM


yes, there are sometimes crashes but I haven't completely tracked down the issue. Here is what I found so far:

-  there are "more" crashes on XP based systems

- there are more consistent crashes when the tool is run as a background geoprocessing process, no crashes when run as a foreground process

- after compacting the file geodatabase there were no more reproducible crashes

Hopefully by the end of the week I can tell you more about what's causing the issues.


With respect to 2. Do you have ArcGIS 10 SP1 installed? The message looks similar to an issue that was addressed in SP1. Also if you run the run outside the ArcGIS process you'll need to use the full qualifier. Here is a python segment I used on my machine:

    # load osm editor specific toolbox
    arcpy.ImportToolbox(r'D:\arcgisserver\documents\OSMEditor\OpenStreetMap Toolbox.tbx')

    arcpy.env.workspace = r'D:\arcgisserver\documents\OSMEditor\Connection to thalweg.sde'
    arcpy.env.outputCoordinateSystem = desc_downloadFS.spatialReference

    validatedTableName = arcpy.ValidateTableName(inputName, arcpy.env.workspace)
    nameOfTargetDataset = arcpy.os.path.join(arcpy.env.workspace, validatedTableName)

    nameOfPointFeatureClass = arcpy.os.path.join(arcpy.env.workspace, validatedTableName, validatedTableName + r'_osm_pt')
    nameOfLineFeatureClass = arcpy.os.path.join(arcpy.env.workspace, validatedTableName, validatedTableName + r'_osm_ln')
    nameOfPolygonFeatureClass = arcpy.os.path.join(arcpy.env.workspace, validatedTableName, validatedTableName + r'_osm_ply')

    # download data from the OSM server and store it in a geodatabase
    results = arcpy.OSMGPDownload_osmtools(r'', desc_downloadFS.extent, r'DO_NOT_INCLUDE_REFERENCES', nameOfTargetDataset, nameOfPointFeatureClass, nameOfLineFeatureClass, nameOfPolygonFeatureClass)

    filteredPointLayer = "Only attributed nodes"
    arcpy.MakeFeatureLayer_management(nameOfPointFeatureClass, filteredPointLayer, "osmSupportingNode = 'no'")

    # extract osm tags as attributes from the point feature class
    arcpy.OSMGPAttributeSelector_osmtools(filteredPointLayer, 'name')

    # extract osm tags as attributes from the line feature class
    arcpy.OSMGPAttributeSelector_osmtools(nameOfLineFeatureClass, 'name')


With respect to 3., those warnings are expected and maintain the integrity of data inside the geodatabase (cleaning lines with only one vertex, re-arranging ring orders to distinguish between inner and outer rings, etc.)

Jan 28, 2011 at 4:43 PM


thanks for the quick reply!

I didn't install SP1 manually. I use ArcGIS10, LicenseType: ArcInfo, Built 2414, one year with all extensions (absolventenprogamm to write my diploma thesis). I installed it in Oct 2010.

What do you mean with full qualifier in this case? I'm rather a Python and ArcGIS scripting beginner. (learned Python within a 5 week internship on my own and arcgis scripting from the free course on the ESRI site and reading the documentation)

1. I tried it with adding  ..._osmtools to the function. eg. arcpy.OSMGPFileLoader_osmtools(...). Then I get this error: Traceback (most recent call last):
  File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework\", line 312, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\testfolder\", line 28, in <module>
    arcpy.OSMGPFileLoader_osmtools(OSMDataInput, nameOfDataset, nameOfPointFeatureClass, nameOfLineFeatureClass, nameOfPolygonFeatureClass)
AttributeError: 'module' object has no attribute 'OSMGPFileLoader_osmtools'

2. Trying to use this Function: arcpy.OSMGPFileLoader(...) results in this error:  Traceback (most recent call last):
  File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework\", line 312, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\testfolder\", line 28, in <module>
    arcpy.OSMGPFileLoader(OSMDataInput, nameOfDataset, nameOfPointFeatureClass, nameOfLineFeatureClass, nameOfPolygonFeatureClass)
  File "C:\Users\t\AppData\Roaming\ESRI\Desktop10.0\ArcToolbox\My Toolboxes\OpenStreetMap Toolbox.tbx", line 210, in OSMGPFileLoader
    AttributeError: 'NoneType' object has no attribute 'OSMGPFileLoader'

..._osmtools cant be found and the osmtoolbox isnt involved. without _osmtools it looks like the function is looked for in the toolbox but I don't understand the 'NoneType' part. why isnt it callable like other arcpy.functions when it shows whithin the arcpy module?

In advance I imported the OSMtoolbox and checked the built in functions. All OSM functions were listed within the arcpy module (dir(arcpy))

I also defined an environmentfolder but this didn't change anything.


3. Is there a function whithin the AttributeSelector I can use to write all available Attributes of a featureclass to a file?





Feb 1, 2011 at 7:33 AM


there is indeed a bug in the tools that causes your errors to be thrown. I am not quite sure why the error wasn't triggered before. I have fixed the issue and I'll make beta3 available for download in the next couple of days.

Thanks for the feedback,

- Thomas


Feb 2, 2011 at 3:46 AM


that sounds great. I'm looking foward to it. Thanks a lot!

You're welcome. I'll keep testing.


Question 3 of my last post still remains. I need to get the whole list of available attributes (OSM tag values) of a certain feature class, like it is shown by manually executing the Attribute selector tool after choosing the the feature class or over the python window when the auto completion shows a list of all attributes of the chosen feature class. I intend to write this list into a text or table file.

First I will use this to get a better overview over a huge number of attributes and to do some sorting. Later this might be an essential part of the stand alone script to let the user choose the attributes over a little gui.

I don't know which arcpy and/or osm functions I have to use to grab this list and would be glad about any information.



Feb 5, 2011 at 1:13 AM


with respect to getting a list of all tags using Python that is currently not supported. Due to the fact that we are storing the tags inside a blob field (to keep the size of the database and the number of fields down) there is currently no way to access the content of that field. For ArcGIS 10.1 new database access functionality will be included in the python environment to support your usage scenario.


Feb 9, 2011 at 2:03 PM


thanks for the answer. I think I have to be patient on this matter.


After some testing the beta3, I'm happy that my standalone script works now. Thanks for fixing the bug. However, unfortunately, I might have found another one in the Attribute Selector Tool:

When working with very small data it works fine. If the data is a little bigger but still small (eg about 11000 nodes in the pt layer or 15000 objekts in the ln layer) Python starts working with the certain layer and crashes after a while. This happens in the same way when executing  via doubleklick, PythonWin or IDLE. No Errormessage, just crashing. When executing this in the Pythonwindow or manually with the Tool within ArcMap it sometimes succeeds and sometimes seems to succeed but causes a runtime error. Do have an idea how to fix this?

Another or maybe related Problem might be if you run the Fileloader or the AttributeSelector (each time for all three layers) again in the same session the result is a crash (Skripts in all development environments and in the python console as well as in Arcmap) If you close and reopen the Main program it works fine again, but only once. This problem is way not as urgent as the one above, but I thought it might help.



Feb 9, 2011 at 7:46 PM

Hi guys,

Pretty interesting tool. I am new working with this tool but it has a lot of potential. I am trying to use the "Download OSM data process" script from the OSM tool calling it from python to automatize the download process, however when running it from Python it failed to execute it. Could you please shed some ideas in how to solve this issue, thanks.

Script used:

# Import arcpy module
import arcpy

# Load required toolboxes
arcpy.ImportToolbox("C:/Program Files (x86)/ESRI/OSMEditor/data/OpenStreetMap Toolbox.tbx")

# Local variables:
download = "F:\\WorldData\OSM.gdb\\test"
OSM_Group_Layer = "OSM Group Layer"

# Process: Download and Symbolize OSM Data
arcpy.Model_osmtools("-9 5 -8.5 5.5", download, OSM_Group_Layer)



Traceback (most recent call last):
  File "F:\MENA\", line 20, in <module>
    arcpy.Model_osmtools("-9 5 -8.5 5.5", download, OSM_Group_Layer)
  File "C:\Program Files (x86)\ESRI\OSMEditor\data\OpenStreetMap Toolbox.tbx", line 83, in Model

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000725: Target Feature Dataset: Dataset F:\WorldData\OSM.gdb\test already exists.
WARNING 000725: Target feature dataset: Dataset F:\WorldData\OSM.gdb\test already exists.
WARNING 000725: OpenStreetMap point features: Dataset F:\WorldData\OSM.gdb\test\test_osm_pt already exists.
WARNING 000725: OpenStreetMap line features: Dataset F:\WorldData\OSM.gdb\test\test_osm_ln already exists.
WARNING 000725: OpenStreetMap polygon features: Dataset F:\WorldData\OSM.gdb\test\test_osm_ply already exists.
Failed to execute (Model).







Feb 10, 2011 at 5:28 AM


it looks like you are running the tools a second time and you are now attempting to overwrite the results from a previous run. By default that behavior is blocked. If you do want to that you need to adjust the geoprocessor environment settings by:

arcpy.env.overwriteOutput = True

For more information about environment settings, please take a look at


- Thomas


Feb 10, 2011 at 6:18 AM


the Attribute Selector always crashes python when I work (standalone script) with data bigger than a couple of MB (see my last post) and I don't know what to do. I'd really appreciate an answer.

here the part of the easy script I use, which works fine with small data:


arcpy.ImportToolbox(r"C:\Users\t\AppData\Roaming\ESRI\Desktop10.0\ArcToolbox\My Toolboxes\OpenStreetMap Toolbox.tbx")

OSMDataInput = r"C:\testfolder\download\\" + nameOSMdata + ".osm"
nameOfDataset = folderOutput + "\\" + nameOfGDB + r"\t1"   

nameOfPointFeatureClass = nameOfDataset + "_osm_pt"
nameOfLineFeatureClass = nameOfDataset + "_osm_ln"
nameOfPolygonFeatureClass = nameOfDataset + "_osm_ply"

arcpy.OSMGPFileLoader(OSMDataInput, nameOfDataset, nameOfPointFeatureClass, nameOfLineFeatureClass, nameOfPolygonFeatureClass)
ptAttributes = "name"
lnAttributes = "name"
plyAttributes = "name"






Feb 10, 2011 at 3:10 PM


I grabbed a planet extract for Brazil from GeoFabrik and loaded it with the script below. I didn't run into any error or crashes. The other issue you were running into is NIM056823 and it is resolved as part of ArcGIS 10 SP1 ( I do highly recommend you load SP1.


import arcpy
from arcpy import env

arcpy.ImportToolbox(r'C:\Projects\OSM\OpenStreetMap Toolbox.tbx')

arcpy.env.workspace = r'c:\Projects\OSM\storage.gdb'

# define a base name for the download
inputName = 'brazil'

# define the names for the feature dataset and the feature classes
validatedTableName =, env.workspace)
nameOfTargetDataset = arcpy.os.path.join(arcpy.env.workspace, validatedTableName)

nameOfPointFeatureClass = arcpy.os.path.join(env.workspace, validatedTableName, validatedTableName + r'_osm_pt')
nameOfLineFeatureClass = arcpy.os.path.join(env.workspace, validatedTableName, validatedTableName + r'_osm_ln')
nameOfPolygonFeatureClass = arcpy.os.path.join(env.workspace, validatedTableName, validatedTableName + r'_osm_ply')

# load the stand-alone OSM file and store it in the target feature dataset
arcpy.OSMGPFileLoader_osmtools(r'c:\data\brazil.osm', nameOfTargetDataset, nameOfPointFeatureClass, nameOfLineFeatureClass, nameOfPolygonFeatureClass)

# filter the points to only process the attribute carrying nodes
filteredPointLayer = 'Only attributed nodes'
arcpy.MakeFeatureLayer_management(nameOfPointFeatureClass, filteredPointLayer, "osmSupportingElement = 'no'")

# extract the name tag for the filtered point features
# unfiltered the point feature class contains 5013291 points
# filtered the point feature class contains 60140 points
arcpy.OSMGPAttributeSelector_osmtools(filteredPointLayer, 'name')

# the line feature class contains 332904 lines
# the polygon feature class contains 118989 polygons

Feb 21, 2011 at 1:13 PM


installing SP1 solved the issues. Thanks a lot!