Thursday, July 29, 2010

sea monkey

New html editor. Open source, free.

http://www.seamonkey-project.org/

Completing my very perplexing office suite of Google docs, TeXnicCenter, gnumeric, and gimp.

trace of a river profile

A somewhat less lazy explanation of how to extract the trace of a river profile. [lazy explanation]

(1) Download the relevant file from the National Hydrography Dataset. (I recommend using the ftp site, which unfortunately only works on Internet Explorer.)

(2) Open the hydrology layer in arc.

(3) Determine the source latitude and longitude of your river of interest. You may be able to find this under the Geographic Names Information System entry for your river.

(4) Go to that lat/lon in the arc file and locate the source.

(5) Select the feature using Navigation [from this tutorial]

a. Click on Analysis in the Utility Network Analyst toolbar, click Options, and then Results.

b. Click on the Selection radio button, Apply, then OK.

c. Perform navigation. The navigation path will select and display NHDFFlowlines.

i. Click on View, Toolbars, and then check the Utility Network Analyst box.
ii. HYDRO_NET will appear automatically in the Network box.
iii. click the Add Edge Flag tool. The flag marks the start of the navigation path.
iv. click cursor at appropriate point on flowline (the source).
v. Select Trace Task, Trace Downstream
vi. Click on the Solve icon - it should highlight the river downstream of the flag

(6) Save the new shapefile. Right-click on NHDFlowline in the Table of Contents, scroll to Data, click on Export Data. Export selected entries, name the new shapefile.

Monday, July 26, 2010

Quaternary faults, reproject

Quaternary Faults in California, maintained by California Geological Survey:
http://www.consrv.ca.gov/cgs/information/publications/Pages/QuaternaryFaults_ver2.aspx

(1) Download .e00 files
(2) Import from Interchange File

(3) Data Management Tools -> Projections and Transformations -> Feature -> Project
Fill in:
Input Dataset
Input Coordinate System (automatic)
Output Dataset (put what you want, specify folder you want)
Output Coordinate System (for me: NAD_1983_UTM_Zone_10N)
Geographic Transformation (for me: (guessed) NAD_1927_To_NAD_1983_NADCON)

Aside:
wth is NADCON
http://www.ngs.noaa.gov/TOOLS/Nadcon/Nadcon.shtml

dealing with .e00 files v.2

Converting .e00 files. An easier way than here:

In ArcCATALOG

View -> Toolbars -> ArcView 8x Tools -> Conversion Tools
Import from Interchange File

data frames, neatlines, graticules

In ArcMap sometimes you want to add lat/lon ticks around your map, add a scale bar, etc.

This stuff is all filed under Page Layout and Map Composition. You see most of this stuff under the Layout View, not the Data View. (Buttons in lower left corner of map window toggle these.)

data frame: most fundamental element in a map document and in ArcMap user interface.

neatline: border line commonly drawn around the extent of a map to enclose the map, keeping all o the information pertaining to that map in one "neat" box

graticule: the grid of intersecting lines, esp. of latitude and longitude on which a map is drawn. vs. gridicule.

Accessing the Grids and Graticules wizard:
  1. Click the View menu and click Data Frame Properties.
  2. Click the Grids tab.
  3. Click the New Grid button.
Adding grids and graticules (reference systems)

Working with data frames
Adding data frames
Customizing data frames (you can rotate them)
How to do inset maps (extent rectangles)

Thursday, July 22, 2010

gnumeric

I am now using gnumeric as my spreadsheet software on my work computer.

http://projects.gnome.org/gnumeric/

You can download a Microsoft Windows build if you want. [.exe]

Not too many variations on a spreadsheet program. It's not that I actually reject Excel and Open Office Calc, it's just that they won't successfully install on my !#$^(!&#)^ computer.

spatial hydrology data

I've been trying to download river spatial data (for arc) for a while now, and finally have come up with some sort of resolution. But the problem seems to be information overload. I still haven't figured out if there's a way to, say, query "Truckee River" and have the trace of only that river returned.

Instead, here are some convoluted ways to get data of Quads or defined map areas.

(1) USGS maintains the National Hydrography Dataset.

(2) The Data Availability page describes ways to obtain the data.

(3) It appears that USGS is in the middle of transitioning to a new map viewer/data downloader interface.

New one: http://viewer.nationalmap.gov/viewer/

It is easy to download hydrology data by quadrangle, if you click on the map, it tells you the quadrangle and the available data. (Using the download data tool.)

(4) One way to figure out all of the quadrangles covered by a particular river is to use the Geographic Names Information System.

(5) The page for the river will list each quadrangle, which you can then locate in the Map Viewer.

(6) You send in a request for a data and it may take several hours to be returned. (Still waiting for some I ordered a couple hours ago.) It is not very efficient.

(7) Another way is to download pre-defined subregions. These datasets are ~250 MB zipped and ~750 MB unzipped. It is information overkill, but you can also download it right away. The old map viewer seems to be better in identifying the 4-digit identifier (first 4 of the 8 digits).

