By Rupert
Uncategorized
TileCache: Getting Cutoff on the edges
Oct 24th
In Tilecache, metaTiling creates larger tiles and chops them up.
Note the difference between using metatile=yes and metatile=no.

Figure 1: metatile=no

Figure 2: metatile=yes
ColdFusion Fonts
Oct 8th
I was trying to make a chinese text drawn in an image. That worked flawlessly on my Mac. Upon svn updating my files in production, the characters in the image became squares again.

First hunch was to change my file.encoding as from my previous post. But didn’t helped, so I changed the font from the CF code itself..
<cfset attr = StructNew() /> <cfset attr.size = 16 /> <cfset attr.style = "plain" /> <cfset attr.font = "microsoft yahei" />
I noticed that using the obvious fonts (Arial, Tahoma) didn’t worked. It always complained it can’t find the font…

I remember using msyh.ttf (Microsoft Yahei) in Mapserver for producing Chinese text. So what I did was, I copied msyh.ttf and dropped it in the coldfusion fonts directory (/opt/coldfusion8/runtime/jre/lib/fonts) then restarted coldfusion. Afterwards, I was able to see msyh.ttf from the Font Management of CFIDE Administrator. From there… I was able to display the image with Chinese Characters..

How to make Oracle start on boot
Sep 22nd
1. Login as root and edit /etc/oratab to reflect “Y”
orcl:/opt/oracle/product/11.1.0/db_1:Y
2. oracle startup script:
#!/bin/bash # # oracle Init file for starting and stopping # Oracle Database. Script is valid for 10g and 11g versions. # # chkconfig: 35 80 30 # description: Oracle Database startup script # Source function library. . /etc/rc.d/init.d/functions ORACLE_OWNER="oracle" ORACLE_HOME="/opt/oracle/product/11.1.0/db_1" case "$1" in start) echo -n $"Starting Oracle DB:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" echo "OK" ;; stop) echo -n $"Stopping Oracle DB:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop" echo "OK" ;; *) echo $"Usage: $0 {start|stop}" esac
3. Oracle EMCTL
#!/bin/bash # # oraemctl Starting and stopping Oracle Enterprise Manager Database Control. # Script is valid for 10g and 11g versions. # # chkconfig: 35 80 30 # description: Enterprise Manager DB Control startup script # Source function library. . /etc/rc.d/init.d/functions ORACLE_OWNER="oracle" ORACLE_HOME="/opt/oracle/product/11.1.0/db_1" case "$1" in start) echo -n $"Starting Oracle EM DB Console:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole" echo "OK" ;; stop) echo -n $"Stopping Oracle EM DB Console:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole" echo "OK" ;; *) echo $"Usage: $0 {start|stop}" esac
4. chkconfig –add /etc/init.d/oracle
5. chkconfig –add /etc/init.d/oraemctl
Recaching single tiles in Tilecache
Sep 22nd
Got this one from IRC this morning.. In order to recache single tiles in TC, as long as it is not metatile (metatile=false), then we can simply append “FORCE=1″ in the URL..
http://192.168.2.14/tilecache/tilecache.py?FORCE=1&LAYERS=beijing_900913_wide_en&MAP=%2Fmyhome%2Fmap%2Fbeijing%2Fnew%2Fbeijing_900913_wide_en%2Fbeijing.map&FORMAT=jpg&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=12951949.03168994,4852222.893873828,12952101.905746482,4852375.767930372&WIDTH=256&HEIGHT=256

Well for completeness, I gave my ofcmate a DELETE tool which wipes out everything in the /tilecache/map_dir directory..
Transform 900913 to 4326
Sep 4th
Stumbled upon an error in reprojecting data from 900913 (Google Speherical Mercator) to 4326 (WGS84). I’m recalling this from my head now, the error was something related to “NAD sth”. Workaround was to convert it as follows:
1. 900913
2. 32650 (UTM for your area)
3. 4326
I’ll get the SQL from my ofcmate and paste it here…
Comments