Once I loaded PostgreSQL and enabled the PostGIS support, I simply change the default geometry storage type in my DBTUNE table to "PG_GEOMETRY". Then I copied/pasted my sample dataset into PostGIS using ArcCatalog. My sample dataset is a "small" electric utility dataset, with approximately 120,000 primary_oh lines, and 60,000 transformers. The copy/paste went off without a hitch, and I have a very usable dataset in PostGIS. Now, let's see what we can do in a command prompt with our coordinates:
sde=# select st_astext(shape) from primary_oh
sde-# where objectid = 856253;
st_astext
-------------------------------------------------
LINESTRING(1012108.7600746 1045855.35055982,
1012173.61937546 1045822.20342262,
1012230.98826477 1045792.88789014)
(1 row)
Cool, I can get the coordinates. Now, for even more fun. Let's find if there are any Transformers attached to that piece of Primary_OH:
sde=# select objectid, st_astext(shape) from transformer
sde-# where st_intersects(transformer.shape, (select
sde(# shape from primary_oh where objectid = 856253));
objectid | st_astext
---------+------------------------------------------
529532 | POINT(1012108.7600746 1045855.35055982)
479413 | POINT(1012230.98826477 1045792.88789014)
(2 rows)
Checking my map, that is indeed the correct answer. Yay! It works as it should.
Now that I have my data loaded into PostgreSQL/PostGIS, it was time to find out if other (non-ESRI) software could interact with the data. First test: Quantum GIS (http://qgis.org). Quantum GIS is an open source cross-platform GIS that runs on Linux, Windows, and OS X. I was able to load my PostGIS data straight in without any problems, and was very impressed with how fast it draws my data.

Great, we have a cross platform desktop application that will read/write my PostGIS data. But how can I get this data onto the web? Let's try Geoserver (http://geoserver.org). After downloading and installing Geoserver, the steps to get Geoserver working with my data were very straightforward:
- Open the Geoserver administration webpage (http://localhost:8080/geoserver)
- Go to Config, then Data
- Create a Namespace for my data;
- Back on the Config->Data menu, now add a DataStore for my PostGIS data;
- Back on the Config->Data menu, go to FeatureTypes. Enable all the features you want to add to your published map.
- Lastly, I wanted to use WMS to publish my map. So, go to Config->WMS and set up a group layer for my new data.

ESRI, I hope you're taking notice of this stack. Because I'll bet some of your customers will be.

3 comments:
QGIS is not a Java application. It is written in C++ using the cross-platform Qt toolkit from Trolltech.
Yes, you are correct. My mistake, I was looking at uDig earlier, which is Java. And since QGis is cross platform, I mistakenly linked the two. Thanks for the clarification.
Hey Horsey, really great to see you blogging, I'll be subscribing. This is Tartley/Hartley/Jonathan/feckwit/JB.
Love your walkthrough of the open source stack, very inspirational to see someone fitting all those pieces together. How about next you do a shootout, to discover any shortfalls and bottlenecks?
Post a Comment