Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geographic search and display #722

Merged
merged 311 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
311 commits
Select commit Hold shift + click to select a range
c47c3fa
Update map_tab.js
lmgonzales Jun 30, 2016
26d71bf
Update map_selection.js
lmgonzales Jun 30, 2016
4b1c9f9
Update map_tab.js
lmgonzales Jun 30, 2016
14897a0
moved file to js/vendor/ol
lmgonzales Jun 30, 2016
819be02
moved file to js/vendor/ol/
lmgonzales Jun 30, 2016
f997d03
moved file from js/ol/ to js/vendor/ol/
lmgonzales Jun 30, 2016
565c6ae
deleted file because I moved it to js/vendor/ol/
lmgonzales Jun 30, 2016
2102e91
Update MapSelection.phtml
lmgonzales Jun 30, 2016
82dcdde
Update map.phtml
lmgonzales Jun 30, 2016
794c28b
Update map_selection.js
lmgonzales Jun 30, 2016
cf65bca
Update map_tab.js
lmgonzales Jun 30, 2016
fa8b4bb
Update map.phtml
lmgonzales Jun 30, 2016
2296fab
Update MapSelection.phtml
lmgonzales Jun 30, 2016
3b71484
Rename themes/bootstrap3/js/vendor/ol/ol.css to themes/bootstrap3/css…
lmgonzales Jun 30, 2016
e1013c2
Update map_tab.js
lmgonzales Jun 30, 2016
ee4b5dc
Update map_tab.js
lmgonzales Jun 30, 2016
dd5f7e8
Update map_selection.js
lmgonzales Jun 30, 2016
8fd46a8
Update map_tab.js
lmgonzales Jun 30, 2016
6a67bf2
Update map_tab.js
lmgonzales Jun 30, 2016
e0b9f05
Merge branch 'master' into geographic-search-display
demiankatz Jul 11, 2016
797f778
Added missing configuration.
demiankatz Jul 11, 2016
8b1fecb
Moved geographic configs back into Content section
lmgonzales Jul 12, 2016
cb16bd4
Registered geocoords for geo-search in searchbox
lmgonzales Jul 12, 2016
b242e0f
Merge branch 'master' into geographic-search-display
demiankatz Jul 13, 2016
fd81e39
Merge branch 'master' into geographic-search-display
demiankatz Jul 13, 2016
2143677
Merge branch 'master' into geographic-search-display
demiankatz Jul 13, 2016
de0e675
Removed redundant definition.
demiankatz Jul 13, 2016
57e486e
Added passing of $enabled from getGeoCoords
lmgonzales Jul 14, 2016
89760ff
Merge branch 'master' into geographic-search-display
demiankatz Jul 15, 2016
ed91bfb
Update map_selection.js
lmgonzales Jul 16, 2016
d4d3906
Added back supportsAjax method
lmgonzales Jul 16, 2016
2cb38fe
Merge branch 'master' into geographic-search-display
demiankatz Jul 18, 2016
e4d50e6
Refactored record driver methods to base class.
demiankatz Jul 18, 2016
7707766
Check fpr and correct incorrect coordinate order
lmgonzales Jul 18, 2016
39ae926
added global and exported headers code
lmgonzales Jul 19, 2016
e89489e
Added exported and global headers code
lmgonzales Jul 19, 2016
b8e68c5
Eslint code corrections
lmgonzales Jul 19, 2016
527a749
Changed searchbox display to red transparent box
lmgonzales Jul 19, 2016
689eef6
Eslint code fixes
lmgonzales Jul 19, 2016
5a78590
Eslint fixes
lmgonzales Jul 19, 2016
e205972
Eslint fixes
lmgonzales Jul 19, 2016
f5b3094
Eslint fixes
lmgonzales Jul 19, 2016
c237bce
Eslint fixes
lmgonzales Jul 19, 2016
a9e2894
Eslint fixes
lmgonzales Jul 19, 2016
c116620
Eslint fixes
lmgonzales Jul 19, 2016
74cdcbc
Eslint fixes
lmgonzales Jul 19, 2016
cffc261
Eslint fix
lmgonzales Jul 19, 2016
2f6fe52
Eslint fixes
lmgonzales Jul 19, 2016
662eeff
Eslint fixes
lmgonzales Jul 19, 2016
788da51
Update map_selection.js
lmgonzales Jul 19, 2016
e8abc88
Added Geographic Search/Display options
lmgonzales Jul 19, 2016
f7f2f58
Removed Geo Search / Display fields
lmgonzales Jul 19, 2016
bb03654
preservation of GoogleMap functionality
lmgonzales Jul 19, 2016
3db6535
preservation of GoogleMap functionality
lmgonzales Jul 19, 2016
ef53fc3
Update Map.php
lmgonzales Jul 19, 2016
22b48ca
preservation of GoogleMap functionality
lmgonzales Jul 19, 2016
5e17477
Rename map_tab.js to map_tab_ol.js
lmgonzales Jul 19, 2016
b8e4bb0
preservation of GoogleMap functionality
lmgonzales Jul 19, 2016
0f825dc
Update Map.php
lmgonzales Jul 19, 2016
ecf779e
Update map_tab_google.js
lmgonzales Jul 19, 2016
e181694
Update map.phtml
lmgonzales Jul 19, 2016
7426369
Update map_tab_google.js
lmgonzales Jul 19, 2016
5b094ee
ESLint fixes
lmgonzales Jul 19, 2016
f13c7ad
ESLint fixes
lmgonzales Jul 20, 2016
6cce9c3
ESLint fixes
lmgonzales Jul 20, 2016
4f5a311
preservation of GoogleMap functionality
lmgonzales Jul 20, 2016
ffe8dc1
style fix
demiankatz Jul 20, 2016
67bb97e
Merge branch 'master' into geographic-search-display
demiankatz Jul 20, 2016
1f3084b
Typo fix.
demiankatz Jul 20, 2016
2e3122d
Check if configs are set.
demiankatz Jul 20, 2016
ff88eef
ESlint fix.
demiankatz Jul 20, 2016
94cd5cd
Update map_selection.js
lmgonzales Jul 20, 2016
12c81f3
ESLint fixes
lmgonzales Jul 20, 2016
d0322f6
Update map_tab_google.js
lmgonzales Jul 20, 2016
91f5496
Geo-search results clustering
lmgonzales Jul 21, 2016
9249b9d
Geo-search result clustering
lmgonzales Jul 21, 2016
d4a6578
Geo-search results clustering
lmgonzales Jul 21, 2016
6aa7075
Update Factory.php
lmgonzales Jul 21, 2016
87c1910
Update MapSelection.php
lmgonzales Jul 21, 2016
671baec
Update Factory.php
lmgonzales Jul 21, 2016
7c545d0
Update MapSelection.php
lmgonzales Jul 21, 2016
af5b719
Update MapSelection.php
lmgonzales Jul 21, 2016
9826cba
Update MapSelection.php
lmgonzales Jul 21, 2016
8889086
Update MapSelection.php
lmgonzales Jul 21, 2016
52d48d7
Update MapSelection.php
lmgonzales Jul 22, 2016
8fdc766
Update MapSelection.php
lmgonzales Jul 22, 2016
94adb80
Update MapSelection.php
lmgonzales Jul 22, 2016
dd1fc17
Update MapSelection.php
lmgonzales Jul 22, 2016
658bb3a
Geo-search results clustering
lmgonzales Jul 22, 2016
fdcb430
Update map_selection.js
lmgonzales Jul 22, 2016
5c8a590
Update map_selection.js
lmgonzales Jul 22, 2016
a09f91d
Preserve display of search box with search results
lmgonzales Jul 22, 2016
eab1481
Update map_selection.js
lmgonzales Jul 22, 2016
47fc2f2
Update map_selection.js
lmgonzales Jul 22, 2016
2c47e57
Fix error when longitude query params overlap
lmgonzales Jul 22, 2016
559e048
Fixed west coord correction for dateline query
lmgonzales Jul 24, 2016
99b9746
More searchbox corrections for overlapping queries
lmgonzales Jul 24, 2016
fd441c2
Dateline query corrections
lmgonzales Jul 25, 2016
b06f27f
Update for geo-results clustering
lmgonzales Jul 25, 2016
e7fd62e
Update MapSelection.php
lmgonzales Jul 25, 2016
fb9f9d3
Update MapSelection.php
lmgonzales Jul 25, 2016
280a810
Update MapSelection.php
lmgonzales Jul 25, 2016
8bc91ec
Update MapSelection.php
lmgonzales Jul 25, 2016
3717b12
changes for universal indexing
lmgonzales Jul 30, 2016
cdd5c98
updates for universal geo-indexing
lmgonzales Jul 30, 2016
399b3b3
updated for universal geo-indexing
lmgonzales Jul 30, 2016
4b00198
Update for universal geo-indexing
lmgonzales Jul 30, 2016
b72b84e
Update for universal geo-indexing
lmgonzales Jul 30, 2016
1af7c42
bugfix
lmgonzales Jul 30, 2016
9955737
Update for universal geo-indexing
lmgonzales Jul 30, 2016
622dc2b
Updated for universal geo-indexing
lmgonzales Jul 30, 2016
774ad81
Update MapSelection.php
lmgonzales Jul 30, 2016
46048b2
Update MapSelection.php
lmgonzales Jul 30, 2016
cfc92a7
Update Map.php
lmgonzales Jul 30, 2016
a577374
Update for universal geo-indexing
lmgonzales Jul 30, 2016
9025781
Removed files as requested.
demiankatz Aug 1, 2016
12bc220
Removed newlines.
demiankatz Aug 1, 2016
d7b0d68
Merge remote-tracking branch 'origin/master' into geographic-search-d…
demiankatz Aug 1, 2016
048c5a4
Fixed address in comment.
demiankatz Aug 1, 2016
d1b0581
Fixed typo.
demiankatz Aug 1, 2016
ec66bae
Merge branch 'master' into geographic-search-display
demiankatz Aug 1, 2016
860068c
Added geographic test records.
demiankatz Aug 1, 2016
036f29e
Updated with geolocation.bsh code
lmgonzales Aug 2, 2016
603b72f
Updated indexing script name to location.bsh
lmgonzales Aug 2, 2016
f890f38
Allow for coordinate searching via text search
lmgonzales Aug 2, 2016
b1d9c6b
Allow for coordinate search by text search
lmgonzales Aug 2, 2016
faee019
Adjust long_lat_label settings to be display only
lmgonzales Aug 2, 2016
fbe0a1b
Update MapSelection.php
lmgonzales Aug 2, 2016
eb02da8
Update MapSelection.php
lmgonzales Aug 2, 2016
ceb7328
GoogleMapAPI config updates
lmgonzales Aug 2, 2016
65fcbce
Update for GoogleMapAPI configuration
lmgonzales Aug 2, 2016
b55a5d7
Update for GoogleMapAPI configuration
lmgonzales Aug 2, 2016
e58bff8
Update for GoogleMap API configuration
lmgonzales Aug 2, 2016
fe9c625
Update Factory.php
lmgonzales Aug 2, 2016
e3e36ea
Adjust center and zoom level for single points
lmgonzales Aug 2, 2016
45d9ace
Update map_tab_ol.js
lmgonzales Aug 2, 2016
b18b29e
Update map_tab_ol.js
lmgonzales Aug 2, 2016
c3620f1
Removed unnecessary file.
demiankatz Aug 2, 2016
a0607b9
Merge remote-tracking branch 'origin/master' into geographic-search-d…
demiankatz Aug 3, 2016
dbf2f99
avoid null error
demiankatz Aug 3, 2016
0ae9f74
Fixed filename in properties
demiankatz Aug 3, 2016
3c0ebbe
Better null fix
demiankatz Aug 3, 2016
ce546e9
Prefix geo IDs to avoid collisions.
demiankatz Aug 3, 2016
71a9a46
Merge branch 'master' into geographic-search-display
demiankatz Aug 3, 2016
de90130
Minor fixes.
demiankatz Aug 3, 2016
b551f9e
Made ResultGoogleMapAjax module less broken.
demiankatz Aug 3, 2016
9f8170e
fix zoom and checkbox clustermarker bugs
lmgonzales Aug 4, 2016
c4edd3a
fix 4 to 3 verticies change of bbox on zoom.
lmgonzales Aug 5, 2016
e019d31
Removed code for polygon to point conversion
lmgonzales Aug 5, 2016
f973f08
Update to 3.17.1 fixes polygon zoom out issue
lmgonzales Aug 5, 2016
26bbb68
Upgraded to 3.17.1 - fixes polygon zoom issue
lmgonzales Aug 5, 2016
36097ee
upgrade to OL3.17.1
lmgonzales Aug 5, 2016
649c7a7
Merge branch 'master' into geographic-search-display
demiankatz Aug 8, 2016
f821606
Merge branch 'master' into geographic-search-display
demiankatz Aug 8, 2016
6acbb40
Improved comment.
demiankatz Aug 8, 2016
6624d04
Adjusted map tab constructor for simplicity/readability.
demiankatz Aug 8, 2016
ad95080
Merge branch 'master' into geographic-search-display
demiankatz Aug 8, 2016
9a92b45
Merge branch 'master' into geographic-search-display
demiankatz Aug 8, 2016
69285a2
fixed merge marker
demiankatz Aug 8, 2016
a06beda
Refactoring of getMapTabData
lmgonzales Aug 9, 2016
5bf2133
get MapTabData refactoring
lmgonzales Aug 9, 2016
405738c
eslint fixes
lmgonzales Aug 9, 2016
5e1fe27
Fix order of label and coord reading from mapData
lmgonzales Aug 10, 2016
2ec2a28
Update cluster styling
lmgonzales Aug 10, 2016
867ae3d
Refactoring of getMapResultCoordinates
lmgonzales Aug 10, 2016
c21a6e3
eslint updates
lmgonzales Aug 10, 2016
16562d1
Update MapSelection.php
lmgonzales Aug 10, 2016
aae32e9
Update MapSelection.php
lmgonzales Aug 10, 2016
3bf2a91
Update MapSelection.php
lmgonzales Aug 10, 2016
b4c949b
Update MapSelection.php
lmgonzales Aug 10, 2016
91f8cba
refactoring of mapLabels configuration
lmgonzales Aug 10, 2016
52c7bb3
refactoring of mapLabels configuration
lmgonzales Aug 10, 2016
17a20b7
refactoring of mapLabels configuration
lmgonzales Aug 10, 2016
4abb087
Merge branch 'master' into geographic-search-display
demiankatz Aug 10, 2016
d507d95
Fixed typo.
demiankatz Aug 10, 2016
6246617
Minor cleanup.
demiankatz Aug 10, 2016
3ef88c1
Corrected field name.
demiankatz Aug 10, 2016
306a4a9
php-cs-fixer
demiankatz Aug 10, 2016
89fd752
Changed field:long_lat_label to driver
lmgonzales Aug 15, 2016
ea5a61d
Changed field to driver in getMapLabels
lmgonzales Aug 15, 2016
79ecd9e
Refactoring of getMapResultCoordinates()
lmgonzales Aug 15, 2016
effaa0a
minor fix
lmgonzales Aug 15, 2016
87d5296
minor fix
lmgonzales Aug 15, 2016
f1693eb
minor fix
lmgonzales Aug 15, 2016
b975a5b
Move geosearch help into help system
lmgonzales Aug 24, 2016
51d09da
Added help file for geosearch help
lmgonzales Aug 24, 2016
74b998b
updated for geosearch help
lmgonzales Aug 24, 2016
61e5e3a
Merge branch 'master' into geographic-search-display
demiankatz Aug 25, 2016
907822b
Fixed comments.
demiankatz Aug 25, 2016
ffcf647
Adjusted indentation.
demiankatz Aug 25, 2016
00fce77
Simplified geosearch integration.
demiankatz Aug 25, 2016
a15e2fa
Fixed/simplified map label logic.
demiankatz Aug 25, 2016
89d1585
updated to include additional steps
lmgonzales Aug 29, 2016
c316aa5
Bug fix - respond if draw_box button is clicked
lmgonzales Sep 6, 2016
ee64251
Bug fix - respond if draw_box button is clicked
lmgonzales Sep 6, 2016
9ce3db1
Merge remote-tracking branch 'origin/master' into geographic-search-d…
demiankatz Sep 6, 2016
f95ebe1
Display map results only if geosearch was run
lmgonzales Sep 6, 2016
33a23e3
Update to check to see if a geosearch was run
lmgonzales Sep 6, 2016
5b15f75
Update MapSelection.php
lmgonzales Sep 6, 2016
4a4b5a7
Updated to include interaction w search results
lmgonzales Sep 10, 2016
6e707ec
Merge branch 'master' into geographic-search-display
demiankatz Sep 12, 2016
488be7f
add popup info feature
lmgonzales Sep 13, 2016
4617ae4
added popup info feature
lmgonzales Sep 13, 2016
7c45069
added popup info feature
lmgonzales Sep 13, 2016
5c7701d
Fixed typo
lmgonzales Sep 13, 2016
ae97b65
Fixed spacing
lmgonzales Sep 13, 2016
3a48cfa
Fixed spacing
lmgonzales Sep 13, 2016
90d9405
eslint fixes
lmgonzales Sep 13, 2016
de4b094
restyled map tab popup
lmgonzales Sep 14, 2016
461201d
Merge branch 'master' into geographic-search-display
demiankatz Sep 14, 2016
bd1c1a8
Updated test data.
demiankatz Sep 14, 2016
bf63ba6
Style cleanup.
demiankatz Sep 14, 2016
b24f08e
Ported BeanShell to Java.
demiankatz Sep 14, 2016
d379d51
Whitespace cleanup.
demiankatz Sep 14, 2016
3e5185a
eslint fixes
lmgonzales Sep 14, 2016
95c531b
Merge branch 'geographic-search-display' of https://github.com/lmgonz…
lmgonzales Sep 14, 2016
39152e4
fixed positioning of popups
lmgonzales Sep 14, 2016
cf5ebf8
fixed position; added no info msg for empty labels
lmgonzales Sep 14, 2016
f35cc66
bug fix for popups
lmgonzales Sep 14, 2016
b81fc48
Deleted unnecessary html markup
lmgonzales Sep 14, 2016
8adda55
Style fix / code simplification.
demiankatz Sep 15, 2016
e5061d6
add MapSelection to module list; edit config options
lmgonzales Sep 15, 2016
c55dbe2
update configuration parameters
lmgonzales Sep 15, 2016
94bd875
update configuration parameters
lmgonzales Sep 15, 2016
b0527cf
update configuration parameters
lmgonzales Sep 15, 2016
652a832
update configuration parameters
lmgonzales Sep 15, 2016
fca60c4
fix spacing
lmgonzales Sep 15, 2016
66e6a9b
fix spacing
lmgonzales Sep 15, 2016
7312bae
refactoring of getMapResults
lmgonzales Sep 16, 2016
c75407d
fix trailing spaces
lmgonzales Sep 16, 2016
0ef3ffc
fix trailing spaces
lmgonzales Sep 16, 2016
01fcd24
fix empty spaces
lmgonzales Sep 16, 2016
baf5bb8
eslint fix spacing
lmgonzales Sep 16, 2016
971b8dd
Merge branch 'master' into geographic-search-display
demiankatz Sep 16, 2016
638156e
Better geo search detection.
demiankatz Sep 16, 2016
b29b1c0
Made MapSelection slightly more configurable.
demiankatz Sep 16, 2016
d8e8763
Add css class for geoItem - map results popup info
lmgonzales Sep 16, 2016
1c694c3
Add geoItem class for map search popup info
lmgonzales Sep 16, 2016
15050a6
add css class geoItem for map popups
lmgonzales Sep 16, 2016
6c24dec
Merge branch 'geographic-search-display' of https://github.com/lmgonz…
lmgonzales Sep 16, 2016
393b5af
Change popup title to use map_result_label for translation compatibility
lmgonzales Sep 16, 2016
45142ca
eslint fixes
lmgonzales Sep 16, 2016
3f6c484
Merge branch 'master' into geographic-search-display
demiankatz Sep 19, 2016
b48b7a7
Compiled using grunt
demiankatz Sep 19, 2016
da302ff
back to cssBuilder.php; less isn't working right
demiankatz Sep 19, 2016
f4443ad
Minor optimization.
demiankatz Sep 19, 2016
c1c8b5f
Tweaked comments.
demiankatz Sep 19, 2016
b8a0d8d
Turned off [MapSelection] by default.
demiankatz Sep 19, 2016
dc52beb
Updated to include additional coordinate info
lmgonzales Sep 19, 2016
9795a61
Merge branch 'master' into geographic-search-display
demiankatz Sep 20, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions config/vufind/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,29 @@ authors = Wikipedia
; recommendation module in searches.ini for more information)
;europeanaAPI = INSERTKEY

