Bruce Thomas
The map portal is meant to serve basic desktop GIS needs of many county agencies in the near future by allowing users to perform spatial queries on map themes pre-defined by metadata. The map portal is extensible in the sense that new map themes and spatial queries can be added to the metadata for new map servers. Since the map portal is web based, only a web browser is required to access the map portal from the client's desktop.
Each map server is started with Active X components that read metadata about the contents of the map server. Each new map server is started by creating a new set of metadata and reading it with the map generator components. Once started, users can connect to the map server through the Internet. The contents of a map server can be adjusted by changing the metadata and restarting the map server.
The map portal is under final development at this time and some of this information may change in the near future. Please be sure to check the main page for the map portal at:
http://www.metrokc.gov/dias/its/gis/mapportal/index.htm
The list under the location map shows the map theme and the map layers available for spatial query. Other map servers are listed under the 'Map Portals' drop down list. A dynamic scale bar appears below the map image. The map image shown above is a spatially registered key map that appears at the full county scale.
A separate browser window displays spatial query results. For instance,
here is the query result for a user map click on a section of street in
the map display. It reports the name, address range, and zip code for the
street section.
Street Address Range | ||
Street Name | 77th Ave SE | |
Left From Address | 2700 | |
Left To Address | 2898 | |
Right From Address | 2701 | |
Right To Address | 2899 | |
Left Zipcode | 98040 | |
Right Zipcode | 98040 | |
This table would appear in a separate browser window that pops up after the user clicks on the street section to identify. This separate window is called a data sheet. Data sheets are discussed below.
In general, web browsers connect to a web server that passes an HTTP request to the selected map server. The map server handles spatial operations by calling MapObjects methods, and passes database queries to an Oracle 7.3 database with an SQL command. The results are returned to the map server which generates a new HTML page which is returned to the client through the web server.
The diagram shows an Object Role Model (ORM) of the metadata collections for a map server. Each map server starts with a root object, identified by a unique tag. This root object reads the metadata to fill its collections. The metadata supplies the elements for each of these collections. For instance, a web map server with a given tag has a collection of URLs for the other web map servers that a user can link to from this map server.
Each web map server with a given tag also has a collection of layer sources, each identified by a unique tag. These map layers are drawn on the MapObjects map control, and some layers also allow spatial queries. A data sheet represents the HTML template for the results of a spatial query; each map server will have several of these data sheets, at least one for each layer with an available spatial query. Most spatial queries involve both map layers and database attributes associated with layer features. Each database connection for a map server is supported by an ADO Connection. The metadata for each database connection has enough information for the map server to create this ADO Connection in its own collection.
All of these collections are implemented with the Visual Basic collection data type. Each member of each collection is uniquely identified by an object tag.
Databases supply initial parameters for starting a web map server process. | |
Client requests map image and feature information from web server. | |
Server queries connected databases, makes map, and returns formatted results. | |
Databases respond to map server queries. |
The sample VB code below shows how the map server performs an SQL query
on a connected database for attributes of a selected map layer feature.
' VB Variables (in order of appearance):
' oADOConn ADO Connection object ' oDatabase object from database collection ' oMORecordset MapObjects Recordset object ' oMOKey MapObjects Field object ' sLayerKeyName name of key item in layer ' sKeyValue value of the key item for selected feature ' sCriteria portion of SQL query string ' sDataKeyName name of key item in database table ' oADOCmd ADO Command object ' sTableName name of database table with layer attributes ' oADORecordset ADO Recordset object ' 1. Get the open database connection Set oADOConn = oDatabase.ADOConnection ' 2. Set selected feature from map layer recordset. oMORecordset.MoveFirst ' 3. Make an SQL string with map layer key and database key. Set oMOKey = oMORecordset.Fields(sLayerKeyName)
' 4. Get the ADO recordset for the selected spatial feature Set oADOCmd = New ADODB.Command
' The database record in ADO Recordset now matches the map feature record |
The ADO Connection object in step 1 points to the database with map layer attributes; the selected map feature is passed through a MapObjects Recordset object in step 2. The SQL query is started in step 3; it assumes that a key item exists in both the map layer and the database table. The value of the key item will be in the Fields collection of the MapObjects Recordset from step 2. The query on the database is completed in step 4 using an ADO Command object that returns an ADO Recordset. This ADO Recordset will have the attributes for the selected map feature. Since the key item should be unique in the related database table, there should only be one record in the ADO Recordset. Further processing on the fields of this recordset will yield the related attributes.
The HTMLLayerResult class in the lower right of the diagram constructs the results of a spatial query in a separate HTML page that is loaded in the data sheet browser window. The HTMLLayerResult class displays the collection of variables that contain the results of the spatial query against a map layer and its associated database connections. The map server data sheets are produced by the HTMLLayerResult class.
The left side of the diagram shows the HTMLPage class and the IMS WebLink control which is also contained on the MapFormX form. The MapForm interface, top left, represents the HTML FORM element that encapsulates a user's current map parameters as URL encoded name, value pairs. This URL encoded data is passed back to the map server with each client request for a map page.
Each map request raises an event that the KGCMap module responds to. The URL encoded parameters of each map request are used by the KGCMap module to generate a new map page according to the request. Each map server listens to a single IP port registered with IMS. Each map server is registered with a different IP port number. When one map server connects to another, it passes its URL encoded parameters through IMS to the other. Since all map servers in the map portal use the same URL encoded parameters, each map server can link to any of the others.
This makes the map portal very extensible. By design, it is meant to easily implement new map servers by simply adding metadata for the new map servers and starting a new instance of the map generator components. This metadata defines not only the map layers that will display on the map, but also the attributes that will be displayed in a data sheet after running a spatial query that reads attributes from a connected database.