Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Help in spatial analysis - Finding given coordinates in a map/polygon/shapefile

Data-Nuker
7 - Meteor

Dear Forum Members,

 

I have two set of coordinates;

 

(1) Initial position  - this should be a country where initially recorded say India

(2) current position  - might be in Nepal

 

Now I need to find whether or not current position exists in initial position.

 

I should be able to identify that the current position should be in the initial position or somewhere the whole country India but if it does not exist there as in our example then it should be noted with the new location and if it exists still anywhere in India then recorded the current position to initial position.

 

I thought I can get a shape file for each country or region and somehow work out the given coordinates whether these given coordinates exists in that country/region or not if not mark the new location and if exists then mark the old location.

 

Is this something which can be done?

 

Many thanks in advance.

4 REPLIES 4
echuong1
Alteryx Alumni (Retired)

Yes, this can be achieved. You can essentially do a spatial match with the coordinate and country geospatial objects. You can check to see if the point is within the country object.

 

Take a look at the following functions:

ST_Contains

ST_Contains(object1,object2): Returns True if object1 contains object2 (Boolean value).

ST_TouchesOrIntersects

ST_TouchesOrIntersects(object1, object2): Returns True if object1 touches or intersects object2 (Boolean value)

ST_Within

  • ST_Within(object1, object2): Returns True if object1 is contained by object2 (Boolean value).
Data-Nuker
7 - Meteor

Hi echuong1,

 

Thank You very much for Your reply, this is what I am likely to do, thanks.

I am finding it difficult to plot it - is there any example available for this?

 

I am trying to see if I can find a shape file for India/any other country and see if my given long and lat exists in there.

 

Kind regards

echuong1
Alteryx Alumni (Retired)

I'm not sure what your original inputs look like, so I'm not sure of exactly what you would need to do.

 

The attached example takes a lat and lon and finds the corresponding district it is in. The second example takes two spatial objects (one district area and one point) and sees if the point is within the district.

 

Hope this helps.

 

echuong1_0-1605800682759.png

 

Labels