; If this is set, a new map tab will show on the record page for records which
; have long_lat data (see import/marc_local.properties for more information).
; The setting specifies the type of map; currently, the only supported value is
; "google"
;recordMap = google
; Geographic Display
; recordMap can be set to either 'google' or 'openlayers';
; 'google' will only display point features
; 'openlayers' will display point and rectangle features. Default setting
; (see import/marc_local.properties for more information).
; Map Tab Options:
; mapLabels: leave empty, file:filename, or driver
; Leave it empty – no map labels will be displayed (default)
; file:filename - specify a file name after the colon for the
; coordinate/label lookup file. Coordinates in file must
; be specified as WENS.
; driver - Use the getCoordinateLabels method of the record driver to fetch labels;
; by default this relies on the long_lat_label field in Solr,
; but you can override the behavior with custom record driver code.
; The field must be the same length as the number of coordinate sets.
; Coordinates will be matched to labels on an ordered basis such that
; label[0] will be assigned for coordinate[0] and so forth.
; displayCoords: true or false. Default is false. (Only for recordMap = openlayers)
; If displayCoords is true, then the coordinate values from
; coordinate field will be displayed before the map label in the label popup.
recordMap = openlayers
mapLabels = file:geosearch_test_lookup.txt
displayCoords = true

; If you set recordMap = google, then Google requires that you obtain an API key.
; For more information on obtaining an API key, see:
Expand Down
32 changes: 32 additions & 0 deletions config/vufind/searches.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ case_sensitive_ranges = true
; [NoResultsRecommendations] sections below.
; See the comments above those sections for details on legal settings. You may
; repeat these lines to load multiple recommendations.
;default_top_recommend[] = MapSelection ; see [MapSelection] below for details
default_top_recommend[] = TopFacets:ResultsTop
default_top_recommend[] = SpellingSuggestions
;default_top_recommend[] = VisualFacets:Visual_Settings
Expand Down Expand Up @@ -120,6 +121,7 @@ Author = Author
Subject = Subject
CallNumber = "Call Number"
ISN = "ISBN/ISSN"
;Coordinate = Coordinates
tag = Tag

