1 / 40

Object-Oriented VPF/DNC Database Modeling

Object-Oriented VPF/DNC Database Modeling. Hong and Rahael. VPF vs DNC. VPF is a vector formatted database storage for GIS data (Vector product format) DNC implements VPF, Digital Nautical Chart They are plain file structure. Introduction to DNC.

akira
Download Presentation

Object-Oriented VPF/DNC Database Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object-Oriented VPF/DNC Database Modeling Hong and Rahael

  2. VPF vs DNC • VPF is a vector formatted database storage for GIS data (Vector product format) • DNC implements VPF, Digital Nautical Chart • They are plain file structure

  3. Introduction to DNC • The whole earth could be divided into small parts for mapping • A DNC database only maps to a small portion of the earth map

  4. Introduction to DNC Database DNC LIB Dir 1 Browse Lib Dir 3 coverages 14 Coverages Primitive Dirs Primitives

  5. Intro to DNC • DNC03: 03 represents the disc number geographically. At the database level, only Database Header Table and Library Attribute Table • A library is a collection of coverages sharing the same tiling structure and coordinate system.

  6. Intro to DNC • DNC has 4 Libs: Harbor (H), Approach (A), Coastal (COA), General (GEN). In addition, there is a single BROWSE library. • Each Lib except BROWSE contains up to 14 Coverages. • At Lib level, only Library Header Table (LHT), Geographic reference table and Coverage Attribute table • A coverage is composed of one or more feature class types stored in a coverage directory. Features: area, line, point and text -> face, ring, edge, nodes, text

  7. Intro To DNC • In non-browse Libs, there may have: CUL, ECR, ENV, HYD, IWY, LCR, LIM, NAV, OBS, POR, REL, DQY, TILEREF, and LIBREF coverages • Tables: FCS, .FIT, FCA, NOTES.RAT, *.NJT, *.AJT, *.LJT, CHAR.VDT, INT.VDT, and tables for primitives • The topology level of each coverage is defined by the types of the feature classes present: 0, 1, 2, 3. • We only concern the topology level 3

  8. Intro To DNC • Tileref and Libref are mandatory for tiled libraries. Tileref contains an area feature table and primitive tables which relate the tile names and areas. • Libref contains a line feature table and primitive tables needed to draw a small scale depiction of the coverage • So, these two coverages have to be taken into consideration first before all other coverages for a Lib

  9. Intro to DNC • So, a database is composed of five types of Libraries each of which is composed of upto 14 coverages that layer over each other • Inside each coverage, features are the core part that depict each coverage • Features are grouped into different classes: point, line, area and text. • Each feature is a collection of primitives in geographic order

  10. DNC File Structure Database Library … Coverage ….. ……... [Tile] and Feature Class Feature & Primitives ………...

  11. DNC OOM • DNC file structure is a tree • Perfectly matches to Object-oriented tree navigation model • OOM is a navigation architecture in which each object is identified by an unique ID • Different OOMs may have different architectures

  12. What We Need? interface Database agents access Data retrieved

  13. What We Need? • We need an interface to bridge the agents and the database no matter in what form the database is. The interface is actually a simple DBMS • The interface could either arm the agents with XML format data, or simply assign objects to agents for later usage

  14. What We Need • For database compatibility, we do not want to modify the DNC database structure • For better usage and future enhancements, it is ok to store everything in Object forms -- requires to build our own database structure • Which way to go?

  15. What We Need • Of course the easiest way is to build our DBMS on the existing file structure • The DBMS interface is OOD • The DBMS underline implementation is then Object-Oriented-Relational • Temporarily for easy illustration, let’s give it a name: “OOH”

  16. Architecture of OOH Clients OO Interface OO-Relational Impl DNC File System

  17. OOH Package Architecture org.usm.vpf.dnc exception database .impl internal .impl

  18. DNC File Structure Database Library … Coverage ….. ……... [Tile] and Feature Class Feature & Primitives ………...

  19. Database Library Coverage FeatureManager VirtualTile Primitives Features

  20. Class DatabaseTreeNode • public interface DatabaseTreeNode extends java.io.Serializable • { • public DatabaseTreeNode findNode(NodeID ID); • public NodeID getIDObject(); • public Object getParentObject(); • public MetaData getMetaData(); • public XMLObject toXML(); • public void noParent(boolean noParent); • public NodeConstraint getConstraint(); • public void validate() throws ConstraintViolatedException; • }

  21. DataManager • A database manager manages a group of DatabaseTreeNodes that are of the same level and same type. For example, a group of Features in a coverage is organized as a Feature class, which could be managed by a FeatureManager. • The basic functions of a DataManager are: 1. Find a Node that is managed by it 2. On finding, return a proxy of the Node for RW. However, since RW happens on proxy, no affect on the original FeatureManager, PrimitiveManager, EntityNodeManager, ConnectedNodeManager, EdgeManager, FaceManager, TextManager, NotesManager

  22. Class DataManager • public interface DataManager extends java.io.Serializable • { • public Object findData(NodeID ID); • public void commit() throws InvalidTableUpdateException,ConstraintViolatedException; • }

  23. Class Database • public interface Database extends DatabaseTreeNode • { • public DatabaseMetaData getDatabaseMetaData(); • public Vector getAllLibraries(); • public String getRootDir(); • public void setRootDir(String root); • public void dbStart() throws DatabaseDefectException,DatabaseFailedException; • public void dbStop() throws DatabaseFailedException; • }

  24. Class Library • public interface Library extends DatabaseTreeNode • { • public String getName(); • public LibraryMetaData getLibraryMetaData(); • public Database getDatabaseObject(); • public GeographicExtent getGeographicExtent(); • public boolean isTiled(); • public boolean isBrowseLibrary(); • public GeographicReference getGeographicReference(); • public TileScheme getTileScheme(); • public LibrefScheme getLibrefScheme(); • public Vector getAllCoverages(); • public Coverage find(String coverageName) throws CoverageNotExistException; • public String getFilePath(); • }

  25. Class Coverage • public interface Coverage extends DatabaseTreeNode • { • public String getFilePath(); • public Vector getFeatureManagers(); • public FeatureManager find(String name); • public FeatureManager find(NodeID featureManagerID); • public CoverageMetaData getCoverageMetaData(); • public Library getLibrary(); • public VirtualTile getTile(int tileID); • public VirtualTile getTile(); • public void load() throws CoverageNotExistException, TileSchemeConflictException; • public void unload(); • public boolean isLoaded(); • }

  26. Class VirtualTile • public interface VirtualTile extends DatabaseTreeNode • { • public Coverage getCoverage(); • public EntityNodeManager getEntityNodeManager(); • public ConnectedNodeManager getConnectedNodeManager(); • public EdgeManager getEdgeManager(); • public FaceManager getFaceManager(); • public TextManager getTextManager(); • public String getFilePath(); • }

  27. Class FeatureManager • public abstract class FeatureManager implements DatabaseTreeNode,DataManager • { • public abstract Coverage getCoverage(); • public abstract Feature findFeature(int ID); • public abstract Vector getAllFeatures(); • public abstract byte getFeatureType(); • public abstract String getName(); • public abstract String getDescription(); • }

  28. Class Feature • public abstract class Feature implements DatabaseTreeNode • { • public final static byte POINT_FEATURE = 1; • public final static byte LINE_FEATURE = 2; • public final static byte AREA_FEATURE = 3; • public final static byte TEXT_FEATURE = 0; • public abstract FeatureManager getMyManager(); • public abstract byte getFeatureType(); • public abstract int getCurrentLevelID(); • public abstract String getName(); • public abstract Vector getPrimitives(); • public abstract void updatePrim(Primitive previous, Primitive current); • public abstract Object[][] getAttributeAndValues(); • public abstract Vector getReferencedNotes(); • public abstract ComparableFeature getComparable(boolean noTopology); • public abstract ComparableFeature getComparable(boolean noTopology, • FeatureComparisonAlgorithm myAlgorithm); • }

  29. Class Primitive • public abstract class Primitive • { • public final static byte ENTITYNODE = 0; • public final static byte CONNECTEDNODE = 1; • public final static byte EDGE = 2; • public final static byte FACE = 3; • public final static byte text = 10; • protected byte m_type; • public byte getType(){ • return m_type; • } • protected void setType(byte type){ • this.m_type = type; • } • public abstract DataManager getDataManager(); • public abstract Vector getReferencedFeatures(); • }

  30. Class EntityNode • public abstract class EntityNode extends Primitive implements DatabaseTreeNode • { • public abstract EntityNodeManager getMyManager(); • public abstract Face getContainingFace(); • public abstract void setContainingFace(Face f); • public abstract double[] getCordinates(); • public abstract void setCordinates(double[] cordinates); • }

  31. ConnectedNode • public abstract class ConnectedNode extends Primitive implements DatabaseTreeNode • { • public abstract ConnectedNodeManager getMyManager(); • public abstract Face getFirstEdge(); • public abstract void setFirstEdge(Edge e); • public abstract double[] getCordinates(); • public abstract void setCordinates(double[] cordinates); • }

  32. Edge • public abstract class Edge extends Primitive implements DatabaseTreeNode • { • public abstract EdgeManager getMyManager(); • public abstract ConnectedNode getStartNode(); • public abstract ConnectedNode getEndNode(); • public abstract Face getRightFace(); • public abstract Face getNearbyRightFace(); • public abstract Face getLeftFace(); • public abstract Face getNearbyLeftFace(); • public abstract Edge getRightEdge(); • public abstract Edge getNearbyRightEdge(); • public abstract Edge getLeftEdge(); • public abstract Edge getNearbyLeftEdge(); • public abstract double[][] getCordinates(); • public abstract void setCordinates(double[][] cordinates); • public abstract GeographicExtent getGeographicExtent(); • }

  33. Class Face • public abstract class Face extends Primitive implements DatabaseTreeNode • { • public abstract FaceManager getMyManager(); • public abstract Vector getAllEdges(); • public abstract Vector getInnerFaces(); • public abstract GeographicExtent getGeographicExtent(); • }

  34. Class LineFeature • public abstract class LineFeature extends Feature • { • public byte getType() • { • return Feature.LINE_FEATURE; • } • public abstract Vector getEdges(); • public abstract Vector getConnectedNodes(); • }

  35. Class TopologyManager • public interface TopologyManager extends java.io.Serializable • { • public boolean deleteFeature(Feature f) throws ConstraintViolatedException; • public boolean deletePrimitive(Primitive p)throws ConstraintViolatedException; • public Feature addPrimitive(Primitive p) • throws ConstraintViolatedException, InvalidParameterException; • public Feature addPrimitive(Primitive p, boolean asFeature) • throws ConstraintViolatedException, InvalidParameterException; • public void addPrimitive(Primitive p, Feature f) • throws ConstraintViolatedException, InvalidParameterException; • public boolean updatePrimitive(Primitive p) • throws ConstraintViolatedException, InvalidParameterException; • public void begin(); • public void end(); • public void commit(); • public Coverage getCoverage(); • }

  36. Class Topology • The class TopologyManager is dedicated for Feature & Primitive updates. Since the topology of each coverage has be kept after the updates of a feature or a primitive, and the update of a feature or primitive affect others, we then have to go through a complicated process to keep the topology. • The basic algorithm is from the paper "An Object-Oriented Approach For Handling Topology in VPF Products", though there are something different. • <p>It has to be mentioned that all changes you want to make have to be • through this class. Also, for any changes permanently happen in the • database, you have to call the commit() method. The usage of this class • is similiar to ODMG's Java Binding: • TopologyManager t = myCoverage.getTopologyManager(); • t.begin(); • t.update ... • t.delete ... • t.add ... • t.commit(); • t.end(); • Here, t.begin means that a transaction begins, and t.end() states that • this transaction ends. t.commit() states that the above modifications are requested to be made permanently to the database now.

  37. Class Table • public interface Table extends java.io.Serializable • { • public String getFileName(); • public void bindFile(String fileName); • public void load() throws NoSuchTableFileException; • public RowSet findByPrimaryKey(IDObject id); • public void update() throws NoSuchTableFileException, InvalidTableUpdateException; • Public String getTableName(); • Public Object getRows(); • ------ • }

  38. Class RowSet • public interface RowSet extends java.io.Serializable • { • public int getPrimaryKey() throws NoSuchColumnException; • public Object get(String key) throws NoSuchColumnException; • public byte getDataType(String key); • public Object get(int position) throws NoSuchColumnException; • public byte getDataType(int position); • public void set(String key, Object value) throws NoSuchColumnException; • public void set(int position, Object value) throws NoSuchColumnException; • public int getColumnCount(); • }

  39. LogManager • A good way to control log message systematically. • Static methods • Anytime when there should be debug messages, must use LogManager

  40. What have been done • The implementation of org.usm.vpf.dnc.internal.impl has been finished. Next step is to implement org.usm.vpf.dnc.internal which is a easy task. Later, org.usm.vpf.dnc.impl which is the real part. • Job done by: Hong, Rahael, Johan. Thanks.

More Related