發表文章

目前顯示的是 3月, 2013的文章

手動安裝PostgresSQL and PostGIS on Windows Server

最近安裝PostgresSQL在 Windows Server 時遇到一種狀況 就是用intaller一直無法安裝 所以乾脆就採取手動安裝 先到官網指定網誌下載zip檔案 ( http://www.enterprisedb.com/products-services-training/pgbindownload ) 下載後放到你想放的資料夾 先指定data資料夾(可自行建立指定),可參考下列網址 http://www.petrikainulainen.net/programming/tips-and-tricks/installing-postgresql-9-1-to-windows-7-from-the-binary-zip-distribution/ initdb -U postgres -A password -E utf8 -W -D POSTGRESQL_ROOT\data 註冊Windows Service參考下列討論 http://stackoverflow.com/questions/14484652/register-and-run-postgresql-9-0-as-windows-service pg_ctl.exe register -N postgres -U some_windows_username -P windows_password -D "D:/Program Files/PostgreSQL/9.0.4/db_data" ... 至於PostGIS就懶得自己安裝了 下載安裝檔 http://download.osgeo.org/postgis/windows/pg84/

PGRouting找最近點與最近的線

在PostGIS裏頭要做Routing當然就是用pgRouting 提供一系列的function來做routing 但在做routing的時候總不可能都是由路網上面的點或線當作起始點(線) 因次需要找到最近的點或線來當作routing的起始點 原本都要自己下sql找到最近的起始點或線 有人其實已經整理出來方便的做法 http://underdark.wordpress.com/2011/10/11/a-look-at-pgrouting-find_node_by_nearest_link_within_distance/ 感謝大大無私分享

PostgresSQL 9.1 byte array 變兩倍大

原本將圖示存到PostgresSQL 用Jdbc讀出來後發現byte [] 的length變成兩倍大 http://stackoverflow.com/questions/6181524/getting-nearly-double-the-length-when-reading-byte-from-postgres-with-jpa 結果原來是jdbc driver更新就好了 因為原本是PostgresSQL 8.x,太久沒更新driver了 有空真的要記得常更新 要不然一次更新很多,問題也會很多

Tomcat Crash with Geoserver

Geoserver發佈在windows server上常常有問題 有的時候換個JVM版本就沒問題,有的時候JVM用32bit就OK,有的時候JRE要用JDK裡面的JRE才沒問題... 最近發佈上遇到一個狀況,網路上查了一下似乎是老問題,但也不知道為什麼有的機器上不會遇到,log的紀錄如下 # # A fatal error has been detected by the Java Runtime Environment: # #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800057b2, pid=7836, tid=6024 # # JRE version: 6.0_35-b10 # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode windows-amd64 compressed oops) # Problematic frame: # C  [tcnative-1.dll+0x57b2] # # An error report file with more information is saved as: # D:\apache-tomcat-7.0.37_80_tomcat\bin\hs_err_pid7836.log # # If you would like to submit a bug report, please visit: #   http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # 目前是根據 http://osgeo-org.1560.n6.nabble.com/Geoserver-crashes-td3804238.html 將 /bin下的tcnative-1.dll拿掉解決,感謝上帝~~

Virtual Box 安裝 Asterisk Now 記事

說明 在vm上安裝asterisk now 有實體IP 機器設定local ip放在nat後面 Virtual Box安裝 VM選則 linux -> other 來安裝 中間會卡住在下面訊息的地方 NET: Registered protocol family 2 要去主機板設定把 Enable IO APIC 給打勾才行 網路設定 設定為Bridge綁定網卡 Cent OS 帳號root 密碼your_passwrod Nat設定 UDP/5060 -> Forward to 192.168.x.x UDP/10001-20000 -> Forward to 192.168.x.x FreePBX設定 到/etc/asterisk nano sip_nat.conf 設定(參考 http://blog.iwayvietnam.com/tuanta/2010/03/10/howto-setup-asteriskfreepbx-behind-nat ) externip=24.72.182.16 localnet=192.168.1.0/255.255.255.0