; This section defines which search options will be included on the advanced
Expand All @@ -136,6 +138,8 @@ publisher = adv_search_publisher
Series = adv_search_series
year = adv_search_year
toc = adv_search_toc
;Coordinate = Coordinates


; This section defines the sort options available on standard search results.
; Values on the left of the equal sign are either the reserved term "relevance"
Expand Down Expand Up @@ -317,6 +321,13 @@ CallNumber = callnumber-sort
; AuthorityRecommend:__resultlimit__:50 then authority recommendations will
; only display on result screens displaying fewer than 50 hits; by default,
; recommendations will always display). Filtering is optional.
; MapSelection:[ini section]:[ini name]
; Enable geographic searching capability via OpenLayers3 API by activating
; this module. Records must be indexed using the geographic search and display
; fields. See the marc_local.properties file for more information on indexing.
; Default settings and more comments may be found in the [MapSelection]
; section in this file. The section name and ini file name loaded by the
; module may be overridden through the [ini section]/[ini name] parameters.
; PubDateVisAjax:[zooming]:[facet field 1]:[facet field 2]:...:[facet field n]
; Display a visualization of publication dates for each of the specified facet
; fields. This is designed for a field containing four-digit years. Zooming
Expand Down Expand Up @@ -493,6 +504,7 @@ Author = "Solr:Author:author,author2"
Subject = "Solr:Subject:topic,genre,geographic,era"
CallNumber = "SolrCN"
ISN = "Solr:ISN:isbn,issn"
Coordinate = "None"
tag = "Tag"

