Select to view content in your preferred language

How add drop down list to spatial reference parameters of "Make XY Event Layer" tool?

3149
6
12-03-2013 06:37 AM
anjelinaponker
Emerging Contributor
Hi
I,m using "Make XY Event Layer", I need to add a drop down list to spatial reference parameter. for example if xy file of a user is in UTM, the user select UTM, if it's xy file is in Lambert, he select lambert from drop down list.
There is not any solution for solving this problem. In model builder we can just select 1 coordinate system and when a client use this tool he enconter with 1 option like this:

PROJCS['WGS_1984_UTM_Zone_38N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',45.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision

What should I do?
Regards
A.ponker
0 Kudos
6 Replies
DaleHoneycutt
Deactivated User
I'm confused.  The Make XY Event Layer tool has a spatial reference parameter that does exactly what you want -- allows the user of the tool to specify the spatial reference of the XY points in their input table. 

Reading "between the lines" it sounds as if you're in ModelBuilder.  Perhaps you need to expose the spatial reference as a model parameter.  See the help topics  Exposing tool parameters as variables and Creating model parameters
0 Kudos
anjelinaponker
Emerging Contributor
I'm confused.  The Make XY Event Layer tool has a spatial reference parameter that does exactly what you want -- allows the user of the tool to specify the spatial reference of the XY points in their input table. 

Reading "between the lines" it sounds as if you're in ModelBuilder.  Perhaps you need to expose the spatial reference as a model parameter.  See the help topics  Exposing tool parameters as variables and Creating model parameters





Hi
I need value list for spatial reference in "Make XY Event..." tools. User should can select desired coordinate system. But by default this is not enable in this tools.
Please help me more.
Regards
0 Kudos
DaleHoneycutt
Deactivated User
Still confused...
Attached [ATTACH=CONFIG]29536[/ATTACH]is the Make XY Event Layer dialog.  Click the icon next to Spatial Reference and you can choose the spatial reference.

Are you saying that you don't want to use the Spatial Reference dialog?  That you want to provide a fixed list of spatial references (say, 4 or 5 "standard" spatial references) that the user can pick from rather than using the Spatial Reference dialog?
0 Kudos
anjelinaponker
Emerging Contributor
Still confused...
Attached [ATTACH=CONFIG]29536[/ATTACH]is the Make XY Event Layer dialog.  Click the icon next to Spatial Reference and you can choose the spatial reference.

Are you saying that you don't want to use the Spatial Reference dialog?  That you want to provide a fixed list of spatial references (say, 4 or 5 "standard" spatial references) that the user can pick from rather than using the Spatial Reference dialog?


Yes, I,m going to add a fixed list of spatial reference. What should I do?
0 Kudos
DaleHoneycutt
Deactivated User
There is no straight-forward way to do this.  You'll have to use Python. Build a custom script tool where:

  • Your input spatial reference is a string parameter

  • The parameter has Value List filter of the known projection names

  • Inside your code, you do a look-up of the input projection name string and convert it to a spatial reference object.

  • Call Make XY Event Layer passing in the spatial reference object you created.


Any listeners out there have an existing script tool that does this?
0 Kudos
anjelinaponker
Emerging Contributor
There is no straight-forward way to do this.  You'll have to use Python. Build a custom script tool where:

  • Your input spatial reference is a string parameter

  • The parameter has Value List filter of the known projection names

  • Inside your code, you do a look-up of the input projection name string and convert it to a spatial reference object.

  • Call Make XY Event Layer passing in the spatial reference object you created.


Any listeners out there have an existing script tool that does this?


I have not. Please help me.
Regards
0 Kudos