FTP for predefined regions:
ftp://nhdftp.usgs.gov/SubRegions/

Only works in Internet Explorer! Not Firefox or Chrome! Also has a README in a .doc format! gah.

I'm not sure how much closer this gets me to the trace of a single river, but possibly this information will be useful to someone somewhere.

Here's their tutorial.
http://nhd.usgs.gov/tutorials.html

Note:

The last section of the tutorial, on Navigating, actually lays out how to save the trace of a river. First you need to click on Analysis in the Utility Network Analyst toolbar, and click Options, Results, and check Selection.

Then "perform navigation," set an Edge Flag at the source of the river (this is located in the Geographic Names Information System entry, or at least the correct quadrangle). Then use the Utility Network Analyst to navigate to all points downstream.

You will be able to save it to the map and export the data as a shapefile.

Read the last page of the tutorial linked above.

Wednesday, July 14, 2010

Export Table to ASCII

Under the Spatial Statistics Tools, under Utilities, there is a tool called Export Feature Attribute to ASCII.

This tool will write out a .dbf Attribute Table to ASCII, thereby negating my previous bitching about it. You can choose which columns to write out, and you can choose the delimiter.

Great, Way to make me feel dumb, arc. I can still complain that this tool is hidden where it is - why not just have a button for Export .dbf, or Save As? Why?

Oh well, now we know.

Tuesday, July 13, 2010

refreshing and labeling

In ArcCatalog, if you've just created a new layer in ArcMap, it may not appear until you refresh the list. To refresh the list, use F5.

Labels

You can label features (ugh, an arc word...) with their attributes (ugh, another arc word). There is a toolbar for it.

You might need to be in an open Edit Session for this to work.

View -> Toolbars -> Labeling

The first icon is the Label Manager.

You can label with more than one attribute field. Click on the Expression button under Text String. You can Append more than one field name in the label. (e.g. you can label a fluvial terrace with both its unique id number and also the terrace grouping Qt1, Qt2, etc.)

Edit the size and color and etc. to your liking.

The end.

Text in ArcGIS is nontrivial (labels vs. annotation vs. graphic text), but labeling is relatively straight-forward.

Overview of working with text

Friday, July 9, 2010

linear referencing and hatch marks

Linear referencing: point location along the line as an alternative to expressing the location using an xy coordinate. Useful, for example, for measuring distance along a stream.

An Overview of Linear Referencing

Here are steps outlining a way to put hatch marks (with distance labels) on a polyline (e.g. following a stream).

1. When you create the polyline shapefile in arc catalog, you need to check the box for "Coordinates will contain M values. Used to store route data."

2. Make the polyline (start edit session, click click click, double click to end, stop edit session)

3. In the arc toolbox -> linear referencing tools -> create routes  [routes?]

a. Input line features: the polyline layer
b. Route identifier field: (you can use id or if you created another field like "route." If there's only one line, that's ok.)
c.  Output route feature class (it fills in a default)
d.  Coordinate Priority: where is the start of the polyline? In my case, lower_left.
e.  click OK - this will create another later eg. channel_CreateRoutes

4. I'm still fuzzy on why you need an entirely new layer, but anyway... it is on this new layer that you can specify hatch marks.

This page nicely outlines the 19 (!!!) steps necessary to display hatch marks on that layer:

Displaying hatches

  1. Right-click the layer in the table of contents that you want to hatch and click Properties.
  2. Click the Hatches tab.
  3. Check Hatch features in this layer.
  4. Type an appropriate hatch interval.
  5. Click Hatch Def(1).
  6. The Hatch Definition view becomes active.
  7. Type an appropriate line length.
  8. Right-click the hatch class and click Add Hatch Definition.
  9. The Hatch Definition view becomes available.
  10. Type an appropriate multiple of the hatch interval.
  11. Type an appropriate line length.
  12. Check Label these hatches.
  13. Right-click the hatch class and click Add End Hatch Definition.
  14. The End Hatch Definition view becomes active.
  15. Type an appropriate end hatch tolerance if necessary.
  16. Type an appropriate line length.
  17. Check Label these hatches.
  18. Click OK.
  19. Poke your eye out with a pen.

5. Peripherally related: It may also be useful to you to divide a line into segments: Splitting line features

6. Next up: putting something useful along the route: Event Tables

in the beginning...

Sometimes you have to start from the beginning, there can be useful information in the beginning.

LaTeX 
"haha, if you're not smart enough to figure this out, too bad for you."

http://en.wikibooks.org/wiki/LaTeX/Introduction
http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics 

Arc
"haha, we don't give a fck about user experience, too bad for you."

http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=An_overview_of_the_Geodatabase

Wednesday, July 7, 2010

jabref and TeXnicCenter and BibTeX

BibTeX, I hate you for making me feel stupid. But I love you because you are going to make my life a lot easier. right? Right?! RIGHT??!!

1. JabRef databases are saved in .bib format, which are just .txt files and can be opened with WordPad or vi or whatever. They might have a bunch of extra crap in them like full abstracts, the notes you typed into JabRef, whatever. Export the entries for your paper into a separate .bib file: blah.bib.

