Select to view content in your preferred language

Automatically create points based on algorithm

984
6
07-14-2021 04:00 AM
Labels (1)
freddys94
Emerging Contributor

Hello,

I have a shapefile with points representing the sightings of different bird species on different dates (in ArcMap 10.4.1). I now have to create a new shapefile with points for bird terretories. A terretoriy point is drawn when two points (sightings) of the same species on different dates are not more than 100 Meters apart.

Instead of creating my points manually, it would be great if there is a function where I can insert a algrotihm, so my points are drawn automatically if the meet the given conditions.

Thank you!

0 Kudos
6 Replies
RPGIS
by
Frequent Contributor

Hi freddys94,

So there are a couple of ways to achieve what you are looking to do.

  • Option 1: Run scripts automatically via Windows Task Scheduler: With this method you can easily create a python script, schedule the script to run using a .bat file, and set the dates and times for it to run. Here is a link that gives an breakdown on how to schedule scripts to run using Windows Task Scheduler.

 

  • Option 2: Create a custom tool using model builder or a custom python script tool: You can create a custom tool using either model builder or python. With modelbuilder, you can use the various tools to create territory points based on the criteria, and then run the tool whenever needed. With the python script tool, you write a python script and set the parameters like any other geoprocessing tool based on the inputs and outputs. Neither option isn't automated, but they could be used to cut down the time needed to do any manual process.

There isn't a drag and drop instance where you can plug in an algorithm and things just run automatically. But the options that I gave should help out with what you are trying to accomplish.

0 Kudos
freddys94
Emerging Contributor

Thanks for your reply. I have either worked with the modelbuilder or with Python scripts, but I would prefer to use the modelbuilder. Can you give me some help, where I have to look or what kind of model I have to build? I am a bit lost here..

0 Kudos
DavidPike
MVP Frequent Contributor

Are you saying you have this model/script/algorithm already and would like it run automatically when a new point is added?

this could be accomplished with a database trigger or view if you have a relational spatial database/SDE etc.

0 Kudos
DavidPike
MVP Frequent Contributor

There's various ways to do this in Modelbuilder and scripting, but I'll outline what I think is probably the easiest conceptually and practically for someone new to modebuilder or python scripting.  i.e. this is not how I would do it but it will make the most sense to you.

In Model Builder you would first iterate of selections of the same species within the feature class using https://pro.arcgis.com/en/pro-app/latest/tool-reference/modelbuilder-toolbox/iterate-feature-selecti...

then for each selection, create a buffer https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/buffer.htm of 50 metres.

you would then have 2 tools connected to the new buffer output FC - dissolve https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/dissolve.htm and intersect https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/intersect.htm

the intersected output would be an area where at least 2 of the same species are within 100m of each-other.  NB I'd need to better understand how you want the territory defined, as this may not be what you want.

Time - I would first do a spatial join https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/spatial-join.htm of the points against the dissolved output, using a Merge rule 'Join' of the date field with a delimiter such as a comma.

Then I would do the same spatial join with the intersected output previously.  This resulting feature will then have the intersection of sightings for a single bird species (remember this is in an iteration so when this is done, the process is automatically repeated for the next species) and a field of comma-separated dates.  I would then use calculate field and a python calculation to create a set() from the dates, and if the set length (len(set) > 1)  return something like 'true'.

Thus any features where this field is 'true' would indicate a territory.  If you want a point, just use feature centroid to point.

I appreciate this is not simple for someone new to this, so I'd recommend breaking this down into bitesize chunks, and of-course there may be something simple I'm missing which someone else can point you to. 

Also recommend figuring out what you envisage the territory to look like, as this will affect the logical steps in the model.

freddys94
Emerging Contributor

Thank you very much for talking your time. I will try it out asap! The territories should be points as well (in a new layer), which then lay between two or more sightings (on different dates of the same species within a certain range). Hope that is understandable?!

0 Kudos
RPGIS
by
Frequent Contributor

So you can modify the model to achieve this as well. You can create points from lines using Create lines from points while using model iterators in tandem to create separate point feature classes for each set of lines based on that criteria. From there you can use the create points along line tool to then get the territories between the sightings.

 

Or you can create a custom shape based on the length of the lines using a similar process above if there are coincidental points within the given criteria, and use that shape to create a single point from that shape.

 

So The other bigger question is, like David was saying: "Also recommend figuring out what you envisage the territory to look like, as this will affect the logical steps in the model.", how do you want to derive the territory?

0 Kudos