Archive for May, 2011

Manually Register Oracle Spatial Tables with ArcSDE – Filling the missing pieces

ESRI has a technical article talks about how to manually register Oracle Spatial tables with ArcSDE. But even if your data meets all the criteria, there is no guarantee that the registration would be successful. In fact, after following this article and several instructions on the Internet, I found that you will need to do more than meeting these criteria to make successful registration.

What I wanted to do

Register Oracle Spatial table with ArcSDE

What I have

Oracle table with SDO_GEOMETRY column


  1. Meet all criteria listed in ESRI’s technical article
  2. You MUST build spatial index for the table. Without the spatial index, the registered table will not draw in ArcMap or ArcCatalog
  3. The following parameters MUST be specified in sdelayer -o register:  -t, -P and -x. Watch out for -x. The first two parameters of -x have to cover the minimum extent of your data. Otherwise, the registered table will not draw
Here is the sde command that I used to register Oracle Spatial table:
sdelayer -o register -u <User> -p <Password> -s <Database Server> -l test_table,SHAPE -e l -C UNQ_ID -t SDO_GEOMETRY -S “Test” -P HIGH -x -400,-400,1000000000,0.000000008983153

Create Complex Line Style with GeoServer 2.x

GeoServer recently released 2.1.0. Among all the impressive improvements, I found line styling improvements most helpful for me. Prior to 2.x, there is nothing you can do but scratching your head when it comes to creating line style of alternating symbols, not to mention using custom smybol in the alternating symbols line style. 2.x is a dream comes true for me.

What I wanted to do:

Create a line style with alternating plus and minus sign and a fish symbol. Like this:

What I have:


To create a line style like that, I need a “+” symbol, a “-” symbol, and a fish symbol. For “+” symbol, I use well known name “Cross”. For “-” symbol, there is no well know name symbol so I use dash line instead to create the effect of “- – – “. and “-” symbol. For fish symbol, I have two source options: create my own or snapshot one from an existing image using any software that can clip an image. I also need to choose a graphic format to store the fish symbol. I decided to go with SVG instead of raster-based format such as JPEG and PNG because JPEG or PNG image might be resampled when you specify a pixel size of the image in the SLD that is different from the image’s original size. The resampling made the image look really ugly on map. Here is what I did to create the sytle:

  1. Create a fish symbol using Online Paint
  2. In SLD, set a FeatureTypeStyle with two LineSymbolizer. One line symbolizer with “+” and make it dashed graphic stroke. Set another line symbolizer with just stroke and make it dashed, which create a style of “- – – -“.  Combining this two symbolizers together gives me something look like “+-+-+-+-“
  3. Set another FeatureTypeStyle with  line symbolizer of external graphic. The external graphic is the fish symbol created in step 1. Make the line dashed so that the fish appears on the line every few pixels
  4. Apply the SLD to the line layer in GeoServer
  5. Played with the numbers in SLD (width, dasharray and dashoffset) for a while to get the best symbol size, line weight and interval between symbols

Here is the SLD code example: LineStyleSLD

Note: GeoServer 2.x allows user to create marks with True Type Font (TTF). But watch out if your testing operating system is different from your operational operating system. When you test in Windows environment, TTF is accessible. But then when you move the tested SLD to GeoServer running on Linux, the marks defined in TTF probably won’t show up because the TTF is not installed on Linux.

Make GetFeatureInfo work for WMS map

What I wanted to do:

  • Create a webpage with map using OpenLayers. The map consumes a WMS from my GeoServer
  • Get attributes of the data when I click on a feature on the map. The attributes will be displayed under the map in a table

What I have:


  • I followed examples of GetFeatureInfo to create WMS overlay on Google map using OpenLayers. It worked well. But nothing showed up when I click feature on the map: GetFeatureInfo didn’t work


The problem is due to JavaScript’s security restriction on cross site XMLHttpRequest (See ProxyHost section in To solve this problem, I need a proxy to bypass this restriction. To follow “How do I setup ProxyHost?” in the FAQ and some other Q&As on the internet, I did the following:

  • Install Apache HTTP server on my PC
  • Get proxy.cgi from
  • Change python path on the top line of proxy.cgi to my python executable (#!C:/Python26/ArcGIS10.0/python.exe -u;)
  • Add ‘localhost:8080’ in allowedHosts in proxy.cgi. This allows the proxy to work for GeoServer
  • Copy proxy.cgi to /cgi-bin under Apache folder on my PC
  • Start up Apache
  • To test the proxy.cgi, I ran http://localhost/cgi-bin/proxy.cgi, which redirected me to the homepage of
  • Copy my webpage Test.html to /htdocs under Apache folder (where I pretend I am going to serve out my webpage)
  • Add OpenLayers.ProxyHost = “/cgi-bin/proxy.cgi?url=”; on the webpage
  • Start up GeoServer
  • run the webpage from localhost/Test.html
It worked!
Categories: Web GIS Tags: , ,