Tuesday, September 9, 2014

Applying Patches on ArcGIS Server for Linux (as root)

For various reasons, I had found I needed to be root to install ArcGIS Server on Centos.

I ran into my first problem with that configuration on patching, when the script halts with the following message "You must install this [patch] as ArcGIS Server Owner, do not install it as ROOT user."  I was able to successfully bypass this by commenting out this if block from the patch script (applypatch).

... so far, so good.

Friday, August 15, 2014

ArcGIS Server on Centos, continued

When our cluster was upgraded, I somehow lost the ability to run ArcGIS Server. No problem, I said, I'll just rebuild the machine. This is where I was again reminded that ArcGIS Server installation is very different from other Linux software.

The biggest issue is that ArcGIS installers will only run when logged in root.  Yeah, not running a bash as root, or sudo'ing as root, or su'ing to root ... you actually have to log in as root.

Herein lies the difficulty: the rest of the installer assumes a GUI (e.g., gnome or kde).  You can't login to gnome or kde as root.

If you're doing best practice X tunneling with SSH, then you're using private/public keys.  So make sure that you create a .ssh profile with keys and copy over the authorized_keys directory from your normal user.  I think this is where my immediate stumbling block was: when I first did this I wasn't thinking as much about security, just seeing if it would work.  I didn't use keys.  When I rebuilt the system, I did ... and of course I disabled plaintext passwords.  I didn't even consider that I'd want to login as root through X/SSH, but I'd guarantee that's how I did it the first time.  This was also an issue with X, specifically, because X settings (e.g., $DISPLAY) would only be set for the logged in connection (my normal login) and not root, if not connected directly with root.

[root@host]# ssh-keygen
[root@host]# cd .ssh/authorized_keys .

Finally, of course, everything ArcGIS runs through Wine on Linux (the Windows compatibility layer).  It turned out there was a profile directory that was owned by another use

# chown -R root /root/arcgis/server/framework/runtime/.wine

Also two other things I found out during this process:

  1. set is a great command for debugging.  I put set -x at the top of authorizeSoftware and this gave me all kinds of great diagnostic info, including THE LOCATION OF THE LOGS!!
  2. the software authorization log was located under: /root/arcgis/server/.Setup/softwareauthorization.log
Thanks, Dean Nairn!

Wednesday, July 30, 2014

Undocumented KML Output Conversion, GDAL

As noted here: http://gis.stackexchange.com/questions/18280/batch-convert-geotiffs-to-kmz-files, an undocumented method for conversion to KML exists in GDAL's gdal_translate as format KMLSUPEROVERLAY.  To do this with an existing image, such as a geotiff, your command will be the following format (on Windows):

C:\OSGeo4W64>gdal_translate -of KMLSUPEROVERLAY   FORMAT=JPEG

with an example path, this looks like:

C:\OSGeo4W64>gdal_translate -of KMLSUPEROVERLAY D:\downloads\tile177_12orthos\177.tif D:\downloads\tile177_12orthos\177.kml -co FORMAT=JPEG

This will output a tiled images with a KML to tie them all together.

Monday, July 14, 2014

Disk I/O Error on sqlite/spatialite

On running sqlite CREATE and INSERT queries, I was getting some mysterious errors, like "Error: disk I/O error", despite having the proper permissions on the .sqlite file and adequate space in the directory.  I then broke down the compound query to a simple query and was getting "GEOS error: IllegalArgumentException: Points of LinearRing do not form a closed linestring", though I found that doing Hex(PolygonFromText(...)) did return a hex string.  My WKT was, however, poorly formed.  WKT requires that the final coordinate pair and the beginning coordinate pair are the same, as in  PolyFromText('POLYGON((-75.8 38.4, -75.0 38.4, -75.0 39.85, -75.8 39.85))',4236).  After I fixed that, my more complex queries were able to run successfully.

Tuesday, July 8, 2014

github push 403 and Permission denied

Initially I was getting

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/..


$ git push origin master

I read a forum post that recommended

$ vi .git/config

and changing the url line from https://github.com/.. to ssh://github.com/..

and then generating public/private keys and adding this to github.  After doing so I was getting

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

eventually I solve this by changing that url line in .git/config to

url = git@github.com:LOGIN/REPONAME.git

... I also made sure to run

git config --global user.name "LOGIN"
git config --global user.email EMAIL

Tuesday, June 10, 2014

Quick GIS tip of the day, 6/10/14

To keep symbology of a shapefile or geodatabase feature class, save a layer as a "layer file" (.lyr).  If you keep this .lyr file in the same relative path location (in the same directory, for instance), it should continue to reference the data and you can just add the .lyr instead of the data itself.  If the data and lyr become seperated you can apply the lyr to the data through the symbology tab.  I've included some images to illustrate.