; When snippets are enabled, this section can be used to display captions based on
Expand Down Expand Up @@ -607,6 +619,26 @@ view=full
; from the actual record by period, e.g. testsrc.12345)
;sources = alli,testsrc

; This section defines the default parameters for the geographic search
; functionality found in the MapSelection recommendation module.
; To enable this feature, uncomment the default_top_recommend[] = MapSelection
; in the default recommendations section. To set the configuration settings
; for this feature, adjust the parameters below.
[MapSelection]
; This defines the coordinates of a search region that will be highlighted when
; the user clicks the "Geographic Search" link next to the VuFind search box.
; This should ideally cover a large area of the map where most/all of your
; geographic points are located. If your dataset is not concentrated in one
; geographic area, it is advised that you pick a default area, and do not use
; the entire extent of the map for searching (otherwise the search may be slow).
; The default coordinates specified below are in decimal degrees, and are
; 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.
default_coordinates = "-95, 30, 72, 15"
; height: Height in pixels of the map selection interface.
height = 320

; This section defines settings used to fetch similar records.
[MoreLikeThis]
; Boolean value indicating whether the newer MoreLikeThis query handler should be
Expand Down
7 changes: 7 additions & 0 deletions config/vufind/searchspecs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ Subject:
# DismaxFields:
# - topic_unstemmed^150


