How to specify the search radius unit for locating points along a route?

612
3
Jump to solution
06-06-2012 02:48 PM
SuiHuang
Occasional Contributor II
Hi Everybody:

    I am using the IRouteLocatorOperations.LocatePointFeatures method to locate a layer of points along a route. The document of this function is at:

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/LocatePointFeatures_Meth...

    I compared the ArcToolbox counter part of this function to it, I found the tool allows user to input the unit for the search radius. See the picture:
[ATTACH=CONFIG]15005[/ATTACH]

    How can I specify the unit in ArcObjects?

    Thank you!
0 Kudos
1 Solution

Accepted Solutions
NeilClemmons
Regular Contributor III
I've never used this method so I don't know for sure but I would guess it would expect the value in the same units used by the feature class that contains the route.  You can get this from that feature class' spatial reference.

View solution in original post

0 Kudos
3 Replies
NeilClemmons
Regular Contributor III
The UI that you see when you use a geoprocessing tool is generated from the parameters used by the tool.  The tool is simply something that someone wrote to perform a task.  The inputs it takes do not necessarily match the parameters required by the underlying ArcObjects methods that it may use.  In this case, it is most likely something that was added to make the tool easier for the user to use.  You can specify the value in whatever units are available and the tool will do the conversion before passing the value to the ArcObjects method.  When calling the ArcObjects method in code, you have to pass in the value in whatever units it expects.
0 Kudos
SuiHuang
Occasional Contributor II
The UI that you see when you use a geoprocessing tool is generated from the parameters used by the tool.  The tool is simply something that someone wrote to perform a task.  The inputs it takes do not necessarily match the parameters required by the underlying ArcObjects methods that it may use.  In this case, it is most likely something that was added to make the tool easier for the user to use.  You can specify the value in whatever units are available and the tool will do the conversion before passing the value to the ArcObjects method.  When calling the ArcObjects method in code, you have to pass in the value in whatever units it expects.


Hi Neil:

    Thank you for clarifying my issue. The real problem for me now is: how to find out the unit ArcObjects is expecting? Is it always the metric unit (which is meter)? Or should be found somewhere in the input feature class (such as their spatial reference)?
    Thank you!
0 Kudos
NeilClemmons
Regular Contributor III
I've never used this method so I don't know for sure but I would guess it would expect the value in the same units used by the feature class that contains the route.  You can get this from that feature class' spatial reference.
0 Kudos