Commit c1b2aad2 authored by Stefan Funk's avatar Stefan Funk 🐧
Browse files

Merge branch 'geolocate-options' into 'develop'

Add OSM and GeoNames as options for batch-geocoding

See merge request !7
parents 935fe88c 4c90a757
......@@ -12,6 +12,7 @@ Bugfix Version 3.6.9 (June 2021)
* Fix #51 (Import KML files)
* Fix #48 (We would need a "Set only for some places named" button)
* Fix #26 (Message when no content in Address field)
* Add options for batch-geocoding with OSM and Geonames
Bugfix Version 3.6.8 (June 2021)
================================
......
......@@ -143,13 +143,21 @@
<div id="content" class="primary-area">
<div id="tgnArea" class="well span6">
<h3>Place selection &nbsp; <img id="spinningGeolocationCompletionFlower" class="hide" src="https://res.de.dariah.eu/dhrep/img/spinning-flower_slow.gif" alt="Geolocation completion running" width="22" /></h3>
<label for="geolocationSource">Geolocation can be based either on column <i>Address</i> or on column <i>GettyID</i> in your datasheet. Existing entries will not be overwritten. Choose which one to use: </label>
<select name="geolocationSource" id="geolocationSource">
<label for="geolocationSource">Geolocation can be based either on the <i>Getty Thesaurus of Geographic Names (TGN)</i>, <i>OpenStreetMap (OSM)</i>, or <i>GeoNames</i>. Choose which geolocator to use: </label>
<select name="geolocationSource" id="geolocationSource" onchange="toggleTGNOptions()">
<option value="TGN">TGN</option>
<option value="OSM">OSM (Nominatim)</option>
<option value="GeoNames">GeoNames</option>
</select>
<div id = tgnOptions>
<label for="geolocationColumnSource">TGN search can be based on column <i>Address</i> or on column <i>GettyID</i> in your datasheet. Choose which one to use: </label>
<select name="geolocationColumnSource" id="geolocationColumnSource">
<option value="Address">Address</option>
<option value="GettyID">GettyID</option>
</select>
<p>The coordinates for the first place found in the TGN are automatically added to the sheet, you may have to adjust the places below!</p>
<p><i class="icon-pencil"></i>&nbsp; sets all places in the sheet with the highlighted address to the coordinates of the chosen place.<br/>
</div>
<p>The coordinates for the first place found are automatically added to the sheet if no existing entries are available. If there are multiple results, you may have to adjust the places manually!</p>
<p><i class="icon-pencil"></i>&nbsp; sets all places in the sheet with the highlighted address to the coordinates of the chosen place. This will overwrite existing entries!<br/>
<i class="icon-eye-open"></i>&nbsp; shows the chosen place in the <i>Map selection</i> and allows you to correct and refine coordinates or set unrecognized places.</p><br/>
<div id="tgnList"></div>
</div>
......@@ -167,7 +175,7 @@
</div>
<div>
<i>Note: 'Set' will overwrite coordinates for <b>all</b> table rows matching this place unless you only select specific rows or cells first.</i>
<br/>
<p></p>
</div>
<div id="editMap" class="osmMap"></div>
<br/>
......@@ -226,7 +234,7 @@
<div class="primary-area main-content-wrapper">
<h3>Add geocoordinates</h3>
<p>Geocoordinates for places from the <strong>Address</strong> field can be added with the Getty Thesaurus Service.</p>
<button id="geolocationCompletionButton" class="btn" style="width:100%;" onClick="startTGN();" title="Have a look at the places the Address fields of your dataset do match. Please choose the ones that fit for your places.">
<button id="geolocationCompletionButton" class="btn" style="width:100%;" onClick="startGeocoding();" title="Have a look at the places the Address fields of your dataset do match. Please choose the ones that fit for your places.">
<i class="icon-globe"></i>
&nbsp;Geolocation completion
</button>
......
......@@ -36,5 +36,5 @@ var tgnMatchURL = 'https://ref.de.dariah.eu/tgn/v1/exact-match';
var ognURL = 'https://ref.de.dariah.eu/geonames/postalCodeSearchJSON';
var ognUsername = 'dariahde';
var osmSearchUrl = 'https://nominatim.openstreetmap.org/search';
var noResults = 'No results in TGN, please try map selection.';
var noResults = 'No results, please try map selection.';
var maxCharsPerTitle = 55;
This diff is collapsed.
......@@ -277,6 +277,8 @@ function updateCoordinates(address, lat, long, gettyId, forceOverwrite, variant)
if (!variant) {
variant = "";
}
lat = String(lat); // Longitude/latitude fields expect text values
long = String(long);
var arr = tableInstance.getData();
var addressColumn = findColumn(arr, 'Address');
var longColumn = findColumn(arr, 'Longitude');
......@@ -293,6 +295,7 @@ function updateCoordinates(address, lat, long, gettyId, forceOverwrite, variant)
} else if (!isEmptyString(gettyId) && $.trim(val[gettyColumn]) === $.trim(gettyId)){ //update by GettyID
writeTableCell(forceOverwrite, val[longColumn], index, longColumn, long);
writeTableCell(forceOverwrite, val[latColumn], index, latColumn, lat);
//addresses cannot be overwritten
writeTableCell(false, val[addressColumn], index, addressColumn, address);
save = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment