...
Basics of data handling in Weave
Selections
One important thing to get your head around in Weave is the concept of the
Anchor | ||||
---|---|---|---|---|
|
Selections
The concept of separation of searching and reporting is an important concept in Weave.
In way of an For example, think of how users use search engines like Google where they users search for something and get back the results. There's The only ever one way to search , type is by typing something in the box, and one type of result displayed, ; a page of top search results.
But In contrast, with Weave you have a multitude of there are multiple ways of searching for things and a multitude of ways of displaying the search results. "Searching" “Searching” could be preformed by drawing a polygon on a map to find all the things that fall within that polygon, or by typing in an address to search a database find the matching properties, or even by having a third party system sending a list of unique identifiers. And "Reporting" “Reporting” could be a as simple as displaying a list of the owner names of the found properties, or generating a PDF report describing the history of the property, or sending a list of unique identifiers to another third party system.
...
Because of this separation and the use of a current selection, searching can be combined or split across multiple systems, for . For example, a user is may be working in a property management system and has may have selected a number of properties, they . They then send this selection to Weave (searching by third party system) which updates the current selection for properties, . They then they perform a spatial intersection operation in Weave to refine the selection of properties to only those that fall within a flood zone (searching via spatial operation), then perform an attribute search to further refine the selected properties to those that are listed in the residents database as being over 65 years old (searching via SQL). Then they display the textual list of owners of the properties (reporting from SQL) to give it a once over before finally generating a flood warning mail merge based on the final list of selected properties (reporting from document) and send those to the residents warning then that evacuating sooner rather than later may be a good ideaadvising them to evacuate.
To facilitate this Weave uses the concept of a current selection, where each entity you want to work with in Weave is associated with a list of unique identifiers that represent the entities that the user has searched for and is reporting on. This list of identifiers can come from anywhere and as long as each system Weave connects to uses the same identifiers to represent the same entity then Weave can work with those systems to perform searching and reporting.
So In summary, a central principal in Weave is the entity, which is nothing more than an internal id , and a user facing label and . A selection is simply a list of identifiers that represent the current selection.
Spatial Operation
If you want to be able to work spatially with an entity belong to an entity.
Anchor | ||||
---|---|---|---|---|
|
Spatial Operation
Before spatial operations (select by polygon, zoom to on a map, etc) you need to tell Weave what layer/table in a spatial engine can be used to represent the entity and what can be performed against an entity, a spatial engine must be configured telling Weave of the relationship between the layer/table and the entity and a table column (the key column) in the layer/table can be used must be specified to uniquely identify items under each entity, this . This is done be by creating a spatial mapping item in the configuration file.
Once a spatial mapping is setup for an entity then when you do a in place, spatial operations such as select by polygon, a boundary intersection , a buffer operation, etc, it's the and buffer operations result in key column values that are being written to the current selection for the entity, thereby updating the current selection for that entity. Going the other way, if you want to zoom to the extent of the current selection or highlight the selection on the map, then the list of unique identifiers stored in the current selection for the entity is under the relevant entity. Conversely, zoom to current selection and highlight selection on a map causes the unique identifiers in the current selection to be used as the basis for performing a query in the spatial engine for geometry a geometry that matches the list of id's.The spatial operation
Note |
---|
It is not always required to specify a spatial mapping to work with an entity in Weave, but this is necessary to display the entities' location on the map or select the entities using spatial operations. It's in fact possible to setup an entire Weave client without a map or any spatial entities and have the user work purely with the textual attributes of the entities. |
The spatial operations on the client are represented with the "select/reselect/unselect by point/line/polygon/circle/rectangle" tools, along with various buffer and spatial intersection tools and setup using the Spatial Mapper configuration item.
...
If you want to display textual attributes for an entity you create data definitions and link those to an entity for display with a data tag (really should come up with a better name for that). Data definitions are a tabular representation of textual data that can come from anywhereany source, but generally will come from a database and be generated by executing SQL, they . They can be used for populating drop down lists, generating content for a BIRT report or most often for direct display of attribute data for the user.
...
To allow a data definition to be used to display attribute data related to a selected entity the data tag is used to link an entity to a data definition and provide a label for displaying to the user. This way there can me be more than one set of attribute data that can be displayed to the user for each entity and the user can choose between which attributes to display be selecting the from list of available data's based on the label.
...
Attribute display on the client is represented using the data grid view and created using the Data Definition configuration items.
Note |
---|
As a side note, the The spatial identify tool is a short cut shortcut between the previous two items, the spatial mapping and the data definitions, that bypasses the updating of the selection tables and simply takes the list of identifiers returned by the select by polygon operation and uses that list to select the record from the data definition to display back to the user. |
...
Attribute searches are represented on the client using the search view and created using the Search configuration items.
Reports
Beyond the basic data display, generating a Report can allow the user to produce a more formatted form of output beyond just the tabular display of the data. Reports can contain data generated by Weave data definitions, or, reports can pull in data from any data source available to the BIRT reporting engine.
Virtual Entities
While it's possible to perform joins when working with data definitions and attribute searches, for example to allow you to list all of the animals registered at a selected property, sometimes you want to work with individual entities that don't have a spatial components.
Continuing our animals example if you wanted to select all of the German Shepherds in a given neighbourhood a naive approach would be to create an attribute search that started with the animal registration table (perhaps selecting all the rows containing the animal code for German Shepherds) then join that table to the property table (assuming the animals table has a foreign key into the property table) allowing us to get the unique property id for the property that the animal is located at. Weave then uses those property id's to update the current selection for properties and now we have a list of all the properties that have registered German Shepherds. But, when we then try and display the information related to the dogs we've just searched for using a data definition that does the reverse of when the search did (that is we start with the property table, selecting just those rows that match the property id's in out current selection, then join that table to the animal registration table to get a list of the animals for each property) we see that there are dogs other than German Shepherds listed.
This occurs because what we've done is to select all of the properties that have German Shepherds, we haven't selected all of the German Shepherds which is what we actually wanted to do. So when it come time to display the animal information we're displaying information about all of the animals that are registered at each selected property, which will more than likely include more that just the original German Shepherds.
If you want to work with entities that don't have a spatial representation you have two choices, either the user works with the entities using just attribute searches and data definition and has no way of selecting or viewing the entities via the map display, or you create a spatial view for the non-spatial entity and create a new entity to represent the newly "spatialized" entity. For example with our animals search we create a spatial view in the underlying spatial database that joined the animals registration table to the property spatial table, allowing us to represent each animal record by the property boundary of the property it's registered at and then we create a new animals entity and set up a spatial mapping using the spatial view and setting the key to be the animals registration number rather than the property id.
Then when we create an attribute search to find the German Shepherds the list of id's we end up with are the dogs registration numbers, which are unique for each dog, rather than the property id which isn't unique for each dog. We'd also need to switch out attribute search and data definition so that they now use the animal registration number of the key field rather than the property id. Of course we can also keep the animal property attribute search for time when we do want to locate properties based on the animals that are registered there.
Note that we could also add the newly created animals layer to our map engine as a new layer so that we can display just the animals using their property boundaries on the map, but this isn't necessary.