Coordinate:
DismaxFields:
- long_lat_display
DismaxHandler: edismax

# This field definition is a compromise that supports both journal-level and
# article-level data. The disadvantage is that hits in article titles will
# be mixed in. If you are building a purely article-oriented index, you should
Expand Down Expand Up @@ -264,6 +270,7 @@ AllFields:
- description
- isbn
- issn
- long_lat_display
DismaxHandler: edismax
# ExactSettings:
# DismaxFields:
Expand Down
226 changes: 225 additions & 1 deletion import/index_java/src/org/solrmarc/index/VuFindIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -81,6 +82,10 @@ public class VuFindIndexer extends SolrIndexer
private SimpleDateFormat marc005date = new SimpleDateFormat("yyyyMMddHHmmss.S");
private SimpleDateFormat marc008date = new SimpleDateFormat("yyMMdd");

private static final Pattern COORDINATES_PATTERN = Pattern.compile("^([eEwWnNsS])(\\d{3})(\\d{2})(\\d{2})");
private static final Pattern HDMSHDD_PATTERN = Pattern.compile("^([eEwWnNsS])(\\d+(\\.\\d+)?)");
private static final Pattern PMDD_PATTERN = Pattern.compile("^([+-])(\\d+(\\.\\d+)?)");

private static ConcurrentHashMap<String, Ini> configCache = new ConcurrentHashMap<String, Ini>();

