ArcGIS Tabulate Area Error

Several times I’ve run into an error trying to run the Tabulate Area (Spatial Analyst) tool in ArcGIS.  [I know, I know… I’m more of an open source person, but you gotta use what they’ll let you have at work.]  The error code it gives is “Error 999999 : Error executing function.”  Great.  Cuz that’s helpful.  Here are some things to check.

  1. Did you put the right layers into each input field or should the be switched?  The order matters.  The one with “zone” in the description needs to have the shapefile or raster that defines the zones you want to use.
  2. Does the attribute information you are trying to use have spaces (or special characters like commas)?  Yeah, that doesn’t work.

Now, I don’t promise that one of these is going to solve your problem, but it’s at least something to look into, which Arc doesn’t give you.  I hope someone finds this helpful.  It was intended more as a note for me, since I’ve run into and troubleshot this problem more than once this year not remembering the solution.  That’s what blogs are for!

Spatially Enabled Zotero Database

As a geographer, I’m a visual person.  I like to see distributions on a map and where things are matters to me.  A few years ago, while I was writing a paper I became overwhelmed with trying to remember the locations for the studies I had read (for coastal plants, latitude matters), so I started marking the locations of studies on a map and eventually turned it into a printed map.


But adding new studies and sharing the results is a cumbersome and the spatial data is largely separate from the citation information.  So I set out to find a way to store spatial information in my citation database and access the spatial information for mapping purposes.  The end result (which is still a work in progress at press time) is a web map of coastal vegetation literature that updates when new citations are added to my Zotero database online.


How I Did It:

Key ingredients: Zotero, QGIS, Spatialite, Zotero Online Account

I started working with the Zotero database I already have populated with literature relevant to my research on coastal vegetation.  I moved citations that I wanted to map into a separate folder just to make the API queries easier later.  I made a point in a shapefile for the location of each study using QGIS.  I gave the attribute table fields for the in-text citation and a text description of the location for human-readability, but the most important field is the ZoteroKey.  This is the item key that uniquely identifies each record in the Zotero database.  To find the key for each citation, in your local version of Zotero, right click on the record and pick “generate report”.  The text for the key is after the underscore in the URL for the report.  In the online version, click the citation in your list.  The key is at the end of the URL in the page that opens.


My map only has point geometries right now, but that will change in the coming weeks.

The spatial information was then to be added to the Zotero database (specific queries can be found on GitHub) in Spatialite.  The Zotero schema is quite large but not impossible to navigate.  Currently, there is no option to add your own fields to Zotero (I tried… I failed… they tell me the option is coming soon) so I put my geometries into the “Extra” field.  Using Spatialite, I opened the Zotero database and imported my shapefile of citation locations (having new tables doesn’t break the database, thank goodness).  Then I removed any existing information in the “Extra” field and filled it in with geometry information in the style of geoJSON.  The string looks like this:

{"type": "Point", "coordinates": [-123.069403678033, 38.3159528822055]}

After updating the citation records to house the geometries, I synced the changes to my online Zotero repository from my desktop program.  Now it’s ready to go into a web map using the Zotero API.  My webmap code can be found in my GitHub Repository.

What’s Next?

I would like to develop a plug-in for QGIS that makes adding the geometries to the Zotero database easier because not everyone wants to run SQL queries on their active citation database that has been years in the making (I backed mine up first!).  The interface would show the citations you want to map, then users would pick a citation, then click the location on their QGIS project where the citations should be located.  The plug-in would insert the corresponding geometry for them.

Getting Started with LaTeX

I’ve been thinking for a while that I would like to learn how to use LaTeX.  Aside from being something that geeky types seem to love, it makes documents that look beautiful.  It actually looks easier than getting Word or LibreOffice to behave in predictable ways beyond simple text.  So why am I finally learning how to use this?  I want to submit an article to a journal and they require all submissions be in LaTeX format.  (As an aside, why did they have to make the capitalization of LaTeX so odd?  It’s hard to type!)  I thought I would post some notes on tools I found useful for learning.


You need both a LaTeX engine and an editor.  I installed MikTex as the engine and TexMaker for the editor.


