Place types and symbols
There are types of places, but they work poorly. This is scribbled notes at the moment until I understand and can fix.
Tables in finished code
CREATE TABLE place_types (key INTEGER PRIMARY KEY, name TEXT, misc_JSON TEXT);
holds types that places can be. misc_JSON can have "icon" which is the name of an icon displayed for places of that type
CREATE TABLE place_type_associations (place_id CHAR(4), type_key INTEGER);
Links places and types, so a place can be multiple types.
Consider setting index on place_id at some stage
poi/poi.sqlite - holds lots of configuration tables, and POI data. Can build the fixed reference tables by sqlite3 poi.sqlite < tablesource.sql
Tables and code that can now be deleted
- place_misc table in canal.sqlite can be dropped
- misc column from place_extra in canal.sqlite can be dropped (messy to do)
- attribute code of 'M' for mooring, should be replaced by mooring info or type (or both!)
- mapping/config/facilities.hdf can be dropped once checked nothing is using it
- place_type_icons table in canal.sqlite replaced by various tables in POI so can be dropped
- symbol_data in canal.sqlite is replaced by entity_data
To do
- Check edit of local maps
- There's code at the end of Get_Place_Icon in includes/make_geojson.can that does default symbols:
- Remove this code.
- Is the table (which is cached) used anywhere else here as it's obsolete
- Need to do an equivalent one-off manual bulk update on the live data - keep notes here of what to do
- When you change the symbol for a type of place, you need to do a big rebuild of maps and places - but just what exactly?
- Need two POI data tables - one for semiprocessed POI files (there aren't going to be any more of these, which simplifies things) and the other for user edited/contributed ones. The latter (at least) should be linked to the appropriate entity_type table to define the fields
- Update symbol editing works for features - check what doesn't work and fix it
- Improve mouse behaviour on clickable things in the closeup editing and - at least! - make them consistent
- Improve appearance/size of editing pop-up. Extract the code so it can be used for entities not attached to places
Releated issues
- 867
Done
- Change the mode for adding/editing types from "struct" in edit_details because that's just downright confusing
- Removed place_misc table
- Removed all the "misc dropdowns" stuff
Types of symbol
Tables to handle all of this are generated from tablesource.sql
The following types exist:
- internal - for crosshairs on maps and similar
- attribute - generated from the attributes field, shown in linear maps etc, can be tweaked on maps but default to the spot. A water point for example
- details - something set by editing and in the details field of mapping_JSON in place_extra. A holding mooring for example
- entity - something that can be canalside or elsewhere, has extra information. A pub, shop, NT property etc
- byrule - generated by a rule. A mooring set from the mooring info for example.
- placetype - set by the user to apply to a place. A milepost for example. An icon can be multiple types (a placetype that is also an entity such as a boatyard or canalside supermarket, a rule that is also a placetype - such as a mooring) - for these have multiple rows in the table with the same name.
