Subject: Marine Geospatial Ecology Tools (MGET) help
Text archives
From: | "Jason Roberts" <> |
---|---|
To: | "'Karl Zimmer'" <> |
Cc: | <> |
Subject: | RE: [mget-help] Sample Time Series Code |
Date: | Mon, 7 Jun 2010 16:12:28 -0400 |
Hi Karl, We’re glad you find MGET helpful for your Pronghorn project.
It is always nice to get positive feedback and hear how others are applying the
software. Unfortunately I doubt that it would be easy to morph the Sample
Rasters Listed in Table tool’s Python code into the scenario you are
looking for. MGET’s Python code is much more complicated than the
examples you see in ArcGIS because much of it is split among a collection of
modules that are then reused by many different tools in MGET. Also, it is designed
to perform a lot of validation and handle a variety of situations that the ArcGIS
examples do not even mention, resulting in a lot of code that is not directly
related to the main purpose of a given tool of interest. It would be hard to go
through this code and isolate the key parts that you would want. But if you
want to take a look anyway, open the file C:\Python25\lib\site-packages\GeoEco\SpatialAnalysis\Sampling.py
in your Python editor and look for “SampleRastersInFields” and you’ll
see the function. Rather than trying to copy that code, I suggest two alternatives: 1.
Write your own Python code from scratch. It shouldn’t be too
complicated. You’ll need a SearchCursor to read rows from the polygon
feature class. You can write a loop that goes through each polygon, reads the
field that identifies the raster, makes a feature layer that selects just the polygon,
and calls Zonal Statistics. 2.
Use ModelBuilder’s batch processing capability. You’ll
have to read how to do this in the Arc docs. I’m not sure it will be easy
to use a table as input to control the processing, but as an alternative, you
could use the “batch grid” user interface to manually enter the
data controlling it. Good luck, Jason From: Karl Zimmer
[mailto:] Hello,
Thanks for your time. Cheers, Karl Zimmer Karl
Zimmer, B.Sc., MGIS (candidate), P.Biol. Univeristy
of Calgary, Calgary,
Alberta |