Admin Places Geocode

From TNG_Wiki
Jump to: navigation, search
Admin Places Geocode
Summary Among other things, establishes the number of desired decimal digits in geocoordinates and rounds all geocoordinates calculated from maps.
Validation
Mod Updated 21 Dec 2020
Download link v13.0.0.6
TNG 13.0
v12.0.0.4
TNG 12.0
Download stats
Author(s) Robin Richmond
Homepage Robin Richmond's Genealogy Database
Mod Support My Mod Support form or TNG Community Forums
Contact Developer My Mod Support form
Latest Mod v13.0.0.6
Min TNG V 10.1
Max TNG V 13.0.2
Files modified
admin_geocodeform.php, admin_geocode.php, admin_editplace.php, googlemaplib2.php, places_help.php, admin_genconfig.php, admin_updateconfig.php
Related Mods
Notes


Purpose of the Mod

Defines an improved workflow for and limits on the batch geocoding process at Admin>>Places>>Geocode

  1. Defines a TNG system parameter that establishes the number of desired decimal digits in geocoodinates (latitude and longitude),
  2. Rounds all geocoodinates that originate in maps (in all TNG programs that do so),
  3. In the Admin>>Places>>Geocode 'batch' Geocoding program:
  4. In Admin>>Places>>Edit, geocoordinates are rounded automatically as they are read from the database (though users can enter and save values with more digits,
    1. Geocoding results are displayed right on the Geocode form, and
    2. New filters can ignore certain problematic placename components.

In the distributed TNG code, admin_geocodeform.php displays the kickoff form, which invokes admin_geocode.php to do the geocoding. After admin_geocode.php displays the results, it displays a link back to the kickoff form in admin_geocodeform.php. This mod moves the PHP code that does geocoding into admin_geocodeform.php so that the results can be displayed on the same web page as another kickoff form. With this change, admin_geocode.php is no longer used at all.

Mod Options

These mod options are custom TNG settings, defined and edited in a Mod Settings Block in the form at Admin>>Setup>>General Settings, in a new subform named Mod Settings Blocks. (In TNGv12, the subform heading is "Robin's Mods") The only mod option is the number of decimal digits that will be saved by various program.

This mod uses its option to affect how geocoordinates are read from Google maps or OpenStretMap, and to affect how geocoordinates are read by the Places Edit page. However, the option is not applied when the Places Edit page saves the geoordinates. Thus, if you type more decimal digits than are specified by the option into the latitude and longitude fields, the longer value will be saved to the database.

Side Effects

This mod modifies TNG's google map PHP functions to round geocoordinate when any program reads geocoordinates from the map, whether that means doing a place search in the map or clicking on the map. This modification affects the Cemetery and Media edit pages without making any changes to those pages.

Compatibility

This mod is compatible with Places Subject to Deletion, Tree ID Mod, Admin Places Search, TreeID-One Column, Placename Format, Google Maps - More Place Levels Mod, and Google maps 15, all of which also affect Admin>>Places.

The Geocode Assist Mod v10.0.0.2 will suppress the Geocode Globe if the place level is set to -1 (Do not Geocode).

If you import your data, this value may not be preserved across an import. See the Do Not Geocode section in the Geocode Assist Mod on how to preserve the value across an import.

Related Mods

  1. The Mod Settings Blocks mod packages this mod's options into what I call a "Mod Settings Block", which is a set of form fields that formatted and labeled so that it stands out among other options in an Admin>>Setting form. The Mod Settings Blocks mod must be installed before this mod can be installed.
  2. The optional mod Inner Mod Menus displays an "Inner Mod Menu" in the TNG "inner menu" (just below the tab menu). The Inner Mod Menu is defined by this mod but is visible only if Inner Mod Menus is installed. It is also visible only to TNG administrators; never to end-users. I highly recommend that you install the Inner Mod Menus mod because Inner Mod Menus provide links to handy information - particularly to the mod settings blocks for this mod's options.
  3. This mod gathers data that can be used by the optional mod Show Mod Names, but there is no dependency on Show Mod Names
  4. Admin Cemetery Edit modifies the Admin>>Cemeteries>>Edit form to use this mod's option (number of decimal digits to which the cemetery geocoordinates will be rounded) as it reads the geocoordinates from the database or writes the geocoordinates to the database.

Installation

In TNGv13, this mod includes a typical mod subfolder, with the same base name as the mod's .cfg file. The subfolder is atypical in that no files in it are installed to working TNG folders. However, it does contain critical files that contain the mod's language strings, which the mod does not add to standard cust_text.php files. Instead, the PHP code modified by this mod loads the language strings from files in the mod's languages/ subfolder. Read more about this technique.

In TNGv12 only, there is a second mod subfolder, which is shared by several mods. The folder RR-shared_mod_includes_v12.0.0.4 contains Include files that help to manage mod options in many of my mods:

  1. rrshared_modsettingsblocks4.php - Mod Settings Blocks
  2. img/rrshared_wikilogo.gif - An icon that links to a mod's TNG Wiki page from a Mod Settings Block

Each mod that contains the shared folder may install some or all of its shared files, depending on whether those files already exist. Once a file from the shared folder has been installed (by any mod), that file will not be overwritten or removed by the subsequent installation or un-installation of any mod (including this one), nor will its presence or absence generate any Mod Manager errors.

If you unzip mod distribution files directly into your mods folder, then the presence of the shared subfolder and the installation of its files should be invisible to you. But if you generally copy mod subfolders to your mods folder after you have unzipped the distribution file, then you need to make sure to copy the folder RR-shared_mod_includes_v12.0.0.4 (well, unless you are confident that it is already in your mods folder because it was part of another mod).

[Show Installation Details]

Requirements

  • A working TNG installation.
  • An installed current version of the Mod Manager.
  • You should backup files listed in the panel on the right.

Procedure

  1. Remove and delete previous version of this mod.
  2. Backup the files updated by this mod. They are listed in the panel at the upper right.
  3. Download the .zip file, Extract its .cfg file to the mods folder.
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files.

Problems?

  1. Try using the Mod Manager Remove capability
  2. Contact me through My Mod Support form.
[Hide Details]

Visualizations

BEFORE: The Admin >> Places >> Geocode Kickoff form, and the results page

Note that the "Reset" checkbox, which causes all "geoignore" flags in the selected tree to be reset, was introduced with TNGv11, but the mod also works for TNGv10.1, which does not have that checkbox.
Admin places geocode-before.png

AFTER: The initial kickoff form

Admin places geocode-after1.png

AFTER: Geocoding results, with the kickoff form on same page

Admin places geocode-after2.png

BEFORE: The Admin >> Places Editor

(It may look a little odd with the map hidden)
Geocode-before-editplace.jpg

AFTER: The Admin >> Places Editor

The "number of decimal digits" option is set to 5. If stored values have more than 5 decimal digits, they will be rounded as they are read, and a note will let the user know that this rounding occurred.
Geocode-after-editplace.jpg

AFTER: New text in the Places help file

Admin places geocode-help.png
This mod also adds text to the "Add New/Edit" section of the help file, but that text is not shown here.

Revision History

Mod Version TNG Version Date Note
13.0.0.6 13.0 - 13.0.2 21 Dec 2020 Upgraded to TNGv13
  • Removed target locations that created and used the 'Do not geocode' placelevel, since that feature is now native to TNGv13
  • Defines the mod option in a Mod Settings Block, and implements the Inner Mod Menu mod.
12.0.0.4 12.0 - 12.2+ 30 Sep 2019 The Mod option at Admin>>Setup>>General Settings>Miscellaneous now use an include file that is shared with other mods.
12.0.0.3a 12.0+ 14Nov2018 Small improvements: Better error checking; deals with trailing spaces, displays the placename before trying to geocode it so that the log will more clearly show where the process crashed.
12.0.0.3 12.0+ 4May2018 No functional changes; made compatible with TNGv12.
12.0.0.3 12.0+ 4May2018 No functional changes; made compatible with TNGv12.
10.1.0.3 10.1 10Nov2017 Defines a TNG system parameter that establishes the number of desired decimal digits in Geocodes and rounds all Geocodes calculated from maps. Provides new filters can ignore certain problematic placename components.
10.1.0.1 10.1 19Apr2017 New mod.

Sites using this mod

If you download and install this mod, please add your site to the table below.

URL User Note Mod-Version TNG-Version User-language
Robin Richmond's Genealogy Database Robin Richmond Mod developer 13.0.0.6 13.0.2 English
Joseph Oran Holtz Genealogy Pages Jim Holt Not a Public Site 10.1.0.3 11.1.2 English
Our Roy and Boucher Family Ken Roy 10.1.0.2 beta 11.1.1 English
Cole / Tanner Family Tree David Cole Public/Private see here see here English
Skeel, Schaffalitzky. Find navne i Danmarks Adels Aarbog Finn Holbek public & private 12.1 DA,EN,DE,CS,ES - etc. Danish
Our Family Histories Bryan S. Larson Public - T8 customized see here see here EN
The Duttons of New England Darrin65 Public / Private 13.0.0.6 13.0.2 EN