// Shutdown flag:
Expand Down Expand Up @@ -1380,6 +1385,225 @@ public List<String> getDeweySortables(Record record, String fieldSpec) {
}

/**
* The following several methods are designed to get latitude and longitude
* coordinates.
* Records can have multiple coordinates sets of points and/or rectangles.
* Points are represented by coordinate sets where N=S E=W.
*
* code adapted from xrosecky - Moravian Library
* https://github.com/moravianlibrary/VuFind-2.x/blob/master/import/index_scripts/geo.bsh
* and incorporates VuFind location.bsh functionality for GoogleMap display.
*/

/**
* Convert MARC coordinates into bbox_geo format.
*
* @param Record record
* @return List geo_coordinates
*/
public List<String> getAllCoordinates(Record record) {
List<String> geo_coordinates = new ArrayList<String>();
List<VariableField> list034 = record.getVariableFields("034");
if (list034 != null) {
for (VariableField vf : list034) {
DataField df = (DataField) vf;
String d = df.getSubfield('d').getData();
String e = df.getSubfield('e').getData();
String f = df.getSubfield('f').getData();
String g = df.getSubfield('g').getData();
//System.out.println("raw Coords: "+d+" "+e+" "+f+" "+g);

// Check to see if there are only 2 coordinates
// If so, copy them into the corresponding coordinate fields
if ((d !=null && (e == null || e.trim().equals(""))) && (f != null && (g==null || g.trim().equals("")))) {
e = d;
g = f;
}
if ((e !=null && (d == null || d.trim().equals(""))) && (g != null && (f==null || f.trim().equals("")))) {
d = e;
f = g;
}

// Check and convert coordinates to +/- decimal degrees
Double west = convertCoordinate(d);
Double east = convertCoordinate(e);
Double north = convertCoordinate(f);
Double south = convertCoordinate(g);

// New Format for indexing coordinates in Solr 5.0 - minX, maxX, maxY, minY
// Note - storage in Solr follows the WENS order, but display is WSEN order
String result = String.format("ENVELOPE(%s,%s,%s,%s)", new Object[] { west, east, north, south });

if (validateCoordinates(west, east, north, south)) {
geo_coordinates.add(result);
}
}
}
return geo_coordinates;
}

