|
POST
|
That is the catch with old MXD files. The graphic elements did not have element tags for a name, so you have to go through by hand and give each one a name to use the new mapping module to edit them.
... View more
04-15-2013
07:30 PM
|
0
|
0
|
1209
|
|
POST
|
They are DOS BAT file commands. They are in the windows help, or were at XP. Strange, does MSoft expect us all to stop using batch files and scheduler?? http://technet.microsoft.com/en-us/library/bb490890.aspx The idea is to cascade back status of each tool to the command script and log all messages to a file so you can see what happened. But now I have found that a lock is always going to happen if you try to update a filegeodatabase with two scripts simultaneously. I have now been reminded why it is not working while looking at the Esri Resources blog. A filegeodatabase is a single user database, and multiple scripts are effectively multiple users, unlike an Enterprise database (Oracle, SQL Server etc) where locks are per featureclass. http://blogs.esri.com/esri/arcgis/category/subject-analysis-and-geoprocessing/page/7/ [INDENT]Here are some important considerations before deciding to use multiprocessing: The scenario demonstrated in the first example, will not work with feature classes in a file geodatabase because each update must acquire a schema lock on the workspace. A schema lock effectively prevents any other process from simultaneously updating the FGDB. This example will work with shapefiles and ArcSDE geodatabase data. [/INDENT]
... View more
04-15-2013
07:02 PM
|
0
|
0
|
2752
|
|
POST
|
Maybe your scripts are not as independent as you think. If you are changing a schema of a featureset, then the filegeodatabase will get a lock, not just the featureclass. Locks happen all the time in ArcCatalog if you have it open while running a script from Pythonwin. It is often hard to get rid of the lock without exiting python completely, or ArcCatalog due to arcpy holding on to locks. I have found a tool (ExportToKML) that does not release the XML file. Not quite a featureclass, but same principle, so I expect bugs like this in other tools. You can test for schema locks in arcpy. Perhaps put in a test and wait a few minutes in a loop? Also try to ensure that locks are released. You should be able to track down the lock and then it will be easier to recode to avoid it. At 10.1 use the new capability
with arcpy.da.SearchCursor() as cur:
for row in cur:
# do something
Make sure that you try to release all potential locks. One way is to wrap tools in a python function, this does a garbage collection on exit. try using arcpy.RefreshCatalog(gdb) If you do use BAT files, add in the logging module to log results and return a value so that the batch file can stop on a failure. on exit set the return value to 0 or an error message In the batch file log any messages using:
set log_file=logPath
python myscript.py >> %log_file% 2>&1
if %errorlevel% neq 0 exit /b %errorlevel%
Cursors and files are only closed when Python does a garbage collection. The "with" construct is better at closing files immediately. It is the closest we have to a file_handle.close() for geoprocessing tools.
... View more
04-15-2013
02:51 AM
|
0
|
0
|
2752
|
|
POST
|
I would think that the designer never expected a file geodatabase would have 9000 featureclasses. So it is likely that a buffer is overflowing. The obvious question is: Why are you modelling your problem with a separate featureclass per route? I regularly build a route system in a single featureclass with 200,000 separate routes, one for each road name. It performs normally. How about building the routes differently? I cannot conceive of any single process that takes longer than a cup of coffee to complete. If it takes longer than than, then interrupt the process and find a better way! I am confident that you could find a way to complete the same work in a few minutes. Do you have indexes for key fields? Are you running geoprocessing tools inside a cursor looping around each feature? Are you processing single routes when you could run a tool that processes them all in one step?
... View more
04-15-2013
02:05 AM
|
0
|
0
|
3525
|
|
POST
|
Yes, if you run from the command prompt you will not be using a Layer and will not have a selection. You will be accessing the featureclass directly because it happens to have the same name. Try renaming the layer different from the featureclass, run in Python window and then run the same script from the command line. It will fail with an error message "no such featureclass". To get the same count you would have to save the layer to a file while it has a selection and then reference that layer file (a definition of a featureclass with selection) in the command line.
... View more
04-11-2013
01:39 AM
|
0
|
0
|
2166
|
|
POST
|
I have found a geoprocessing tool which returns the side : LocateFeaturesAlongRoutes has a postive or negative distance to indicate the left or right side of a route. There is an optional flag to measure the side from the route direction or arc direction. So all you have to do is build a route system with an id of each arc for the route_id and then use it to find the side.
... View more
04-11-2013
12:10 AM
|
0
|
0
|
6205
|
|
POST
|
How do you know that you referenced the layer and not the underlying featureclass? If they have the same name (they do by default) then it might not be clear.
... View more
04-08-2013
09:37 PM
|
0
|
0
|
1405
|
|
POST
|
The standard tool interface has a feature type called 'featureset' (in the dropdown list that has featureclass, layer, string...) This enables you to sketch a graphic on the screen that is passed into the script as a parameter. The input parameter needs a layer template set to use as a symbol reference and to define the shape type : point, line or polygon and any attributes required. When you start the tool (by opening the dialog) you can draw some features and even fill in some attributes. In my script example I create a featureset called 'mpa' in my script and then save it to a featureclass after updating the ID. i then use it to clip some layers and run statistics. online help reference While you could at 10.1 use Add-Ins to track the mouse, it is overkill if you just want to enter a simple polygon, line or a set of points interactively.
... View more
04-06-2013
03:44 PM
|
0
|
0
|
1126
|
|
POST
|
I was quite keen on using in_memory for everything that I thought was small enough, but there are often strange problems, so I have switched to using a scratch file geodatabase for even tiny featureclasses. I recently was called in to debug a system that was failing silently to update a database and the problem went away just by switching from in_memory to a scratch.gdb. I have not been able to notice any difference in total elapsed time, and having fully capable featureclasses in a scratch geodatabase is a big advantage for debugging. You never know when it will be too big. If I want in-memory performance I use Python lists and dictionaries, numpy operators or try to do SQL queries directly in the database. I would still use numpy arrays for spatial operations if they have to be done in_memory. PIL (python image library) was a much better option when manipulating a lot of jpg images before image catalogs. At 10.1 you can use geometry objects for a lot more spatial operations. I suppose that is in-memory of a sort. So I tend to use these instead of a virtual file system.
... View more
04-03-2013
01:17 AM
|
0
|
0
|
611
|
|
POST
|
I would never attempt to use a CSV file as an input table. There are just too many things to go wrong with the schema. Invalid fields names, incorrect guesses of fields types and null values. There are clearly differences when using the interactive interface in ArcMap, it must do a bit more validation such as checking for indexes. The first thing is to define a schema for the CSV using the Microsoft schema.ini definition. This helps the software stop having to guess the format of the CSV. Then it will load the rows into a nicely defined table with valid field names, instead of all numbers being floats and all strings being 255 characters. Next, copy the temporary virtual "CSV-table" into a Real Database table, such as a file geodatabase using CopyRows, something that can have a primary unique indexed key. Your join key can also be indexed and validated. For example if it is supposed to be an integer, if the field is defined as a float the join will not work. Now your JoinField tool has a chance of working.
... View more
04-03-2013
12:57 AM
|
0
|
0
|
2166
|
|
POST
|
I can see that I get a file lock on the KMZ output file after using MapToKML_conversion while still in the script, or still in Pythonwin. (I can't rename it, delete it etc). 10.1 SP1. My workflow exports the map to a KMZ and then needs to upzip the file to extract the doc.kml inside. If I re-run the script without editing I trip up on this file lock. If I exit Pythonwin something cleans up the lock, so what could I do inside the script? I have tried a del arcpy without success. Some people have success by encapsulating the tool in a function. Sometimes an arcpy.RefreshCatalog() works with featureclasses, but in this case it is a system file. A with... gpTool: would be nice! Maybe it is just another Annoyance.
... View more
04-03-2013
12:43 AM
|
0
|
2
|
1370
|
|
POST
|
Esri have changed their online geocoding service from free to paid. If we are all moving to the Cloud we will have to pay. The individual search to find a single location remains free which is why it worked on a test. Google do the same except with a few more, free search on a few, but a cutoff at 50,000 addresses. My performance was quoting using my own reference data to build a private locator on a local computer. If you have access to a reference dataset you can build your own locator, but it is so difficult most people would rather buy the service.
... View more
04-01-2013
02:41 PM
|
0
|
0
|
2466
|
|
POST
|
I have the same problem in the PythonWin screen (derived from IDLE with a windows front-end). I right-click to selectAll and then Cut. But it doesn't work in IDLE. Another reason to keep using Pythonwin.
... View more
03-26-2013
02:04 AM
|
0
|
0
|
1606
|
|
POST
|
I am getting the same issue, most of the times it bombs out around the 40K mark. I am not hitting the file size limit and I have scrubbed the data to ensure there are no bad values. Any suggestions? I need to add around 1.4M addresses for my current project. I can happily geocode 1.6M addresses (full addresses) in 25 minutes with no problems in one process on a local PC. Maybe avoid a network share? I hope you are using a 10.x locator? Since you have scrubbed the data, it must be something else. At 10.1 you can tune the locator, memory allocated etc. You might get better performance by sorting on the required fields first.
... View more
03-25-2013
08:19 PM
|
0
|
0
|
2466
|
|
POST
|
Hi Brad, When you pass in an address without a unit designator to the get candidates method, addresses having a unit are ranked the same as an exact match without a unit. This effectively means that the geocoding operation does not perform correctly for any location having secondary addresses (has units) AND a primary address (no units), such as an apartment building with a office at the primary address. Roy Earlier in the forum this is exactly what was asked for. You can't please everyone all of the time. I would like this behaviour too, so I am fiddling with the configuration file to change it.
... View more
03-25-2013
08:06 PM
|
0
|
0
|
2678
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 06-30-2026 07:19 PM | |
| 2 | 06-12-2026 03:28 PM | |
| 1 | 03-11-2023 03:54 PM | |
| 1 | 09-15-2024 10:32 PM | |
| 1 | 03-12-2026 01:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-30-2026
07:13 PM
|