2. Using the BibTex keys in JabRef, cite the stuff in your .tex file (in TeXnicCenter on a dumb PC if you are like me)

\citet and \citep are for textual and parenthetical citations
Reference sheet for natbib usage

\citep{Dietrich2003, Gauer2004, Stock2006}

3. You have downloaded all of the necessary style files or whatever, for example from the AGU website, and put the agu08.bst file into your working directory. In your working directory, you also have your .tex file and the blah.bib file. In the .tex file you have referenced the .bst and .bib you are using.

\bibliographystyle{agu08}
\bibliography{blah}

4. Build your document in TeXnicCenter. In the profiles for building files (e.g. for LaTeX -> PDF) there is a box to check for running BibTeX (mine was already checked by default). This first Build creates a .bbl file in your working directory.

5. Cut and paste the contents of the .bbl file into your .tex file AND comment out the two lines above in #3.

6. Build the document again, it will now use the \bibitems in the .tex file and everything will work great and you will feel great too. (You might need to build more than two times for all cross references.)

Have fun.

[9/30/2010 ps. It would be very helpful to know if this explanation is useful to you, or if you need/want more detail, or if it worked for you or not. There seems to be the most demand for this information and I really hate how there is not much info out there. I will monitor comments.]

dealing with .e00 files

.e00 files are from an older version of arc. a simpler time. but now it is complicated to open them.

update 7/26/2010:
Easier way:

In ArcCATALOG

View -> Toolbars -> ArcView 8x Tools -> Conversion Tools
Import from Interchange File

**** old stuff below ***

I ended up importing some .e00 files that were in a .tar.Z file (1996 USGS Open report) in a very roundabout manner, and later found some other more straightforward procedures (but can't figure out how to get those to work with my version of Arc). I'll just post them all here.

1. Official explanation on arc site:  Importing an ArcInfo interchange file

2. Mac person's explanation:
there is a arctool box feature for importing arc/info exchange (.e00) files. Toobox-> Coverage -> Conversion -> To Coverage -> Import exchange files. I was able to unzip the tar file using the Mac Archive Utility.

3. My convoluted method on dumb PC (involving much sighing and swearing):

1. download tar.Z to PC
2. ftp to unix account
3. uncompress and untar in unix

uncompress *.Z
tar -xvf *.tar (I may have left off one of the flags to get it to work)

4. ftp back to PC
5. use Import71.exe (wtf, really) to import the .e00 files to the newer version (see below)

my [source]

Importing .e00 files using Import71.exe, ArcView 9:

a. Before you start, note that this import tool does not deal well with folder paths that have space in their names (e.g., like "My Documents"). Therefore, prior to using this tool, you should create a new folder for that file in your C: drive. E.g., if I was importing a TxDot county file for Williamson County called urban246.e00, I should create a folder called williamson in the c:\temp\ folder, and copy my urban246.e00 file to that folder.

b. Locate the Import71.exe file - it should be in the C:\arcgis\bin\ folder (or use the Windows search tool to find it)

c. Run the Import71.exe file by double-clicking on it - a dialog box should appear

d. Browse to the location of your .e00 file and select that file and its directory path as the input file (e.g., c:\temp\barbara\williamson\urban246.e00)

e. For your output file, simply specify the name you want for the newly imported file (e.g., txdot) - no directory path is needed, the file will import to the same location as the .e00 file

f. Be patient - the import process may take 10 minutes or so. You will know when it is done because a small box saying Import Complete will appear over the Import71 dialog box.

g. After you see the Import Complete notice, start ArcView again and check that the coverage displays properly. A "coverage" is an older GIS data format.

contours

Simple:

Toolbox -> Spatial Analyst Tools -> Surface -> Contour

Specify input raster, output name, contour interval.

Creating contours in spatial analyst

x, y, z table for a bunch of points

This is how I got an xyz table of a bunch of points. (There is probably a better way out there.)

1. Using arc catalog, create a shapefile of points. Then add columns to the attribute table, x, y
2. In arcmap, start an edit session and click away on the points.
3. End and save edit session, I think.
4. Right click on shapefile in Table of Contents column and open Attribute Table. All of the points should be there.
5. Right click on the x column
6. Click Calculate Geometry
7. Choose X coordinate of Point, Use coordinate system of the data source (UTM meters)
8. Repeat with x column and Y coordinate of the Point
9. Use Toolbox -> Spatial analyst Tools -> Extraction -> Extract Values From Points
Input point features (point shapefile)
Input raster (DEM)
Output point features (choose your name)
Click OK
10. This should create a new column in the table. Now you can save the table and export the .dbf if you wish, and do whatever you want with it.

Overview of Extraction tools

aspect-slope map plus other stuff

While hunting around for some guidance in producing a slope map (a matter of a few mouse clicks), I came across this page [aspect-slope map], which is useful because it gave an example of how to implement the following things:

Styles (predefined colors, symbols, map elements, etc.)
Slope map (with link to how it works)
Aspect map
Reclassify: redefine the default number and width of display bins
Map Algebra