Warning: This page has not been updated in over over a year and may be outdated or deprecated.
configuration:geographic_features
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
configuration:geographic_features [2018/04/24 01:25] – [OpenLayers] lmgonzales | configuration:geographic_features [2023/10/24 19:15] – [General Configuration Notes] lmgonzales | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Starting with VuFind 3.1, a new set of modules were introduced for displaying geographic data at the record level, as well as a geographic search interface. | + | ====== Geographic Features ====== |
- | - Provided the option for displaying multiple geographic features (points and/or rectangles) for a record. | + | |
- | - Provided a geographic search interface. | + | |
- | - Added configuration options for the geographic search and display interfaces. | + | |
- | To properly configure the Geographic Search & Display | + | VuFind® contains |
- | For an overview of these features as they were originally developed for VuFind 3.1, you can [[https:// | + | Features: |
- | ===== Changes from VuFind 4.x to 5.0 ===== | + | - Can display multiple geographic features (points |
- | :!: Starting in VuFind 4.0, the OpenLayers functionality has been removed | + | |
- | + | | |
- | Other improvements include: | + | |
- | | + | |
- | | + | |
- | + | ||
- | ===== Changes from VuFind 3.1 to 4.x ===== | + | |
- | The VuFind 3.1.x version of these modules preserved and upgraded | + | |
- | + | ||
- | :!: Starting in VuFind 4.0, the GoogleMap functionality has been removed, some [[development: | + | |
- | + | ||
+ | To properly configure the Geographic Search & Display modules, you will need to ensure that your data is indexed properly, and then you will need to configure the module options in the associated .ini files. | ||
+ | This functionality was first introduced in VuFind® 3.1; it has subsequently evolved, as described in the [[configuration: | ||
===== Indexing Geographic Data ===== | ===== Indexing Geographic Data ===== | ||
Line 29: | Line 19: | ||
==== Coordinates ==== | ==== Coordinates ==== | ||
The coordinate data will go into field 034 of your MARC record, in subfields $d,$e,$f, and $g. | The coordinate data will go into field 034 of your MARC record, in subfields $d,$e,$f, and $g. | ||
- | You can format your coordinates as decimal degrees (DD) or degrees minutes seconds (DMS), and you can assign hemispheres by using either letters (N,S,E,W) or symbols (+,-). | + | You can format your coordinates as decimal degrees (DD) or degrees minutes seconds (DMS), and you can assign hemispheres by using either letters (N,S,E,W) or symbols (+,-). If you omit the + sign, it is considered the default. |
Note that the order for coordinates in the [[http:// | Note that the order for coordinates in the [[http:// | ||
$d: West; $e: East; $f: North; $g: South | $d: West; $e: East; $f: North; $g: South | ||
- | * Note, [[https:// | + | If malformed coordinates are detected during indexing, an error message containing the record ID, coordinate values, and problems with the coordinate values will be displayed. Malformed coordinates will not be included in the indexed |
- | + | ||
- | If malformed coordinates are detected during indexing, an error message containing the record ID, coordinate values, and problems with the coordinate values will be displayed. Malformed coordinates will not be indexed. | + | |
==== Labels ==== | ==== Labels ==== | ||
Line 61: | Line 49: | ||
==== Solr fields and files ==== | ==== Solr fields and files ==== | ||
- | Starting in VuFind | + | Starting in VuFind® |
- | * **long_lat**: | + | * **long_lat**: |
* **long_lat_display**: | * **long_lat_display**: | ||
* **long_lat_label**: | * **long_lat_label**: | ||
- | :!: //Note that VuFind 3.1 used the **long_lat** field differently and also relied on a **location_geo** field that was removed in 4.0. Details on the old 3.1 definitions are here:// | + | See the [[development:architecture:solr_index_schema# |
- | + | ||
- | * **location_geo**: stores the coordinates as a bounding box field type and you can reference the Solr Spatial Guide (listed at the bottom of the slide) | + | |
- | * **long_lat**: | + | |
The following files handle the indexing of geographic data: | The following files handle the indexing of geographic data: | ||
* **schema.xml**: | * **schema.xml**: | ||
* **marc_local.properties**: | * **marc_local.properties**: | ||
- | * **GeoTools.java**: | + | * **GeoTools.java**: |
===== Displaying Geographic Data ===== | ===== Displaying Geographic Data ===== | ||
- | Starting with VuFind 5.0, geographic features are //only// displayed with **Leaflet**. | ||
- | :!: In VuFind 4.x, geographic features are // | + | ==== Underlying Technology ==== |
+ | Starting with VuFind® 5.0, geographic features are displayed with **Leaflet**. For historical information about earlier implementations using OpenLayers and GoogleMaps, click the "Old revisions" | ||
- | :!: In VuFind 3.1, you have two options | + | Leaflet provides a light-weight code base for displaying |
+ | Features can be clicked on to show a popup window that will display | ||
- | ==== VuFind 4.x: OpenLayers | + | ==== General Configuration Notes ==== |
- | OpenLayers allows you to display point and rectangle features, as well as their labels and coordinates. | + | * The recordMap parameter in geofeatures.ini [MapTab] section |
- | Features | + | * The basemap |
- | The pop-up window uses the built-in internationalization support so that as you switch languages, the title of the pop-up window (e.g., "At this location" | + | |
- | Configuration options for OpenLayers | + | Configuration options for geographic feature |
< | < | ||
- | ; Geographic Display | + | [Basemap] |
- | recordMap = openlayers | + | basemap_url : the tileserver URL for the basemap |
+ | basemap_attribution: | ||
+ | |||
+ | [MapTab] | ||
+ | recordMap = true ; OR false | ||
mapLabels = driver ; OR file: | mapLabels = driver ; OR file: | ||
displayCoords = true; OR false | displayCoords = true; OR false | ||
+ | graticule = true; OR false | ||
</ | </ | ||
- | Labels can be read from the long_lat_label field if they are stored in Solr, or assigned on the fly with a look-up table. If you use a look-up table, put it in your local/ | + | Labels can be read from the long_lat_label field if they are stored in Solr, or assigned on the fly with a look-up table. If you use a look-up table, put it in your local/ |
+ | :!: // Note: Starting in VuFind 7.0., the contentsecuritypolicy.ini file was implemented. You will need to modify this file to include the basemap tileserver domain. | ||
- | + | The following | |
- | ==== GoogleMaps - VuFind 3.1 only==== | + | // |
- | :!: //Support for the GoogleMaps display option | + | |
- | + | ||
- | With this option | + | |
- | + | ||
- | Configuration options for GoogleMaps display from config.ini file: | + | |
< | < | ||
- | ; Geographic Display | + | img-src[] |
- | recordMap | + | |
- | mapLabels = driver ; OR file:filename | + | |
- | displayCoords = false; **Not supported with GoogleMaps** | + | |
- | googleMapApiKey = API Key | + | |
</ | </ | ||
+ | ==== Notes on Map Tiles ==== | ||
- | Labels can be read from the long_lat_label field if they are stored in Solr, or assigned | + | Map display depends on access to a tile set to allow zooming and scrolling around |
- | + | ||
- | Note that display of coordinates is not supported with the GoogleMaps display option. | + | |
+ | One way to help reduce the amount of map tile server calls is to configure the defaultRecordTab setting in the config.ini file to something other than " | ||
===== Geographic Searching ===== | ===== Geographic Searching ===== | ||
Line 125: | Line 106: | ||
When the **Geographic Search** link is clicked, a default Solr bounding box query will run and will display the search box and the search results clustered on the map interface. | When the **Geographic Search** link is clicked, a default Solr bounding box query will run and will display the search box and the search results clustered on the map interface. | ||
You can zoom in to uncluster or zoom out to cluster the points. | You can zoom in to uncluster or zoom out to cluster the points. | ||
- | Any clusters with less than five records can be clicked on to show a pop-up with the list of titles in that cluster. | ||
- | Additionally, | ||
- | You can also click on the **Draw Search Box** button, and then click-drag-click | + | * Features are clustered based on proximity. You can zoom in to uncluster features. Rectangle feature center points are denoted by marker icons with flat tops and point features are denoted with marker icons with rounded tops. |
+ | * Click on an icon to see the title of the associated record. | ||
+ | |||
+ | You can also click on the **Draw Search Box** button, and then click and drag to create the search box query. | ||
(Note that the previous query box and results will persist as you draw your new search box. This is done on purpose to give you a reference point relative to the previous query.) | (Note that the previous query box and results will persist as you draw your new search box. This is done on purpose to give you a reference point relative to the previous query.) | ||
If you need help, just click on the **Need Help?** link next to the **Draw Search Box** button. | If you need help, just click on the **Need Help?** link next to the **Draw Search Box** button. | ||
- | The help text for geographic searching has been integrated into the VuFind | + | The help text for geographic searching has been integrated into the VuFind® |
- | + | ||
- | In VuFind 4.0, the geographic search queries against the long_lat field and returns the data from the following fields: long_lat, title, id. | + | |
- | + | ||
- | :!: In VuFind 3.1, the geographic search queries against the location_geo field and returns the data from the following fields: location_geo, | + | |
+ | Starting in VuFind® 4.0, the geographic search queries against the long_lat field and returns the data from the following fields: long_lat, title, id. | ||
==== Configurable Options ==== | ==== Configurable Options ==== | ||
To turn on the geographic search functionality, | To turn on the geographic search functionality, | ||
< | < | ||
- | default_top_recommend[] = MapSelection ; see [MapSelection] | + | default_top_recommend[] = MapSelection ; see [MapSelection] |
</ | </ | ||
- | Set the default search box coordinates and the height of the map search interface in the Map Selection | + | You can set the default search box coordinates and the height of the map search interface in the [MapSelection] |
When setting your default search coordinates, | When setting your default search coordinates, | ||
< | < | ||
[MapSelection] | [MapSelection] | ||
- | ; The default coordinates specified below are in decimal degrees, and are | + | ; default_coordinates: |
- | ; ordered as WENS (west, east, north, south). Ranges of valid values are: | + | ; |
- | ; -180 to 180 (longitude) and -85 to 85 (latitude). Note, to search from and to | + | ; |
- | ; the international date line, use west = -179 and east = -180. | + | ; |
+ | ; | ||
+ | ; | ||
+ | ; height: | ||
default_coordinates = "-95, 30, 72, 15" | default_coordinates = "-95, 30, 72, 15" | ||
- | ; height: Height in pixels of the map selection interface. | ||
height = 320 | height = 320 | ||
</ | </ | ||
Line 181: | Line 162: | ||
</ | </ | ||
- | ==== Caveats | + | ===== Customizing |
- | The following functionality will be improved upon in future upgrades of the Geographic Search | + | |
- | **Clustering of Rectangle Features** \\ | + | The geographic search & display |
- | Search results clustering requires that all clustered | + | |
- | The code goes through several routines to check for rectangle features that intersect the search box, and to check if the center point of those rectangles land within the search box. | + | |
- | For those rectangles that intersect the search box and have center points that fall outside of the search box, the code sets the rectangles' | + | |
- | **Records with Multiple Geographic Features** \\ | + | The notes below refer to the code as it has existed since release 5.0; for notes on earlier versions, see the "Old revisions" |
- | For records that have multiple geographic features, only the first feature that falls within the search box is plotted in the search results. | + | |
- | + | ||
- | + | ||
- | ===== Customizing the Geographic Search & Display Code ===== | + | |
- | The code for the geographic search & display features can be viewed on github here: [[https:// | + | |
If you want to customize the Geographic Display code, you will need to modify these files: | If you want to customize the Geographic Display code, you will need to modify these files: | ||
* RecordTab/ | * RecordTab/ | ||
- | * js/map_tab_ol.js (OpenLayers javascript code) | + | * js/map_tab_leaflet.js |
* RecordTab/ | * RecordTab/ | ||
* RecordTab/ | * RecordTab/ | ||
* RecordDriver/ | * RecordDriver/ | ||
+ | * GeoFeatures/ | ||
+ | |||
If you want to customize the Geographic Search code, you will need to modify these files: | If you want to customize the Geographic Search code, you will need to modify these files: | ||
Line 208: | Line 182: | ||
* search/ | * search/ | ||
* root/ | * root/ | ||
- | * js/map_selection.js | + | * js/map_selection_leaflet.js |
* Recommend/ | * Recommend/ | ||
+ | * GeoFeatures/ | ||
+ | |||
* View/ | * View/ | ||
The following files support both the Geographic Display and Geographic Search code: | The following files support both the Geographic Display and Geographic Search code: | ||
- | OpenLayers 3.17.1 | + | Leaflet |
- | * js/vendor/ol/ol.js , ol-debug.js | + | * js/vendor/leaflet/* |
- | * css/vendor/ol/ol.css | + | * css/vendor/leaflet/* |
+ | |||
+ | configuration file: | ||
+ | * geofeatures.ini | ||
+ | |||
+ | Helper methods: | ||
+ | * GeoFeatures/ | ||
+ | * GeoFeatures/ | ||
+ | * GeoFeatures/ | ||
RecordDriver/ | RecordDriver/ | ||
- | * getLongLat :!: //VuFind 3.1. only// | ||
* getGeoLocation | * getGeoLocation | ||
* getDisplayCoordinates | * getDisplayCoordinates | ||
Line 226: | Line 210: | ||
CSS styling – add geoItem class for pop-ups to these files: | CSS styling – add geoItem class for pop-ups to these files: | ||
* css/ | * css/ | ||
+ | * css/ | ||
* less/ | * less/ | ||
+ | ===== Additional Resources ===== | ||
+ | |||
+ | For an overview of these features as they were originally developed for VuFind® 3.1, you can [[https:// | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : lmgonzales | ||
---- | ---- | ||
configuration/geographic_features.txt · Last modified: 2023/10/24 19:25 by lmgonzales