SymbolizePoints Python

Mar 1, 2011 at 6:26 PM

Hi,

I'm trying to use the "arcpy.PointSymbolizer_osmtools" function in Python. Using the Tool in the OpenStreetMap-Editor-App within ArcGIS works fine with the same input. What do I have to change to make it work?

Here the script:

import arcpy
from arcpy import env

env.workspace = r"C:\testfolder\Root\test\OSM_Downloader_und_Konverter\Environment\workspace.gdb"

arcpy.ImportToolbox(r"C:\Program Files (x86)\ESRI\OSMEditor\data\OpenStreetMap Toolbox.tbx")

nameOfPointFeatureClass = r"C:\testfolder\Root\test\OSM_Downloader_und_Konverter\GDBs\Hochheim_01_03_2011.gdb\Hochheim_01_03_2011_osm_pt_cut_Hochheim_am_Main"
pointLyrVorlage = r"C:\Program Files (x86)\ESRI\OSMEditor\data\Points.lyr"
nameOfStyledPointsLayer = r"C:\testfolder\Root\test\OSM_Downloader_und_Konverter\StyledMaps\test1.lyr"
  
arcpy.PointSymbolizer_osmtools(pointLyrVorlage, nameOfPointFeatureClass, nameOfStyledPointsLayer)

 

And the Traceback:

Traceback (most recent call last):
  File "C:\testfolder\Root\test\OSM_Downloader_und_Konverter\test.py", line 12, in <module>
    arcpy.PointSymbolizer_osmtools(pointLyrVorlage, nameOfPointFeatureClass, nameOfStyledPointsLayer)
  File "C:\Program Files (x86)\ESRI\OSMEditor\data\OpenStreetMap Toolbox.tbx", line 329, in PointSymbolizer

        s  h  o  p

 ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
ERROR 000735: Symbology Layer: Value is required
Failed to execute (PointSymbolizer).

The "s  h  o  p" in the middle part of the traceback wasn't copyable from IDLE so I wrote it myself here. I have no Idea what it means.

 

This script doesn't work in the pythonwindow within ArcGIS either.

 

I would be glad about an answer.

Thanks,

Tilo

 

 

Mar 2, 2011 at 3:18 AM

I just tried the arcpy.OSMSymbolizer_osmtools function. It works fine in a standalone python script.

Developer
Mar 2, 2011 at 3:26 AM

Does that mean everything is working as expected?

Mar 2, 2011 at 4:32 AM

OSMSymbolizer_osmtools is working as expected, yes.

PointSymbolizer_osmtools doesn't work in a standalone python script (see script and traceback above). I didn't try LineSymbolizer_osmtools and PolygonSymbolizer_osmtools.

For my purpose OSMSymbolizer_osmtools works quite well.

Is it possible to give this this call "OSMSymbolizer_osmtools(Input_Point_Features, Input_Line_Features, Input_Polygon_Features, OSM_Group_Layer)" additional values to replace "OSM Downloaded Points" ... which are created within the Layer File or do I have to access the Layer File afterwards?

thanks

Tilo

Developer
Mar 2, 2011 at 5:41 AM

Absolutely,

open the model itself and take a look at how the name of the group layer is exposed as a parameter. You can use a similar approach for the other layer names. Please take a look at the following help topic for a more detailed discussion.

Thomas