How to get x,y values for user selected point using python in ArcGIS Pro?

2473
9
Jump to solution
02-09-2021 03:14 PM
JaniceBaird
Occasional Contributor II

Hi All,

I am trying to find a way to get user input for a python script. What I want to do is ask the user to select a point on the map and then use the x,y values in another step in the script. I have a feeling that ArcGIS Pro and arcpy do not have this capability, yet. What I am really looking for is to be able to get an address (or event) along a route at the location indicated by the user... So, I want the script to ask the user to select the location along the route that they want to know the closest address for.

I have been able to create an event table using address points and displaying them on the route. I want to go the other way and determine what the address would be at the selected location. I know there was (or is) a tool in ArcMap which gives you an address along a route... still waiting for something like that in Pro.

Thanks,

Janice.

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
AlisonKelsey
Esri Contributor

Hi @JaniceBaird ,

This GetParameter tool is also available in ArcGIS Pro.  Please visit the following link:

https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/getparameter.htm

Cheers,

Alison

 

View solution in original post

9 Replies
DanPatterson
MVP Esteemed Contributor

like this functionality ? Introduction to identifying addresses and places on the map—ArcGIS Pro | Documentation

Also, if it is something that can actually be selected, most tools work with selections rather than all features.

So perhaps what you intend to do next might be critical


... sort of retired...
0 Kudos
JaniceBaird
Occasional Contributor II

Hi @DanPatterson ,

I read through that information but am not excited about reverse geocoding or creating a locator at this time.

I am looking into whether there is a tool already in Pro/arcpy to get input from the user when they click on the map. I was going to use that clicked point x,y to find the address on a route. Instead, I generated a table of events for my route and drew all of them on the route so the user could identify the one closest to the location they are addressing. My script gets the address points in the map extent, reads the route id from the address points, gets the address range from a sql table of routes, creates an event table from that information and then draws a point feature at each event location...

I was hoping that there was a tool in Pro like the tool in ArcMap that gives you the address information at any point along the route... I may be remembering wrong and actually had locators setup in ArcMap.

Thanks,

Janice.

0 Kudos
JaniceBaird
Occasional Contributor II

Hi @AlisonKelsey ,

Those links are related to ArcMap... I am trying to do this in Pro.

Thanks for the info. I will read over them but don't believe that the GetParameter idea will work.

Janice.

0 Kudos
AlisonKelsey
Esri Contributor

Hi @JaniceBaird ,

This GetParameter tool is also available in ArcGIS Pro.  Please visit the following link:

https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/getparameter.htm

Cheers,

Alison

 

by Anonymous User
Not applicable
You might have to go full Arcgis for PRO SDK and write a pro extension to be able to interact with the map view like that. I’ll be interested to see what others think.

0 Kudos
DavidPike
MVP Frequent Contributor

You could physically create a point in the tool using FeatureSet—ArcGIS Pro | Documentation - which will then allow interactive point drawing.  Then do whatever process within the script to get the point x/y or address.

0 Kudos
DanPatterson
MVP Esteemed Contributor

I don't do the geocode thing, but

Getting to Know ArcGIS Pro 2.6 Geocoding update - GeoNet, The Esri Community

has changed and @JoeBorgione would be the man that has suffered with addresses and stuff 


... sort of retired...
0 Kudos
JoeBorgione
MVP Emeritus

...not excited about reverse geocoding or creating a locator at this time.

Life is all about trade-offs, I guess.  In your case I think you'll need to go the route suggested by @Anonymous User  as I don't know how to capture a mouse click/reverse geocoded point to python.

That should just about do it....
0 Kudos