Archive for June, 2011

Unable to delete representations – Problem solved

What I wanted to do

Test Representation in ArcGIS

What I have

  • Oracle 11g
  • ArcSDE 9.3
  • ArcGIS for Desktop (according to recent ESRI product naming announcement)


Here is what happened:

I was learning how to use representation. So I created a representation on a feature class in my SDE database on Oracle. Once the representation is created, in ArcCatalog I looked into the attribute table of the feature class and saw two columns: ruleID and override. I right clicked on the columns and delete them. And then I went to the properties of the feature class and delete the representation from Representation tab.

Now annoying things happened: I restart ArcCatalog and open the properties of the feature class, navigate to Representation, nothing shows up in the list, which is normal because I created and then deleted the representation. But if I click new and create a new representation, the one that had been created and deleted would show up together with the new representation in the list. If I select the ghost representation and try to delete it, I get the Unable to delete representation notice. What’s worse is that this ghost now shows up in all OTHER feature classes representations tab and I can’t get rid of it! Even if I remove this feature class the ghost representation is still there.


I haven’t seen similar issues posted on the Internet but the solutions to  many representation issues involve do something about an Oracle system table named SDE.GDB_ExtentsionDatasets. So I looked into this table in Oracle and found the dead body of that representation ghost. After removing the record, the ghost went away!


Wrap data around 180 longitude with ArcGIS Server and JavaScript API

What I wanted to do

I have data extends across 180 longitude. When I build a web map out of the data, I want it to be wrapped around 180 so that I can pan the map across 180. To achieve that, according to samples in ArcGIS JavaScript API 2.3, I need dynamic map service published by ArcGIS Server 10 and add “wrapAround180:true” to the options of esri.Map.

What I have

  • Shapefile
  • ArcGIS 10
  • ArcGIS Server 10


First of all, what is dynamic map service? My understanding of dynamic map service after reading Publish Map Service in ArcGIS 10 Desktop Help is that as long as the map service is not cached, it is dynamic map service. So I followed the steps listed in the help to publish my data as a map service with WMS, with caching set to “Draw this map service dynamically” in the service setting in ArcGIS Server. Then in the web map that I built with ArcGIS JavaScript API, I set the map to wrap around 180 (var map = new esri.Map(“MyMapID”, {wrapAround180:true})) and created a layer consuming the WMS (var wmsLayer = new esri.layers.WMSLayer(“the WMS layer”)).

It didn’t work. The map was still cut off at 180.

After some internet research, I found out that to make the wrap around 180 work, I need to create a ArcGISDynamicMapServiceLayer and the layer has to consume a REST service. So now the question became how to create a REST service.  According to ArcGIS Server REST API, to find out the REST services on my ArcGIS Server, I used http://<host&gt;:8399/arcgis/rest. My data was not there, even through I have published my data as map service. After talking to someone who have experience with REST service, I found out that the problem is related to REST service caching. On my ArcGIS Server, the caching has to be cleared manually, which is why my data didn’t show up in the REST service directory. To manage the REST service, I used http://<host>:8399/arcgis/rest/admin. Once the cache is cleared manually, my data showed up.

Now, instead of a WMS layer, I create a dynamic map service layer in my web map (var restLayer = new esri.layers.ArcGISDynamicMapServiceLayer(“http://<host&gt;:8399/arcgis/rest/services/MyData”)) and guess what, my data goes across 180 now!

How Google Fusion Table made my life MUCH easier

Google Fusion Table is still in Beta. But it’s powerful! There are so many things you can do with Google Fusion Table and as far as I am concerned it has THE potential in many ways to redefine how GIS professionals mange and publish GIS data.  I am going to give you one little example to demonstrate that and show you how it made my life much easier.

What I wanted to do

Build a web map that consumes my GIS data. I wanted user be able to click on the feature on web map to get attributes of the selected feature

What I have

  • My GIS data in ESRI Shapefile
  • WMS of my data served out by GeoServer
  • Email from my department telling me that ArcGIS Server is too expensive to purchase


I built a web map with OpenLayers, and Google Map as background. It consumes WMS served out by GeoServer. When user clicks on the feature on web map, the attributes of clicked feature are displayed on the webpage below the map. This seems to be fine. But:

  1. A proxy to handle cross-site scripting problem was introduced into this web map so that when user clicks on the feature, the attributes actually show up. This is a known security risk and even though the proxy mechanism works in a test environment, my organization won’t allow this proxy thing to happen when the web page goes public
  2. I spent lots of effort to program OpenLayers, Google map, WMS and the CGI for proxy on my web page so that they work well together but in the end all these efforts are wasted because of the security risk


I tried Google Fusion Table and its a perfect way to work with in my situation.  Google Fusion Table allows you to do the following cool things:

  1. Upload spatial data in KML format
  2. Plot uploaded spatial data on Google Map
  3. When clicking on the spatial data on Google Map, you get popup of the attributes

So I use ArcGIS to convert my shapefile into KML and upload the KML into a fusion table. Once my data is in a fusion table, I clicked on Visualize -> Map to get a Google Map view.  On top of the Google Map, I can “Get embeddable link” of my data in a Google Map view. Then I use this link on my web page for the web map. See the bottom of this post for how my data looks like. Just in case you haven’t realize the huge benefit of using Google Fusion Table in my situation:

  • I don’t need a sever
  • I don’t need to program OpenLayers and WMS etc.
  • I don’t need to worry about cross site scripting security risk. Speaking of security risk, my data is not sensitive so I have no concern of data security

I highly recommend anyone who works in professional GIS arena try Google Fusion Table. It is definitely redefining how we publishing and sharing GIS data.