Friday, 10 August 2012

PostGIS and NAD27 coordinate transformations gotcha

I have not yet seen any PostGIS documentation explaining details of NAD27 transformation.
This is a hughe PostGIS pitfall so keep reading!

PostGIS relies on Proj4 library to perform coordinate transformations.
Accurate data transformation to and from North American Datum 1927 (NAD27) requires an appropriate datum grid shift file. Datum grid shift files usually are not part of standard proj4 library, on Linux freely distributable grid files are usually part of package proj-data or proj-nad depending on platform.
The problem is that PostGIS does not use files from the common proj4 data folder (on Ubuntu  /usr/share/proj).
A copy of all shift files must be placed in $POSTGRES_HOME/contrib/postgis/proj folder.
You can also find download links to additional grid shift files for various countries on proj4 website: http://trac.osgeo.org/proj/

This is a hughe pitfall because PostGIS will give no warning about missing grid files, function ST_Transform() will silently fall back to using much simpler calculations and therefore introduce transformation inaccuracies. If you are working with surveying data then this is crucial!

As soon as grid files are placed in proj folder PostGIS will quietly start taking advantage of them. Some tweaking might be required if you are working with other country datums. Here is some basic explanation of how Proj4 nadgrids work:
http://trac.osgeo.org/proj/wiki/GenParms#nadgrids-GridBasedDatumAdjustments


Ubuntu Quirks

Default Keyboard Layout

I had installed Latvian keyboard and my Ubuntu/Kubuntu and could not revert to English (UK) no matter what I did. Terminals like Alt-F2 would still be running Latvian locale. This command helped me to wipe out original settings and reinstall keyboard layout:
sudo dpkg-reconfigure keyboard-configuration

Overlay Scrollbars

I hate overlay scrollbars which were introduced in Ubuntu 11.04. Gmail has them. They are just silly. They are invisible when inactive and if you have a long document it's very difficult to hit the scrollbar right. So much pissing around just to scroll something! This command helped me to roll back to classic scrollbar:

sudo echo "export LIBOVERLAY_SCROLLBAR=0">/etc/X11/Xsession.d/80overlayscrollbars

Wednesday, 8 August 2012

Skincare for climbers

My friend recently asked me a question:
"What is you suggestion for skin pain in climbing? Every time I climb, my finger skin get scaly and brittle so that it starts to become unbearable to keep a hold for longer than a couple of seconds. I always have to stop climbing because of this shit and not because I'm pumped or tired."

Here is what you can do...

Making your finger skin tough

You will have to gradually grow and toughen your finger skin by climbing regularly for 2 to 4 weeks. This requires 2-4 sessions per week. 
During this time you should spend most of the time on easy-ish problems. This is about getting some mileage under your belt. Therefore climbing routes would be the best but short and frequent boulder sessions will do too.
At the end of this period you will acquire essential calluses and your fingertips will desensitize and therefore will be more resistant to pain.

During the session

If you want your skin to last and become tougher then do plenty of easy (for you) problems with varied holds.
Certainly warm up, get your fingers warm before doing hard stuff. Warm fingers are essential for feeling the holds better and applying just the right amount of force.
If your fingertips are sore then try climbing problems with slopers or pinches, simply avoid fingery and sharp stuff. Choose different style problem that does not hurt and work on mileage, endurance or something else.
Try to take holds as static and accurate as you can, be smooth and fluid. Let your body and muscle do the work, not the fingers! Don't slap for holds and avoid sliding off. Try not to overgrip or overcrimp holds!

When pain has arrived and is almost unbearable

Instead of doing long problems you can move on to working one particular hard move that might not be hard on fingers but imposes different kind of challenge (splits, core strength, balance etc).

Take care and stay healthy

Always stop climbing before you damage your fingertips permanently. Watch out for those red spots on your fingertips, that's a bad sign! Stop right there.
Use "Climb On" and/or some nourishing hand cream after the climb.
Buy and drink fish oil capsules - those help your nails/hair and skin to grow.

Maintenance

Don't forget to climb at least 2 times a week to maintain thickness and in-sensitiveness of your finger skin!


Good luck my friend!