Saturday, December 09, 2006

Labeling KML Part 2

I wrote previously on how Shape2Earth can now create center-points from polygons that can be used for labeling. The next thing I need to do is create the same functionality for lines. This is a bit trickier than for polygons. Imagine using the bounding envelope for the Missouri River to create a center-point to label the River. Its just not going to be in a very effective place.

The idea I am going to take a crack at is to use one of the points in the feature itself. I'll probably just pick the middle point and use that as the label. This should get the label reasonably close, and then let users make minor adjustments to its location in Google Earth.

Thursday, December 07, 2006

New Google Earth API Allows for GIS Type Interaction

I am not sure that this is what the Google Earth engineers had in mind when they released it, but new COM API exposes a method called “GetPointOnTerrainFromScreenCoords”.

If you pass this method normalized screen coordinates from the GE Render window, it will return the Latitude, Longitude, and elevation of that point in Google Earth. This opens up an enormous amount of potential for using Google Earth as your GIS interface.

Google has always maintained that they are not a GIS, and they are right. But they have a great visualization system. All that is needed is a way to interact with their interface in a way that makes sense for GIS types of applications. All of the GIS activity can than go on behind the scene.

As an example, I can now click anywhere on Google Earth and capture the coordinates. I can also drag a rectangle across the screen and define its actual location within GE. I can then pass this data back to GIS representation (such as a shapefile) of the loaded KML data. The result is a color coded selection set of data, or a new window that holds whatever feature data I would like to see from another server (or local data).

I can also use the coordinate to calculate a buffer that is loaded in as KML. I can also use this data to select other data.
You can also create very quick sketches directly in Google Earth that can be saved as shapefiles, or sent out to other clients for collaboration. Much more to come on this.

GIS for Google Earth: Final Testing

[Note: Final testing for Shape2Earth is complete. Shape2Earth Version 1.0 is has been released as shareware, and is available for download at http://shape2earth.com]

The final beta version of Shape2Earth is ready for testing. I am particularly interested in international users, as I have had some issues with coordinates being written without decimals, and I want to make sure that is working.

This version also has a licensing manager built in to it. It will operate in full mode for 7 days, but then must be licensed.

Beta testers will receive the license to extend the use of the software until the final release.

Any interested persons may contact me at Sabin21@gmail.com

Labeling GIS Data with Shape2Earth

One of the most requested functional additions for Shape2Earth has been the ability to label polygons. This is now possible with the use of a centroid function that creates a point in the middle of the polygon for the label.

In the example below, I will be labeling major lakes in the United States.

First, I open up Shape2Earth from MapWindow GIS


Then, from the Properties tab, I select the points that I want to use for the labels using the Enhanced Point Selector dialog box.



If I want there to be only text, I make the size of the icon zero, and do not add a label rollover. If I want to make it a bit fancier, I can select one point for the label, and another that is displayed when the user rolls over it.


Finally, I can select which attribute field I want to use to label each polygon. I can also select to sort the features so that they will be displayed in alphabetical order.


A simple result is show below.


These methods can be used to make some rather sophisticated views in Google Earth





Tuesday, December 05, 2006

Personal Geodatabase Feature Classes in Shape2Earth

Another interesting thing that I have been poking around at for some time is the ability to read ESRI Access Personal Geodatabases directly from their binary representation without the need for ArcObjects. The trickiest part of this was having to interpolate curves. I have this working to a reasonable degree.

The current prototype exports PGDB feature classes to KML, Shapefiles, and into SQL for importing GIS data into PostGIS, and has been tested with PGDBs created with ArcGIS 9.1 and 9.2. This opens more data for use with Shape2Earth.

I have been assuming that the same binary structure used in Access databases are also used by ArcSDE, but have not had the chance to test this theory out.

This same method could be used to create and edit Personal Geodatabase (and ArcSDE for that matter), but I doubt I’ll ever have the time to see this through.