Esempio n. 1
0
 def testchart(self):
     obs = r'c:\temp\chart.jpg'
     t_fc = self.t_fc
     est = ap.chart(t_fc, obs, texts = {'txt': 'Element txt'}, openit=False)
     self.assertEqual(est, obs)
     pass
Esempio n. 2
0
 def testchart(self):
     obs = r'c:\temp\chart.jpg'
     t_fc = self.t_fc
     est = ap.chart(t_fc, obs, texts = {'txt': 'Element txt'}, openit=False)
     self.assertEqual(str(est).lower(), str(obs).lower())
     pass
Esempio n. 3
0
# now print 5 rows as a formatted table, print '-' for geometries
tmp = ap.head(fc, 5, False, '|',  '-')

# Print some basic statistics for each column.
tmp = ap.summary(fc)
# Force lime, soil, and ffreq to be treated as categorical variables.
tmp = ap.summary(fc, ['lime', 'soil', 'ffreq'], ['CAT', 'CAT', 'CAT'])


# Make a quick map
# If you are in ArcMap's Python window, add fc as a feature layer.
# This will add the layer if your ArcMap's Geoprocessing options
# allow to 'Add results of geoprocessing operations to the display'.
ap.flyr(fc)
# If you are not in ArcMap, you can still plot the feature class:
ap.chart(fc)


# You can plot values in a column once you read its values into Python.
# Let's first find out what unique landuse categories there are in fc:
ap.distinct(fc, 'landuse')
# How many records of each species are there?
x = ap.values(fc, 'landuse')
ap.frequency(x)

# Now plot zinc concentration for landuse 'W'
z = ap.values(fc, 'zinc', '"landuse" = \'W\'', '"OBJECTID" ASC')
ap.plot(z)
# Arcapi now plots histograms too!
ap.hist(z)
# Show scatter plot of zinc against distance from the river
Esempio n. 4
0
tmp = ap.head(fc)
# now print 5 rows as a formatted table, print '-' for geometries
tmp = ap.head(fc, 5, False, '|', '-')

# Print some basic statistics for each column.
tmp = ap.summary(fc)
# Force lime, soil, and ffreq to be treated as categorical variables.
tmp = ap.summary(fc, ['lime', 'soil', 'ffreq'], ['CAT', 'CAT', 'CAT'])

# Make a quick map
# If you are in ArcMap's Python window, add fc as a feature layer.
# This will add the layer if your ArcMap's Geoprocessing options
# allow to 'Add results of geoprocessing operations to the display'.
ap.flyr(fc)
# If you are not in ArcMap, you can still plot the feature class:
ap.chart(fc)

# You can plot values in a column once you read its values into Python.
# Let's first find out what unique landuse categories there are in fc:
ap.distinct(fc, 'landuse')
# How many records of each species are there?
x = ap.values(fc, 'landuse')
ap.frequency(x)

# Now plot zinc concentration for landuse 'W'
z = ap.values(fc, 'zinc', '"landuse" = \'W\'', '"OBJECTID" ASC')
ap.plot(z)
# Show scatter plot of zinc against distance from the river
# The 'order by' clause ensures values come in the same order
d = ap.values(fc, 'dist_m', '"landuse" = \'W\'', '"OBJECTID" ASC')
ap.plot(d, z, main='Zinc', xlab='Ditance', ylab='Zn', pch='o', color='k')