/**
* Get point coordinates for GoogleMap display.
*
* @param Record record
* @return List coordinates
*/
public List<String> getPointCoordinates(Record record) {
List<String> coordinates = new ArrayList<String>();
List<VariableField> list034 = record.getVariableFields("034");
if (list034 != null) {
for (VariableField vf : list034) {
DataField df = (DataField) vf;
String d = df.getSubfield('d').getData();
String e = df.getSubfield('e').getData();
String f = df.getSubfield('f').getData();
String g = df.getSubfield('g').getData();

// Check to see if there are only 2 coordinates
if ((d !=null && (e == null || e.trim().equals(""))) && (f != null && (g==null || g.trim().equals("")))) {
Double long_val = convertCoordinate(d);
Double lat_val = convertCoordinate(f);
String longlatCoordinate = Double.toString(long_val) + ',' + Double.toString(lat_val);
coordinates.add(longlatCoordinate);
}
if ((e !=null && (d == null || d.trim().equals(""))) && (g != null && (f==null || f.trim().equals("")))) {
Double long_val = convertCoordinate(e);
Double lat_val = convertCoordinate(g);
String longlatCoordinate = Double.toString(long_val) + ',' + Double.toString(lat_val);
coordinates.add(longlatCoordinate);
}
// Check if N=S and E=W
if (d.equals(e) && f.equals(g)) {
Double long_val = convertCoordinate(d);
Double lat_val = convertCoordinate(f);
String longlatCoordinate = Double.toString(long_val) + ',' + Double.toString(lat_val);
coordinates.add(longlatCoordinate);
}
}
}
return coordinates;
}

