This document contains instructions for setting up a process to get private well data from the MA DEP, updating it via the web or via Android device, and mapping it.
You can view a map of the well locations here.
These instructions are for getting a new town online. This process is only necessary once--when DEP first sends the well data spreadsheet for a new town.
If you don’t see an Upload settings box, the document may upload as an Excel file and not a Google spreadsheet. In this case:
Once the town’s data is saved as a Google spreadsheet, change all the column headers as follows. This is important because the column names must match the Memento template being used to enter data in the field.
Open the Well Data Columns Headers spreadsheet (also in the well data folder). This doc has the column names that you’ll paste into the well data spreadsheet.
Select the first (and only) row of data.
Copy the row
Go back to the well data Google spreadsheet and select the first (i.e., header) row of data. Paste the new column names over them.
The column names now match those being used by Memento, and there are a few extra columns that will be used to capture additional information (like corrected latitude and longitude) and for geocoding.
Fill in well_town column with the town name.
Fill in the first row of the Corrected_Latitude column with the
following formula and copy it to each cell in the column:
=if(NOT(AE2=""),SPLIT(AE2,":"),"")
Note: You might not see any data in the cells after putting in the formula. But you’ll be able to see the formula in the upper-left of the spreadsheet.
=Concatenate(C2, " ", D2,", ",AH2,", MA")
=if(NOT(AE2=""),CONCATENATE(AF2,",",AG2),IF(NOT(V2=""),CONCATENATE(V2,",",W2),AI2))
This is a one-time setup process for converting the town’s well data into a Fusion Table.
You should now see the new fusion table with the town’s well data.
Tell the fusion table which column will be used for geocoding. It probably guessed which columns contained location data during the import, and it probably guessed wrong, so this is a one-time step to fix that.
Choose Edit-->Change columns from the menu.
When the list of all columns appears, scroll down and click the the geocode column.
Over on the right, change the column’s Type to Location
Click Save
If there are columns other than geocode that are set to a Location type, change those. For example:
After making sure geocode is the only Location column, click Save
Before going any further, make sure the fusion table is working and is able to create a map based on the addresses and coordinates you’ve imported.
Each Google fusion table has a unique id. You’ll need to copy the id of this table to use later.
Now that you’ve created a fusion table based on the town spreadsheet, go back to the spreadsheet and add a script that will send future spreadsheet updates (for example, information coming from the field) to the fusion table.This is a one-time step.
Add the Library to the Script
Choose Resources > Libraries in the menu
When asked to Rename Project, pick a name for the script (the town name, for example)
Click Save
Copy this script into the script editor
function onOpen() {
FRCOGLibrary.onOpen();
};
function updateFusion() {
FRCOGLibrary.updateFusion('FUSION_TABLE_ID');
}
Replace FUSION_TABLE_ID with the real one from the Get Fusion Table ID instructions (above).
For Example:
FRCOGLibrary.updateFusion('MMiALGiK47y1isc3wcE1li1S-o4wWKLZ2');
Save and close the script editor
Reload the spreadsheet, you should have a menu called “Data Update Functions”
Can take as long as a minute the first time
Choose Data Update Functions > Update Fusion Data
You will have to authorize the script the first time it runs.
Click OK to authorize the script
Choose Data Update Functions > Update Fusion Data again
You should see a message that the fusion table has been updated successfully
If not, email us with the error message that shows (see contact info below)
After the update completes, go back to the Fusion table and re-geocode everything:
File-->Geocode…
There are two ways to update a town’s well data:
Assuming the initial setup of the town’s Google spreadsheet was done correctly (see above):
See these instructions for using Memento.
One-Time Setup
Options for taking multiple fusion tables (one for each town) into a single map:
Option 1: use layers to create a new map
https://support.google.com/fusiontables/answer/2592769?hl=en&ref_topic=2592807
sample code:
http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/multiple_layers_per_map.html
wizard:
http://fusion-tables-api-samples.googlecode.com/svn/trunk/FusionTablesLayerWizard/src/index.html
Option 2: merge tables into one table, then map
https://support.google.com/fusiontables/answer/171254?hl=en&ref_topic=2572284
Note that there is a limit of 8 tables to merge onto a single map.
Other resources:
http://michelleminkoff.com/2011/08/21/how-to-combine-multiple-fusion-tables-into-one-map/
How the Data Update Function menu works
There is a code library in the “FRCOG Library” spreadsheet in “MA Wells”. Open it, then open the script editor.
There are instructions at the top of the file to save a version and update library version usage which you must follow.
The Google spreadsheet columns names must match the column names in the Memento template. These column names are stored in the Well Data Column Headers spreadsheet (for easy copy & paste) and are also below:
WELL_COMPLETION_ID WELL_LOCATION WELL_STREET_NUMBER WELL_STREET_NAME PROPERTY_OWNER WELL_SUB_NAME OWNER_ADDRESS OWNER_STREET_NUMBER OWNER_STREET_NAME OWNER_CITY ASSESSORS_LOT ASSESSORS_MAP BOH_DATE_ISSUED DEPTH_TO_BEDROCK BOH_PERMIT WC_DATE COMMENTS FIRM WELL_TYPE SUPERVISING_DRILLER WC_DEPTH LATITUDE LONGITUDE LATD LATM LONGD LONGM FIELD_NOTES DATE_CORRECTED ignore_this_field FIELD_LOCATION Corrected_Latitude Corrected_Longitude well_town well_address geocode