www.sdlsuite.com Forum Index www.sdlsuite.com
Discussion of technical aspects of the SDL Component Suite
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Seeing what is inside GeoDB

 
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack
View previous topic :: View next topic  
Author Message
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Wed Sep 28, 2011 3:32 pm    Post subject: Seeing what is inside GeoDB Reply with quote

I want to store some vector like data (for example a coastline from the Worlddatabase data WDB II) in GeoDB and plot this data on a GeoMap. For this I have written a procedure to read the WDB data and store them as polygons in GeoDB.
I then plot these points in a Geomap component in the OnDataRendered procedure. It more or less works as I can see lines apear. But the resulting plot does not look like a sample plot of the original WDB data. Data seems to be missing.

Is there a piece of sample code with which I can easily see what is stored in GeoDB? For example a routine that summarizes what is stored. For example something like:
20 Polygons stored as river
13 Polygons stored as road
12 Blobs stored etc..

Greetings,

Jaap van Goor
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
hlohning



Joined: 08 Sep 2006
Posts: 277
Location: Austria

PostPosted: Sat Oct 01, 2011 7:09 am    Post subject: Reply with quote

The upcoming release of the SDL Suite will contain a GeoDB viewer which shows all items in a database. The program "geodb_viewer" is not yet finished, but you can download a preview from the following URL:

http://www.sdlsuite.com/download/geodb_viewer_02.zip

Unzip the archive and start the executable. Click "Open Database" to see the contents of the DB. In order to narrow down the displayed database items just enter a substring in the "Name Filter" box and press Enter (currently the columns "Name", "Date" and "ItemKind" are searched by the filter).

Hope this helps,

Hans
_________________
Hans Lohninger
Software Development Lohninger
http://www.lohninger.com/
Back to top
View user's profile Send private message Visit poster's website
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Sun Oct 02, 2011 12:12 pm    Post subject: Reply with quote

Hans,

Many thanks this sample program works great. I have also written a more simple summary of what is inside GeoDB. Put a Memo on a form and add a button that when clicked on writes a summary in this Memo.

The onclick event would look like this:

Code:

var
  k : longint;
  numPolygon,numBLOB,numBorder,numRoad,numRiver,numLake,numCity,numRoute,numTown,numUndefined : integer;
  latHigh,latLow, longHigh, longLow : single;
begin
  numBLOB:=0;
  numTown:=0;
  numUndefined:=0;
  numBorder:=0;
  numRoad:=0;
  numRiver:=0;
  numLake:=0;
  numRoute:=0;
  numCity:=0;
  latHigh:=GeoDB.IxLatHigh[1].LLValue;
  latLow:=GeoDB.IxLatLow[1].LLValue;
  longHigh:=GeoDB.IxLongHigh[1].LLValue;
  longLow:=GeoDB.IxLongLow[1].LLValue;
  for k := 1 to GeoDB.NumEntries do
    begin
      if GeoDB.IxLatHigh[k].LLValue>latHigh then latHigh:=GeoDB.IxLatHigh[k].LLValue;
      if GeoDB.IxLatLow[k].LLValue<latLow then latLow:=GeoDB.IxLatLow[k].LLValue;
      if GeoDB.IxLongHigh[k].LLValue>longHigh then longHigh:=GeoDB.IxLongHigh[k].LLValue;
      if GeoDB.IxLongLow[k].LLValue<longLow then longLow:=GeoDB.IxLongLow[k].LLValue;
      case GeoDB.Data[k].ItemKind of
        gitBLOB   : inc(numBLOB);
        gitTown   : inc(numTown);
        gitUndefined : inc(numUndefined);
        gitborder : begin
                       inc(numPolygon);
                       inc(numBorder);
                    end;
        gitroad   : begin
                       inc(numPolygon);
                       inc(numRoad);
                    end;
        gitriver  : begin
                       inc(numPolygon);
                       inc(numRiver);
                    end;
        gitRoute  : begin
                       inc(numPolygon);
                       inc(numRoute);
                    end;
        gitCity   : begin
                       inc(numPolygon);
                       inc(numCity);
                    end;
        gitLake   : begin
                       inc(numPolygon);
                       inc(numLake);
                    end;
      end;
    end; { for to do }
  GeoDBMemo.Lines.Add('Number of entries: '+IntToStr(GeoDB.NumEntries));
  GeoDBMemo.Lines.Add('Top latitude: '+ GeoLatitude(latHigh,dfDegMin,2));
  GeoDBMemo.Lines.Add('Bottom latitude: '+ GeoLatitude(latLow,dfDegMin,2));
  GeoDBMemo.Lines.Add('Right longitude: '+ GeoLongitude(longHigh,dfDegMin,2));
  GeoDBMemo.Lines.Add('Left longitude: '+ GeoLongitude(longLow,dfDegMin,2));
  GeoDBMemo.Lines.Add('Number of Towns: '+IntToStr(numTown));
  GeoDBMemo.Lines.Add('Number of BLOBs: '+IntToStr(numBLOB));
  GeoDBMemo.Lines.Add('Number of Undefined: '+IntToStr(numUndefined));
  GeoDBMemo.Lines.Add('Number of Polygons: '+IntToStr(numPolygon));
  GeoDBMemo.Lines.Add('     Number of Borders: '+IntToStr(numBorder));
  GeoDBMemo.Lines.Add('     Number of Roads: '+IntToStr(numRoad));
  GeoDBMemo.Lines.Add('     Number of Rivers: '+IntToStr(numRiver));
  GeoDBMemo.Lines.Add('     Number of Lakes: '+IntToStr(numLake));
  GeoDBMemo.Lines.Add('     Number of Cities: '+IntToStr(numCity));
  GeoDBMemo.Lines.Add('     Number of Routes: '+IntToStr(numRoad));
end;


Greetings,

Jaap
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group