/**
* Get all available coordinates from the record.
*
* @param Record record
* @return List geo_coordinates
*/
public List<String> getDisplayCoordinates(Record record) {
List<String> geo_coordinates = new ArrayList<String>();
List<VariableField> list034 = record.getVariableFields("034");
if (list034 != null) {
for (VariableField vf : list034) {
DataField df = (DataField) vf;
String west = df.getSubfield('d').getData();
String east = df.getSubfield('e').getData();
String north = df.getSubfield('f').getData();
String south = df.getSubfield('g').getData();
String result = String.format("%s %s %s %s", new Object[] { west, east, north, south });
if (west != null || east != null || north != null || south != null) {
geo_coordinates.add(result);
}
}
}
return geo_coordinates;
}

/**
* Check coordinate type HDMS HDD or +/-DD.
*
* @param String coordinateStr
* @return Double coordinate
*/
protected Double convertCoordinate(String coordinateStr) {
Double coordinate = Double.NaN;
Matcher HDmatcher = HDMSHDD_PATTERN.matcher(coordinateStr);
Matcher PMDmatcher = PMDD_PATTERN.matcher(coordinateStr);
if (HDmatcher.matches()) {
String hemisphere = HDmatcher.group(1).toUpperCase();
Double degrees = Double.parseDouble(HDmatcher.group(2));
// Check for HDD or HDMS
if (hemisphere.equals("N") || hemisphere.equals("S")) {
if (degrees > 90) {
String hdmsCoordinate = hemisphere+"0"+HDmatcher.group(2);
coordinate = coordinateToDecimal(hdmsCoordinate);
} else {
coordinate = Double.parseDouble(HDmatcher.group(2));
if (hemisphere.equals("S")) {
coordinate *= -1;
}
}
}
if (hemisphere.equals("E") || hemisphere.equals("W")) {
if (degrees > 180) {
String hdmsCoordinate = HDmatcher.group(0);
coordinate = coordinateToDecimal(hdmsCoordinate);
} else {
coordinate = Double.parseDouble(HDmatcher.group(2));
if (hemisphere.equals("W")) {
coordinate *= -1;
}
}
}
return coordinate;
} else if (PMDmatcher.matches()) {
String hemisphere = PMDmatcher.group(1);
coordinate = Double.parseDouble(PMDmatcher.group(2));
if (hemisphere.equals("-")) {
coordinate *= -1;
}
return coordinate;
} else {
return null;
}
}

/**
* Convert HDMS coordinates to decimal degrees.
*
* @param String coordinateStr
* @return Double coordinate
*/
protected Double coordinateToDecimal(String coordinateStr) {
Matcher matcher = COORDINATES_PATTERN.matcher(coordinateStr);
if (matcher.matches()) {
String hemisphere = matcher.group(1).toUpperCase();
int degrees = Integer.parseInt(matcher.group(2));
int minutes = Integer.parseInt(matcher.group(3));
int seconds = Integer.parseInt(matcher.group(4));
double coordinate = degrees + (minutes / 60.0) + (seconds / 3600.0);
if (hemisphere.equals("W") || hemisphere.equals("S")) {
coordinate *= -1;
}
return coordinate;
}
return null;
}

/**
* Check decimal degree coordinates to make sure they are valid.
*
* @param Double west, east, north, south
* @return boolean
*/
protected boolean validateCoordinates(Double west, Double east, Double north, Double south) {
if (west == null || east == null || north == null || south == null) {
return false;
}
if (west > 180.0 || west < -180.0 || east > 180.0 || east < -180.0) {
return false;
}
if (north > 90.0 || north < -90.0 || south > 90.0 || south < -90.0) {
return false;
}
if (north < south || west > east) {
return false;
}
return true;
}

/**
* THIS FUNCTION HAS BEEN DEPRECATED.
* Determine the longitude and latitude of the items location.
*
* @param record current MARC record
Expand Down Expand Up @@ -1416,7 +1640,7 @@ public String getLongLat(Record record) {
val = val + ',' + val2;
}
}
return val;
return val;
}
}
//otherwise return null
Expand Down
Loading