|
POST
|
This is a licensing issue. What license level are you? Try import arcview Before you import arcpy to expicitly set your license level (or arceditor, etc). Make sure your license manager is running.
... View more
02-18-2011
09:35 AM
|
0
|
0
|
8080
|
|
POST
|
If that's what you want, then a .zip file is not the appropriate distribution mechanism -- workspaces can be more than a directory, such as an .sde file or file geodatabase, and a dataset living in any non-directory workspace would not be included in the zip. In fact, it would be hard to even include .shp files in the directory tree because ListDatasets would return each one without the .shp extension. For what you want, use a Map or Layer package from desktop to consolidate your data.
... View more
02-17-2011
02:49 PM
|
0
|
0
|
5163
|
|
POST
|
Please file an issue with Esri tech support so it can be investigated, tested and fixed for a future SP, Quick Fix, or release.
... View more
02-16-2011
04:02 PM
|
0
|
0
|
2063
|
|
POST
|
I think you are onto somthing, but I need a little help integrating it into the arcpy module. What would it be like if we know that the dirpath is the arcpy.env.workspace is the current one. Then we want to make everything in that dirpath zipped up. Would it make the script shorter somehow? Not really. def zip_directory_to_zipfile(out_zipfile):
out_zip = zipfile.ZipFile(out_zipfile, 'w')
for (dirpath, dirnames, filenames) in os.walk(arcpy.env.workspace):
for file in filenames:
path_in_zip = os.path.join(os.path.relpath(dirpath,
lib_dir),
file)
if os.path.split(path_in_zip)[0] == ".":
path_in_zip = os.path.split(path_in_zip)[1]
out_zip.write(os.path.join(dirpath, file), path_in_zip)
... View more
02-16-2011
03:45 PM
|
0
|
0
|
5163
|
|
POST
|
def zip_directory_to_zipfile(directory, out_zipfile):
out_zip = zipfile.ZipFile(out_zipfile, 'w')
for (dirpath, dirnames, filenames) in os.walk(directory):
for file in filenames:
path_in_zip = os.path.join(os.path.relpath(dirpath,
lib_dir),
file)
if os.path.split(path_in_zip)[0] == ".":
path_in_zip = os.path.split(path_in_zip)[1]
out_zip.write(os.path.join(dirpath, file), path_in_zip)
... View more
02-16-2011
12:29 PM
|
1
|
0
|
5163
|
|
POST
|
import zipfile
zip = zipfile.ZipFile(r'c:\my.zip')
zip.extractall(r'c:\output')
This will extract the contents of my.zip to c:\output
... View more
02-16-2011
10:18 AM
|
2
|
0
|
5163
|
|
POST
|
You do not need to do anything to make your scripts work in 10.0, all previous functionality with the geoprocessor object will continue to work unmodified.
... View more
02-12-2011
10:31 AM
|
0
|
0
|
1355
|
|
POST
|
You can reproject a Feature Class on the cursor, there is an optional Spatial Reference argument you can send to arcpy.SearchCursor.
... View more
02-10-2011
08:00 AM
|
0
|
0
|
2063
|
|
POST
|
You could use a generator in this case: import arcpy
import os
def fcs_in_workspace(workspace):
arcpy.env.workspace = workspace
for fc in arcpy.ListFeatureClasses():
yield os.path.join(workspace, fc)
for ws in arcpy.ListWorkspaces():
for fc in fcs_in_workspace(os.path.join(workspace, ws)):
yield fc
for fc in fcs_in_workspace("C:/Data"):
...
Or you could do something like fclist = list(fcs_in_workspace("C:/Data")) and reuse it.
... View more
02-07-2011
02:52 PM
|
0
|
0
|
3957
|
|
POST
|
You'll need to save a raster layer as a .lyr file to disk with the symbology you want, then use arcpy.mapping.Layer to open the layer file and set the dataSoruce attribute to the source of the new raster you've created.
... View more
02-04-2011
09:34 AM
|
0
|
0
|
1263
|
|
POST
|
What exactly would you like to do in ArcObjects that you can't do through arcpy? We're interested in supporting most old VBA workflows through Python, and typically want them to have higher-level, easier to use APIs in Python over the ArcObjects (for instance, the arcpy.mapping module in 10.0). It's not supported (as in we will not provide technical support), but it is possible. See this forum topic or this gis.stackexchange answer.
... View more
01-26-2011
11:01 AM
|
0
|
0
|
367
|
|
POST
|
Have you gotten arcpy/arcgisscripting to play well with in IronClad? I haven't ever been able to get it in any sort of working state that I'd trust in production. IronPython is great, but if you're going the .Net route you're going to need to use ArcObjects and the .Net SDKs. You get Python syntax to do your coding in but you're in a totally different development environment.
... View more
01-24-2011
07:45 PM
|
0
|
0
|
809
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-26-2012 02:46 AM | |
| 2 | 01-06-2011 08:22 AM | |
| 1 | 03-25-2014 12:18 PM | |
| 1 | 08-12-2014 09:36 AM | |
| 1 | 03-31-2010 08:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|