Esempio n. 1
0
 def testtypes(self):
     est = map(str, tuple(ap.types(self.t_fc)))
     obs = ('OID','Geometry','SmallInteger','SmallInteger','String','String',
             'String','Single','Single','String','String','String','Single',
             'String', 'String','Single','String','String','String','String',
             'String','String', 'String','String','Single','Double','Double',
             'Single','String','String', 'Single','Double','Double')
     pass
Esempio n. 2
0
 def testtypes(self):
     est = map(str, tuple(ap.types(self.t_fc)))
     obs = ('OID','Geometry','SmallInteger','SmallInteger','String','String',
             'String','Single','Single','String','String','String','Single',
             'String', 'String','Single','String','String','String','String',
             'String','String', 'String','String','Single','Double','Double',
             'Single','String','String', 'Single','Double','Double')
     pass
Esempio n. 3
0
url= 'https://raw.github.com/filipkral/meuse/master/meuse.txt'
text =  os.path.join(arcpy.env.scratchFolder, 'meuse.txt')
import urllib2
ur = urllib2.urlopen(url)
with open(text, 'w') as tx:
    tx.write(ur.read())
ur.close()

# We have our data in a text file, which we need to import into ArcGIS native
# format. We strongly recommend Esri File Geodatabase.
# ap has short name tviw for arcpy.management.CreateTableView,
# flyr and rlyr for CreateFeatureLayer and CreateRasterLayer.
tb = ap.tviw(text, "tb")
# check that the names and data types are what you would expect
ap.names(tb)
ap.types(tb)
# or like this:
zip(ap.names(tb), ap.types(tb))

# It is point data so let's convert it to a point feature class.
# Store it as a point feature class called 'dta' in our base.gdb.
fc = ap.to_points(tb, ap.to_scratch('dta'), 'x', 'y', 28992)
tmp = ap.head(fc)
# We don't need the table view of text any more so get rid of it.
ap.dlt(tb)
# And we don't need the text file itself either so get rid of it.
ap.dlt(text)
# Print first 10 records using default settings (columns as rows)
tmp = ap.head(fc)
# now print 5 rows as a formatted table, print '-' for geometries
tmp = ap.head(fc, 5, False, '|',  '-')
Esempio n. 4
0
url = 'https://raw.github.com/filipkral/meuse/master/meuse.txt'
text = os.path.join(arcpy.env.scratchFolder, 'meuse.txt')
import urllib2
ur = urllib2.urlopen(url)
with open(text, 'w') as tx:
    tx.write(ur.read())
ur.close()

# We have our data in a text file, which we need to import
# into ArcGIS native format, ideally Esri File Geodatabase.
# ap has short name tviw for arcpy.management.CreateTableView,
# flyr and rlyr for CreateFeatureLayer and CreateRasterLayer.
tb = ap.tviw(text, "tb")
# check that the names and data types are what you would expect
ap.names(tb)
ap.types(tb)
# or maybe:
zip(ap.names(tb), ap.types(tb))

# It is point data so let's convert it to a point feature class.
# Store it as a point feature class called 'dta' in our base.gdb.
fc = ap.to_points(tb, ap.to_scratch('dta'), 'x', 'y', 28992)
tmp = ap.head(fc)
# We don't need the table view of text any more so get rid of it.
ap.dlt(tb)
# And we don't need the text file itself either so get rid of it.
ap.dlt(text)
# Print first 10 records using default settings (columns as rows)
tmp = ap.head(fc)
# now print 5 rows as a formatted table, print '-' for geometries
tmp = ap.head(fc, 5, False, '|', '-')