POST
|
Hi all, in the thread below, specifically message #13 Marcin provided me a very helpful Python code to merge shape files, which are nested in subfolders. The script has worked really nicely, but now I have an additional request if maybe someone can help with. I would need the script to ALSO merge dbf tables in the same way. So if the shape file name is identical -> merge. If the dbf file name is identical -> merge. http://forums.arcgis.com/threads/60075-batch-merge-of-shape-files I would assume it is just a minor tweak to the code Marcin already produced, but can't be sure as I'm quite code illiterate I'm afraid 🙂 thanks for any help. Miika p.s. a bonus would be if anyone would know how I could implement this as a tool in models. I can bring it in as a script to arctoolbox, but how to set the parameters (input & output locations)?
... View more
03-14-2013
03:49 AM
|
0
|
0
|
2618
|
POST
|
So, maybe the problem is something with this none constant in Python? I'm using ArcGIS 10.1 - could there be differences in Python coding? Anyway, the problem is solved with the "less transparent code".
... View more
03-11-2013
11:50 PM
|
0
|
0
|
150
|
POST
|
Thanks! I couldn't get the first code block to work either, but it was the "less transparent" code that did the job! Thanks so much, now I won't have to count 700k rows manually 😄
... View more
03-11-2013
11:45 PM
|
0
|
0
|
150
|
POST
|
This is harder than I thought! Reversing the code to count the NULL values doesn't seem to work. Could it be, that you can't count NULL values, because there is nothing to count. I heard of difficulty with these. Maybe I should just select them all and populate 0. Was just hoping to reduce any unnecessary steps. The second code block suggestions does however run without any errors. The result just is not correct. It populates NULL for every cell, except for the ones where it does not have to deal with any NULL values - so in this case the rows where there are 5 names in total. So the NULL values override the result. Replacing the NULL values with some other string would possibly help here also, but then the code would have to skip this string. And one more step in the process. Thanks for all suggestions so far!
... View more
03-11-2013
04:38 AM
|
0
|
0
|
696
|
POST
|
this is getting interesting! Thanks a lot for your help so far. The script seems to work basically, but somewhere in the middle of execution it stops in a "failure during processing" message. When I look it up, it refers to error code 539. If I understand correctly the script can't handle the special characters within the names in my fields. The Sami languages have some very strange characters. If this is the problem and we can't figure a solution for it, then a workaround could be to actually count the NULL values. I would arrive to the same figure with an intermediate calculation: 5 - [amount of NULL values] = [amount of names] Could you still help me with this? [ATTACH=CONFIG]22393[/ATTACH]
... View more
03-05-2013
11:00 PM
|
0
|
0
|
696
|
POST
|
note, the image in the previous post - the count column I populated by hand for this example. This is what it should look like.
... View more
03-04-2013
09:19 PM
|
0
|
0
|
696
|
POST
|
Thanks for your help! Almost - but not quite. Or then I didn't understand it 😄 I've attached an image what the real situation looks like. There were actually 5 columns that I wanted to count, not 4 - but I don't think that makes much of a difference to the code. But I don't want to count length at any point. I only want the amount of strings (so each column basically has a value of 0 or 1. I tried changing len to count but still couldn't get it to work. Could the NULL values cause problems? There is a lot of them. [ATTACH=CONFIG]22365[/ATTACH]
... View more
03-04-2013
09:17 PM
|
0
|
0
|
696
|
POST
|
Hi all, I have 4 columns which can contain a string (a name) or can have a value <NULL>. I want to create a 5th column where I count the number of strings in the 4 columns. so for example: Column A - Column B - Column C - Column D - Column Count textA - textB - <NULL> - <NULL> - 2 <NULL> - textB - textC - textD - 3 So how do I populate this Column Count? Thanks for any ideas! Miika
... View more
03-03-2013
11:26 PM
|
0
|
12
|
1103
|
POST
|
Hi all, I'm well aware of this Easy calculate tool to get azimuth for polylines. It works brilliant. However, I would like to challenge someone to make this in to a python script or something similar, so it could be used as a tool that could be built in to models. I currently have a very long model that I have had to split in to two parts, because I need to calculate azimuth in the middle of the process. Having this built in to the model would save quite a bit of effort. Thanks for any ideas.
... View more
02-17-2013
09:59 PM
|
0
|
0
|
358
|
POST
|
Hi Marcin! I'm getting back to this thread, because I have a small issue but I think it might be a really simple thing to fix. First of all this script for merging numerous shape files to file gdb has been fantastic. It has been a real time saver. The issue I now have, is that I have datasets, which among shapefiles also have plain dbf files. I would like the script to also merge the dbf files which don't have any geometry. Currently it does not do this. The logic is otherwise exactly the same - files are named identically, are in several folders etc.. Also, a nice addition would be to know how to get a simple UI for the script, so I could use it in models. I can get the script in arctoolbox, but how do I set parameters to it? It would need only two I guess. The master folder location and the name/location for the output file gdb. Any help on these I would be ever grateful! Miika
... View more
02-17-2013
08:46 PM
|
0
|
0
|
705
|
POST
|
I know I'm pushing my luck here, but I'm beginning to realize I have a new problem... The merged files become too big for ArcGIS to handle. Any process (clip, project) I try to do to a huge shape file results in the software crashing. Would it be very complicated to make this script write to a file geodatabase? I expect them it could handle the large files better?
... View more
06-19-2012
08:57 AM
|
0
|
0
|
705
|
POST
|
Ok, we only have one more issue remaining with this - where do I send the crate of beer? 🙂 I tried it out and it works like a charm! Thank you so much!
... View more
06-19-2012
04:14 AM
|
0
|
0
|
705
|
POST
|
the larger set of folders (over 2000) have a sequence that looks like: XXXXXX_xx_mtk.shp [ATTACH=CONFIG]15275[/ATTACH]
... View more
06-18-2012
04:11 AM
|
0
|
0
|
705
|
POST
|
sorry, I was not very clear in the problem definition. Here's a snapshot what the folders look like. They are unique, with what looks like 3 different sequences running in the folder names. The length is always the same, and the end bit appears identical in all folders: XXXX_xx_tos.shp [ATTACH=CONFIG]15274[/ATTACH]
... View more
06-18-2012
04:02 AM
|
0
|
0
|
1502
|
POST
|
Assumption is that shapefile suffix 'n' is the same as subfolder suffix 'n' (suffixes are the same for shapefiles and subfolders) Oh, and I just noticed your assumption - this doesn't really apply. The folder names are completely independent to the file names. Unfortunately. Every subfolder within the master folder needs to be chchecked for the repeating file names. so it should be something like: look in folder A > select first shape file > look in folder B > is there a file with same name? no/yes > if yes, merge to first file, if no, continue to folder C... begin from folder A, skip first shape file, select second shape file... it does not look easy at all...
... View more
06-18-2012
03:52 AM
|
0
|
0
|
1502
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|