|
POST
|
Good news ! While I have been figuring it out and looking at the help on this problem..Sigh It is been battle back and forth for me . The problem is in the Creating Mosaic Dataset.. This works ! I have made a lot of change from the original code I post yesterday... I had to copy the code from this reateMosaicDataset example 2 (stand-alone script) ArcGIS Help 10.1 it was giving several problems.... the prjfile does not work... so I add the the SpatialReference with WKID in it and make sure the code in one line..example see 26
################################################################################
# CREATE FILE GEODATABASE AND THEN CREATE MOSAIC DATASET #
################################################################################
# Name: CreateFileGDB_Example2.py
# Description: Create a file GDB
# Import system modules
import arcpy,os,sys
arcpy.env.workspace = "C:/workspace"
# Set local variables
out_folder_path = "C:/workspace"
out_name = "Think.gdb"
# Execute CreateFileGDB
arcpy.CreateFileGDB_management(out_folder_path, out_name)
# Creating new Mosaic Dataset within Existing File Geodatbase
try:
gdbname = "Think.gdb"
mdname = "SeeIfThisWorks"
prjfile = arcpy.SpatialReference(26913)
noband = "3"
pixtype = "8_BIT_UNSIGNED"
pdef = "NONE"
wavelength = ""
arcpy.CreateMosaicDataset_management(gdbname, mdname, prjfile, noband,pixtype, pdef, wavelength)
except:
print "Create Mosaic Dataset failed"
... View more
03-18-2015
10:02 AM
|
1
|
0
|
1649
|
|
POST
|
I am trying to create file geodatabase and create a mosaic dataset; however I do know that creating a file geodatabase works but the mosaic dataset is not... I think there must be a way to force the dataset within the file geodatabase but it is blocking me ? Take a look at my codes Thanks. ################################################################################
# CREATE FILE GEODATABASE AND THEN CREATE MOSAIC DATASET #
################################################################################
# Name: CreateFileGDB_Example2.py
# Description: Create a file GDB
# Import system modules
import arcpy
# Set local variables
out_folder_path = "C:/workspace"
out_name = "test.gdb"
# Execute CreateFileGDB
Test = arcpy.CreateFileGDB_management(out_folder_path, out_name)
# Creating new Mosaic Dataset within Existing File Geodatbase
# Set NAD 1983 UTM Zone 13N
sr = arcpy.SpatialReference(26913)
mdname = "/SeeIfThisWorks"
try:
# To see if the file exists or not
Test = arcpy.CreateFileGDB_management(out_folder_path, out_name)
#Then create the file
mdname= arcpy.CreateMosaicDataset_management(out_folder_path,Test,mdname)
except:
str = "Your Mosaic Dataset" +str2+"" "is done created"
str2 = "Test"
print str + str2
... View more
03-17-2015
02:34 PM
|
0
|
6
|
5102
|
|
POST
|
I would export your polygons to geodatabase first and have the polygon as a backup.. Once you export it to geodatabase then add the topology and that should help you find the overlaps.... To learn about it go here...ArcGIS Help 10.1
... View more
03-16-2015
10:40 AM
|
1
|
0
|
1045
|
|
POST
|
Thank you all. First of all, The file for the FTP server I have checked is no longer there or may have been moved; however, I tweaked and change to a different file to test it. The script is working now . If you compare the scripts I post earlier and the change I made.... I would like to Thank to Owen Earley for pointing me to the missing "else". That worked ! # Import modules
import ftplib
import os
import socket
from ftplib import FTP
HOST = "ftp.nifc.gov"
DIRN = "Incident_Specific_Data/ALASKA/DataRequests/"
FILE = "AK_UIA_polygon_data.gdb.zip"
# Create a block to connection or not
try:
f = ftplib.FTP(HOST)
except (socket.error, socket.gaierror), e:
print "ERROR: cannot reach" % HOST
else:
print '"***Connected to host "%s"' % HOST
# to log in anonymously
try:
f.login()
except ftplib.error_perm:
print "ERROR: cannot login anonymously"
f.quit()
else:
print '***Logged in as anonymous'
# To change to the directory in DIRN
try:
f.cwd(DIRN)
except ftplib.error_perm:
print 'ERROR: cannot CD to" "%s' % DIRN
f.quit()
else:
print '***Changed to "%s" folder' % DIRN
# Use the FTP Directory to retrieve KMZ
try:
f.retrbinary('RETR %s' % FILE, open(FILE, 'wb').write)
except ftplib.error_perm:
print "ERROR: cannot read file" % FILE
os.unlink(FILE)
else:
print "***Downloaded %s to CWD" % FILE
# Disconnect from FTP
f.quit()
... View more
03-15-2015
04:29 PM
|
0
|
0
|
3110
|
|
POST
|
# Import moduels
import ftplib
import os.path
from ftplib import FTP
HOST = 'ftp.nifc.gov'
DIRN = '/incident_Specific_Data/ALASKA/Fire_Perimeters/20090805_1500'
FILE = 'FirePerimeters_20090805_1500.kmz'
# Create a block to connection or not
try:
f = ftplib.FTP(HOST)
except (socket.error, socket.gaierror), e:
print 'ERROR: cannot reach "%s"' % HOST
print '*** Connected to host "%s"' % HOST
# to log in anonymously
try:
f.login()
except ftplib.error_perm:
print 'ERROR: cannot login anonymously'
f.quit()
print '*** Logged in as "anonymous"'
# To change to the directory in DIRN
try:
f.cwd(DIRN)
except ftplib.error_perm:
print 'ERROR: cannot CD to "%s"' % DIRN
f.quit()
print '*** Changed to "%s" folder' % DIRN
# Use the FTP Directory to retrieve KMZ
try:
f.retrbinary('RETR %s' % FILE, open(FILE, 'wb').write)
except ftplib.error_perm:
print 'ERROR: cannot read file "%s"' % FILE
os.unlink(FILE)
else:
print '*** Downloaded "%s" to CWD' % FILE
# Disconnect from FTP
f.quit() Here is the full code Thanks.
... View more
03-15-2015
10:40 AM
|
0
|
4
|
3110
|
|
POST
|
# Use the FTP Directory to retrieve KMZ
try:
f.retrbinary('RETR %s' % FILE, open(FILE, 'wb').write)
except ftplib.error_perm:
print 'ERROR: cannot read file "%s"' % FILE
os.unlink(FILE)
else:
print '*** Downloaded "%s" to CWD' % FILE
Do they seem right to you ? This is from the book Programming ArcGIS 10.1 with Python cookbook. When I ran it in Pyscripter 2.5.3.0 and it gave me the error : Traceback (most recent call last): File "C:\ArcpyBook\Appendix2\ftp.py", line 45, in <module> f.retrbinary('RETR %s' % FILE, open(FILE, 'wb').write) File "C:\Python27\ArcGIS10.1\lib\ftplib.py", line 398, in retrbinary self.voidcmd('TYPE I') File "C:\Python27\ArcGIS10.1\lib\ftplib.py", line 248, in voidcmd self.putcmd(cmd) File "C:\Python27\ArcGIS10.1\lib\ftplib.py", line 178, in putcmd self.putline(line) File "C:\Python27\ArcGIS10.1\lib\ftplib.py", line 173, in putline self.sock.sendall(line) AttributeError: 'NoneType' object has no attribute 'sendall'
... View more
03-15-2015
09:43 AM
|
0
|
6
|
7921
|
|
POST
|
While this is a good tempting to use it on your personal computer it is a good to have; however my computer is under the Government so we are not allowed to download these programs on them. We were able to recovery it by requesting our IT department to restore it.
... View more
03-14-2015
08:03 PM
|
1
|
0
|
1244
|
|
POST
|
Do you have a good website that give the examples ?
... View more
03-14-2015
10:09 AM
|
0
|
1
|
3888
|
|
POST
|
What does it mean hardcorded ? I am trying to get a grasp of what it means ? Thanks
... View more
03-14-2015
09:27 AM
|
0
|
9
|
7643
|
|
POST
|
I am not sure if you are aware that there is another good site for you to read... it is called GIS Stackexchange where everyone share their GIS problems. I looked it up for your similiar situation and found a lot of good information... The website is Geographic Information Systems Stack Exchange Type Mosaic Dataset Good luck.
... View more
03-09-2015
08:11 AM
|
0
|
1
|
453
|
|
POST
|
@Dan Patterson Sorry, this code came from the book I am working on from Eric Pimpler's ebook "Programming ArcGIS 10.1 with Python cookbook. That book was in 2013 Yes I find a lot of errors in that book however I tried to tweak some of the codes but was not able to figure it out and I thought there must be a way around to correct it..
... View more
03-08-2015
09:12 PM
|
0
|
1
|
1778
|
|
POST
|
You should be able to use this method... might want to look at here Image Management Workflows | ArcGIS Resource Center Honestly, it is an awkward workflow but I had to work on it for many hours until I understand how it works... Like I said I did work on NAIP for New Mexico and i was able to get it right..it took me to figure it out about three days... I have asked others here on the GeoNet and only few people repsond me back... Do you have background in Erdas or Envi ?
... View more
03-08-2015
09:08 PM
|
0
|
3
|
1334
|
|
POST
|
Before I ask you further, how many aerial images and what will you be using them for ?
... View more
03-08-2015
08:58 PM
|
0
|
5
|
1334
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-01-2022 03:43 PM | |
| 1 | 09-28-2020 09:34 AM | |
| 2 | 09-24-2025 09:48 AM | |
| 1 | 09-22-2025 08:29 AM | |
| 1 | 09-17-2025 12:58 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|