Thursday, April 3, 2014

RWD Summit 2014

Here are some notes and thoughts I gathered during the 3-day Responsive Design Summit, which concluded today.  Link to the live document.
  • Design principals
    • Atomic design
      • Stop thinking about websites as collections of pages.  They are collections of elements that, through a browser-based, collaborative, design process, that are mixed together into larger and larger collections.  This new paradigm is helpful when doing responsive design, since “a page” is different across different screen sizes.  You can start at the level of meaningful/reused DOM elements, disregarding content and style in conceptions, but adding the style and sometimes content (images?), when creating style tiles, style guides, and pattern libraries (public-facing example)
      • Pattern lab is a tool created for doing atomic design.  It emphasizes browser-based design/decisions, going to the browser first instead of wireframing etc., producing the style tile/guide/and pattern libraries, producing clear annotation from code comments, and allowing naaive (non-programmer) changes within a template-like structure through JSON, using mustache
    • Design/decide on the browser.  Avoid other deliverables and get the discussion immediately to the browser
      • Test with content (not lorem ipsum)
      • Wireframes can be bad … if you need to use wireframe, make it a part of your iterative, browser-based design process
      •  Your own collection of “templates”, “starter kits”, etc. also help with this
    • Test and develop locally
      • Many elements of the workflow below are tuned to this (e.g., scaffolder, package/dependency manager, task runner, versioning, etc.)
      • Vagrant can be useful for reproducing lower level environments (OS, etc.) although it’s not clear if this should be used over the scaffolder, etc. … or if these complementary
      • Supports browser-based design
      • Workflow supports collaborative coding
    • Performance
      • Test your site performance
      • Wireless network experience will not be improving anytime soon.  This is due to the effect of latency (not bandwidth).  International visitors will also be much more sensitive to site site.  Some things to help
        • Use Compression (whitespace)
        • Good syntax
        • Keep presentation in CSS (which is cached for the entire site)
        • Small as possible
  • Responsive
    • Can no longer use a limited set of breakpoints, use em’s and use additional self-set breakpoints … breakpoints relative to font size?
    • These other principals support responsive design … for example: browser based!  Overlap in Designer/UX/Dev process and roles.
    • Frameworks: the two frameworks below responsive user interface elements.  Both come as standard web browser syntax files (html, javascript, css)
      • Foundation: seems to provide a richer set of elements, which can be selected (or not) via the web interface when first downloading the code to add to the project.
      • Bootstrap:
  • Workflow (video which was mentioned: https://www.youtube.com/watch?v=vsTrAfJFLXI)
    • Scaffolding: yeoman
      • Produces the initial code for particular kinds of projects
      • Integrates a Package manager (bower) and a task runner: grunt (good “why grunt”).  Many “generators” provided to scaffold various projects.  Installs and runs through node package manager/nodejs
    • Know your text editor: Sublime Text 2 is popular
    • Versioning: git (github has a friendly client app and is on the cloud)
    • Preprocessors (see below)
    • Deployment: beanstalk (versioning plus deployment)
  • Preprocessors
    • Notes
      • it is important to consider how you will run these.  Many run through Ruby or Node by default, but have other options (Python, PHP, PHP, etc.).  Ruby is installed by default on Mac and is trivial to install on Windows.  Node seems trivial to install on either platform, as well.
      • A simper way to run these preprocessors, as well as some other workflow tools, would be through the standalones: codekit (Mac) or prepros (Windows)
      • Cloud-based tool here, with many different preprocessors http://codepen.io/pen/
    • HTML
      • HAML: runs on ruby.  Sparse syntax which generates complete, well formed, xhtml
      • Mustache: use for html includes, fed through JSON.  Preprocessor available on many platforms.
    • CSS:
      • SASS: CSS preprocessor syntax adding mixins (css snippets), media queries, indents, variables, functions,
        • Many github repos offer useful mixins.  For example: Team-Saas, but these sometimes rely on ruby
        • Team Sass provides a few prominent projects/tools … rely on ruby … not supported directly on codekit or prepros
          • Breakpoint: for responsive, multiple screensizes
          • Toolkit … responsive stuff?
          • Singularity … layouts!
      • SCSS: A more CSS-like version of the SASS syntax, does not require indents … actually this is now the default in SASS at version 3
      • Compass: a tool which provides many common mixins, some of which provide cross browser support.  Run for free on ruby or install as a standalone compass.app .. scout is a free standalone version.
    •  Javascript
      • Coffeescript