Geographic Data Model Conventions for Road and Zone Management Systems
50 likes | 170 Views
This document outlines the conventions for naming tables, queries, and stored procedures in a geographic data model. It specifies how to identify road segments based on direction, as well as the structure of zone data within the system. Key procedures like 'Find_Zone' and 'Find_Name' are defined to retrieve zone and location information. Additionally, a stored procedure for finding neighboring zones in specified directions is detailed. This is essential for developers working with geographic data management.
Geographic Data Model Conventions for Road and Zone Management Systems
E N D
Presentation Transcript
Conventions • Tables names preceeded by ‘tbl’. • Example: tblLocation, tblRoad. • Similarly query names start with ‘qry’ and stored procedure names start with ‘prc’. • All road segments heading in the north south direction are numbered from 0 - 1000. • All road segments heading in the east west direction are numbered from 1000 onwards.
Zones • tblZone has the following fields: • ZoneNorth • ZoneSouth • ZoneEast • ZoneWest • These fields will give the neighboring zone once the direction is specified.
Name : Find_Zone Input : LocationID Returns : LocationZoneID Function : This procedure returns the ZoneID of the Source/Destination selected. Pseudo Code : create procedure Find_Zone SELECT LocationZoneID FROM tblLocation WHERE LocationID = ‘X’ Name : Find_Name Input : LocationID Returns : LocationName, LocationDescription Function : This procedure returns the name and description of the Source/Destination selected Pseudo Code : create procedure Find_Name SELECT LocationName, LocationDescription FROM tblLocation WHERE LocationID = ‘X’ StoredProcedures/Queries
Stored Procedures/Queries (2) • Name : Find_Neighbor • Input : ZoneID, Direction • Returns : Zone(Direction)ID • Function : This procedure returns the ID of neighboring zone in the given direction for input zone. • Pseudo Code : create Find_Neighbor @ZoneID, @Direction as switch @direction case “North” : SELECT ZoneNorthID FROM tblZone WHERE ZoneID = @ZoneID case “South” : SELECT ZoneSouthID FROM tblZone WHERE ZoneID = @ZoneID … ...