Michelle Krummel has a multi-part video tutorial on YouTube that moves at a good pace (not too fast or slow).  She teaches all the basics you need to understand how to set up a document and how formatting works.  Even though it’s specifically geared towards mathematics, the concepts all apply to what you would need for other sciences as well.

Cheat Sheets

Winston Chang wrote an excellent cheat sheet to remind you of the basic formatting you’ll need.

When ImpactStory Won’t Update

I just started using ImpactStory to track my impact in the world of Academia.  The site is beautifully simple.  And when it works, it’s fantastic.  Occasionally though (I’ve been doing this less than 24 hours, but still) something goes wrong and finding help is almost impossible, given the simple nature of the site (just add a help page with commonly asked help questions, please!).

For example, what do you do when you upload something to a linked account (FigShare, SlideShare, etc.) but ImpactStory doesn’t update?  Now is when you make use of that “Import individual products” link.  Pay careful attention.  On the right side, the graphic tells you what you can put in the box and it’s not the same for all the sites.

Some platforms work with URLs (the link you use to get to the page) for the item.  That’s easy.

But some – CrossRef, Dryad, FigShare – work with the DOI assigned to the item.  PubMed uses an article ID called a PMID.  For the platforms that use DOIs or PMIDs, leave out the URL and just input the DOI or PMID.  They can be found on the page that contains details for the item you want to add to ImpactStory.  If you try to give it the whole URL, it doesn’t work the way you want it to… trust me.

Batch Editing Text in Inkscape

(Sarcasm!) Thanks, R & Inkscape!  I totally wanted to mark my outliers with the letter q!

(Sarcasm!) Thanks, R & Inkscape! I totally wanted to mark my outliers with the letter q!

Have you ever opened a PDF of a graph made in R in Inkscape?  For some reason, it appears that my graphs are made with characters from the Dingbats font, which I guess Inkscape doesn’t like, so when I open the file in Inkscape, it changes all of my nice circles to the letter q.  That’s awesome.  How do you fix that?  Inkscape doesn’t let you batch change the text inside a textbox, as far as I can tell.  So, here’s one way to fix it:

  1. Open the PDF file in Inkscape and save it as an SVG file.  Yes, you’ve now got qs instead of os.  It will be ok.
  2. Close the file.
  3. Open the SVG in a text editor (I like Notepad++).
  4. Do a Find & Replace, finding “q” and replacing with “o”.  I recommend reviewing each instance it finds rather than using “replace all”, because one of those qs might be something else.  Here’s the general kind of text you’re looking for: id=”tspan4049″>q</tspan></text> See that q?  Change it to a o.
  5. Save the files and close.
  6. Open it up in Inkscape and see what you’ve got.

If anyone has a more elegant way to do this, let me know!  I’m sure there’s a way to change the R output from the start so you don’t have this problem, but this solution was quicker than messing with R for now.

All fixed!

All fixed!

Plant Eyeballs

plant_eyeballsPlants need eyes, right?  Maybe not.  But these floppy heaps of native grasses that my HOA planted in front of my house needed something, especially for Halloween.  Giving your plant eyes is easy.  These were made out of ping-pong balls (with circles drawn on with permanent marker) hot glued to wooden skewers.  You just stick the skewers in the ground and you’re good to go.  If you had a shrub, you could glue a loop of string instead of the skewer and hang them on a branch like Christmas ornaments.  I have been contemplating how to make teeth for my little grass buddies next, you know, just to make sure the neighbors really question my sanity.

Marxan Table Relationships


Marxan is confusing.  There’s lots of pages of documentation and tutorials, but as a visual learner, all that text makes my head spin.  I find myself drawing pictures once I understand what’s going on so I can refer to them later.  The diagram above is a cleaned up, attractive, and cheerful rendition of the diagram I drew for myself on the whiteboard in my office (thank you, Inkscape, for having way more colors than I have for whiteboard markers).  The idea is taken from database diagrams.  The bold text is the table name and I put the recommended file name under it for easy reference.  The list beneath this is the column names for each file.  The lines connect columns with data that match (primary keys and whatnot).  So there you have it.  Maybe later I’ll post a new version with more notes about each file.  Let me know if that would be helpful.


Get every new post delivered to your Inbox.

Join 444 other followers