0

From classes at uni, I have just some basic knowledge of Python. After an introduction to variables, datatypes, lists etc., we were using GDAL/OGR and despite some troubles, I was able to write some simple scripts performing geo-operations. We were also only very briefly introduced to ArcPy.

Now, I am trying to process tasks for my bachelor thesis where I have 11 shapefiles of geocoded data. I need to perform the same operation over each of the point shapefiles (they contain very similar data - addresses of students' studying at our faculty during the given academical year). I am sure it must be possible to write a simple script that would iterate through each of the shapefiles and perform desired operation but I am unable to put it together.

Could anyone at least give me a hint how to do it?

I am aware that this is not a place where I ask a question and you do everything instead of me.

I suppose I should be using ArcPy to do this, am I right?

What I specifically want to do is extract (like select and put them in a new shapefile) those points which are inside buffers I created. I have 5 concentric rings with given perimeters.

You probably understand that clicking 5×11 times very similar operations is not what is particularly scholarly.

Which part of 'help' should I explore?

closed as off-topic by PolyGeo Jul 7 '17 at 20:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • use a loop statement tutorialspoint.com/python/python_loops.htm – NULL.Dude Jul 7 '17 at 16:11
  • 3
    Arcpy is a tool that could be used if you have access to it. There are also many other tools that could do the same thing if you have them and know how to use them. If you have ArcMap, you can run each step from a geoprocessing tool (ArcToolbox tools) and then right-click on each result and "Copy as Python snippet" to get that code into python. This will create a decent base to start from – Midavalo Jul 7 '17 at 16:41
  • 1
    Don't forget to take the Tour. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. There should also be only one question asked per question. – PolyGeo Jul 7 '17 at 20:12
  • Please, precise what you called "desired operations", are they operations on the Shapefile themselves or on the features inside them? And which kind of operations are they? Doe it only consist of buffer creation? – s.k Jul 8 '17 at 22:51
2

It will probably take you longer to write the code than do it in a manual fashion.

Have you considered just using merge to make one shapefile, then doing something like a spatial join to take the buffer info into the points? You could query and export what you needed and avoid the code time.

Now if you had to do this every week or had 100's of files, I'd look further into the python adventure.

Another option is look at model builder, it uses ArcMaps tools and you can export the model as a python script, giving you a head start. Maybe even take the separate processes to different models/scripts and then putting together the python code. If your coding is weak it's an easy place to start.

Not the answer you're looking for? Browse other questions tagged or ask your own question.