Skip to content

Commit bf59401

Browse files
authored
Merge pull request #30 from OpenGeoscience/descriptions
Data descriptions, file headers and ansible fixes
2 parents bafeb2e + 0b7ddde commit bf59401

52 files changed

Lines changed: 1076 additions & 45 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ansible/Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Vagrant.configure("2") do |config|
1212
# Ref: https://github.com/Kitware/minerva/pull/98#issuecomment-139023062
1313
config.vm.network "private_network", ip: "192.168.33.12"
1414
geoservices.vm.provider :virtualbox do |vb|
15-
vb.customize [ "modifyvm", :id, "--name", "geoservices","--memory", 4096 ]
15+
vb.customize [ "modifyvm", :id, "--name", "geoservices","--memory", 6144 ]
1616
end
1717
geoservices.vm.provision "ansible" do |ansible|
1818
ansible.playbook = "playbook.yml"

ansible/roles/dataqs/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
ignore_errors: yes
9494

9595
- name: create geoserver data directory
96-
file: path=/var/lib/tomcat7/webapps/geoserver/data/data/geonode/forecast_io_airtemp recurse=yes owner=tomcat7 group=tomcat7 state=directory mode=g+rws
96+
file: path=/var/lib/tomcat7/webapps/geoserver/data/data/geonode/forecast_io_airtemp recurse=yes owner=tomcat7 group=tomcat7 state=directory mode=774
9797
sudo: yes
9898

9999
- include: geoserver_permissions.yml

ansible/roles/dataqs/templates/dataq_settings.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,37 +135,43 @@
135135
'name': 'US State Boundaries',
136136
'url': 'https://hifld-dhs-gii.opendata.arcgis.com/datasets/718791120f6549708cb642dac6ff0dbf_0.geojson',
137137
'table': 'us_state_boundaries',
138-
'sld': 'polygon'
138+
'sld': 'polygon',
139+
'description': 'This dataset represents States and equivalent entities, which are the primary governmental divisions of the United States. The TIGER/Line shapefiles and related database files (.dbf) are an extract of selected geographic and cartographic information from the U.S. Census Bureau\'s Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB). The MTDB represents a seamless national file with no overlaps or gaps between parts, however, each TIGER/Line shapefile is designed to stand alone as an independent data set, or they can be combined to cover the entire nation. In addition to the fifty States, the Census Bureau treats the District of Columbia, Puerto Rico, and each of the Island Areas (American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands) as the statistical equivalents of States for the purpose of data presentation. \n\nSource: Homeland Infrastructure Foundation-Level Data (HIFLD) @ https://hifld-dhs-gii.opendata.arcgis.com/datasets/718791120f6549708cb642dac6ff0dbf_0'
139140
},
140141
{
141142
'name': 'US County Boundaries',
142143
'url': 'https://hifld-dhs-gii.opendata.arcgis.com/datasets/53270fe7036f428fbfb11c4511994a6f_0.geojson',
143144
'table': 'us_county_boundaries',
144-
'sld': 'polygon'
145+
'sld': 'polygon',
146+
'description': 'This dataset represents a seamless national county file with no overlaps or gaps between parts, however, each TIGER/Line shapefile is designed to stand alone as an independent data set, or they can be combined to cover the entire nation. The primary legal divisions of most states are termed counties. In Louisiana, these divisions are known as parishes. In Alaska, which has no counties, the equivalent entities are the organized boroughs, city and boroughs, municipalities, and for the unorganized area, census areas. The latter are delineated cooperatively for statistical purposes by the State of Alaska and the Census Bureau. In four states (Maryland, Missouri, Nevada, and Virginia), there are one or more incorporated places that are independent of any county organization and thus constitute primary divisions of their states. These incorporated places are known as independent cities and are treated as equivalent entities for purposes of data presentation. The District of Columbia and Guam have no primary divisions, and each area is considered an equivalent entity for purposes of data presentation. The Census Bureau treats the following entities as equivalents of counties for purposes of data presentation: Municipios in Puerto Rico, Districts and Islands in American Samoa, Municipalities in the Commonwealth of the Northern Mariana Islands, and Islands in the U.S. Virgin Islands. The entire area of the United States, Puerto Rico, and the Island Areas is covered by counties or equivalent entities. The boundaries for counties and equivalent entities are mostly as of January 1, 2013, primarily as reported through the Census Bureau\'s Boundary and Annexation Survey (BAS). However, some changes made after January 2013, including the addition and deletion of counties, are included. \n\nSource: Homeland Infrastructure Foundation-Level Data (HIFLD) @ https://hifld-dhs-gii.opendata.arcgis.com/datasets/53270fe7036f428fbfb11c4511994a6f_0'
145147
},
146148
{
147149
'name': 'US Urban Areas',
148150
'url': 'https://hifld-dhs-gii.opendata.arcgis.com/datasets/12076211b9f047aca1153cb079bbd923_0.geojson',
149151
'table': 'us_urban_areas',
150-
'sld': 'polygon'
152+
'sld': 'polygon',
153+
'description': 'This dataset represents urban areas that represent densely developed territory, encompassing residential, commercial, and other nonresidential urban land uses. In general, this territory consists of areas of high population density and urban land use resulting in a representation of the "urban footprint." There are two types of urban areas: urbanized areas (UAs) that contain 50,000 or more people and urban clusters (UCs) that contain at least 2,500 people, but fewer than 50,000 people (except in the U.S. Virgin Islands and Guam which each contain urban clusters with populations greater than 50,000). Each urban area is identified by a 5-character numeric census code that may contain leading zeroes. \n\nSource: Homeland Infrastructure Foundation-Level Data (HIFLD) @ https://hifld-dhs-gii.opendata.arcgis.com/datasets/12076211b9f047aca1153cb079bbd923_0'
151154
},
152155
{
153156
'name': 'Poultry Slaughtering and Processing Facilities ',
154157
'url': 'https://hifld-dhs-gii.opendata.arcgis.com/datasets/b6b9cc72fb58476d92056d5c7ed25f8b_0.geojson',
155158
'table': 'poultry_facilities',
156-
'sld': 'point'
159+
'sld': 'point',
160+
'description': 'This dataset represents facilities which engage in slaughtering, processing, and/or warehousing for the purpose of producing poultry and egg products. Facilities where poultry is raised or where eggs are laid are not included in this dataset, as they are included in a separate layer. \n\nThe source data used for this data layer does not include any facilities in American Samoa, the US Virgin Islands, or Wyoming. Records with "-DOD" appended to the end of the [NAME] value are located on a military base, as defined by the Defense Installation Spatial Data Infrastructure (DISDI) military installations and military range boundaries. \n\nAt the request of NGA, text fields in this dataset have been set to all upper case to facilitate consistent database engine search results. At the request of NGA, all diacritics (e.g., the German umlaut or the Spanish tilde) have been replaced with their closest equivalent English character to facilitate use with database systems that may not support diacritics. The currentness of this dataset is indicated by the [CONTDATE] field. Based upon this field, the oldest record dates from 01/22/09 and the newest record dates from 07/10/09. \n\nThe following use cases describe how the data may be used and help to define and clarify requirements.\n\n1) A threat against agricultural facilities has been identified and protective measures must be taken to protect the food supply.\n2) A disaster has occurred, or is in the process of occurring, and facilities in the vicinity must be identified in order to comprehensively evacuate and secure the area.\n\nTGS was not tasked with ensuring the completeness of this layer.\n\nSource: Homeland Infrastructure Foundation-Level Data (HIFLD) @ https://hifld-dhs-gii.opendata.arcgis.com/datasets/b6b9cc72fb58476d92056d5c7ed25f8b_0'
157161
},
158162
{
159163
'name': 'State Fairgrounds',
160164
'url': 'https://hifld-dhs-gii.opendata.arcgis.com/datasets/7f35881c8860490ab6a76516978e9e15_0.geojson',
161165
'table': 'state_fairgrounds',
162-
'sld': 'point'
166+
'sld': 'point',
167+
'description': 'This dataset represents the locations of the major state/regional agricultural fairs held throughout the United States. This dataset displays the locations and other pertinent information about the state level agricultural fairs held throughout the United States. It aids in providing the situational awareness for the agricultural sector, as well as the high value symbolic sector. Not only are the fairs gathering places for large numbers of livestock that then disperse, but large numbers of people congregate at these fairs. Additionally, other events--such as gun shows, arts & crafts shows, trade shows, etc.--are held at the fairgrounds locations through the year.\n\nSome states (e.g., Alaska) have multiple state fairground sites. Hawaii holds its main state fair event at the Aloha Bowl, but does not have any other specific state fairground facility. Rhode Island and Connecticut do not hold specific state fair events--just regional events. In summary, 47 states have at least 1 record within this database, while Hawaii, Connecticut, and Rhode Island are not represented. There are no state fair events represented in any of the major U.S. territories (e.g., Puerto Rico).\n\nSource: Homeland Infrastructure Foundation-Level Data (HIFLD) @ https://hifld-dhs-gii.opendata.arcgis.com/datasets/7f35881c8860490ab6a76516978e9e15_0'
163168
},
164169
{
165170
'name': 'EPA Emergency Response (ER) Toxic Substances Control Act (TSCA) Facilities',
166171
'url': 'https://hifld-dhs-gii.opendata.arcgis.com/datasets/5e2d8818b8ca4dbc8f14ea2e118b9a86_0.geojson',
167172
'table': 'epa_tsca_facilities',
168-
'sld': 'point'
173+
'sld': 'point',
174+
'description': 'This dataset represents integrated facility information from FRS, limited to the subset of facilities that link to the Toxic Substances Control Act (TSCA). This subset of data was identified as information that can be used in the Hazardous Materials Emergency Support Function #10. Additional contact, state ids, NAICs, and SIC attributes are linked by registry id. It contains only active facilities. This feature contains location and facility identification information from EPA\'s Facility Registry System (FRS) for the subset of facilities that link to the Toxic Substances Control Act (TSCA) System. The TSCA database supports the Toxic Substances Control Act (TSCA) of 1976, which provides EPA with authority to require reporting, record-keeping and testing requirements, and restrictions relating to chemical substances and/or mixtures. Certain substances are generally excluded from TSCA, including, among others, food, drugs, cosmetics and pesticides. TSCA addresses the production, importation, use, and disposal of specific chemicals including polychlorinated biphenyls (PCBs), asbestos, radon and lead-based paint.FRS identifies and geospatially locates facilities, sites or places subject to environmental regulations or of environmental interest. Using vigorous verification and data management procedures, FRS integrates facility data from EPA\'s national program systems, other federal agencies, and State and tribal master facility records and provides EPA with a centrally managed, single source of comprehensive and authoritative information on facilities. This data set contains the subset of FRS integrated facilities that link to TSCA facilities once the TSCA data has been integrated into the FRS database. Additional information on FRS is available at the EPA website http://www.epa.gov/enviro/html/fii/index.html.\n\nSource: Homeland Infrastructure Foundation-Level Data (HIFLD) @ https://hifld-dhs-gii.opendata.arcgis.com/datasets/5e2d8818b8ca4dbc8f14ea2e118b9a86_0'
169175
}
170176
]
171177

ansible/roles/geonode/tasks/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@
9999
lc_ctype='en_US.UTF-8'
100100
owner={{db_user}}
101101
template='template0'
102-
sudo: yes
103-
sudo_user: postgres
104102
retries: 2
105103
delay: 5
106104

@@ -112,14 +110,14 @@
112110
owner={{db_user}}
113111
template='template0'
114112
sudo: yes
115-
sudo_user: postgres
113+
sudo_user: root
116114
retries: 2
117115
delay: 5
118116

119117
- name: add postgis to the {{db_data_instance}} db
120118
postgresql_ext: name=postgis db={{db_data_instance}}
121119
sudo: yes
122-
sudo_user: postgres
120+
sudo_user: root
123121

124122
- name: make manage executable for ansible >= 2.0
125123
file: path={{app_code_dir}}/{{app_name}}/manage.py mode=0770

ansible/roles/geoserver/tasks/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
- name: copy the Tomcat setenv.sh file to /usr/share/tomcat7/bin
1717
template: src=setenv.sh dest=/usr/share/tomcat7/bin/setenv.sh
1818
sudo: yes
19-
notify: restart tomcat
19+
20+
- name: copy the tomcat7 file to /etc/default
21+
template: src=tomcat7 dest=/etc/default/tomcat7
22+
sudo: yes
2023

2124
- name: Download Geoserver (remote)
2225
sudo: yes
@@ -26,3 +29,8 @@
2629
owner=0
2730
group=0
2831
mode=0644
32+
33+
- name: Restart Tomcat
34+
service: name=tomcat7 state=restarted
35+
sudo: yes
36+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
2+
# default of tomcat7.
3+
TOMCAT7_USER=tomcat7
4+
5+
# Run Tomcat as this group ID. Not setting this or leaving it blank will use
6+
# the default of tomcat7.
7+
TOMCAT7_GROUP=tomcat7
8+
9+
# The home directory of the Java development kit (JDK). You need at least
10+
# JDK version 1.5. If JAVA_HOME is not set, some common directories for
11+
# OpenJDK, the Sun JDK, and various J2SE 1.5 versions are tried.
12+
JAVA_HOME=/usr/lib/jvm/java-8-oracle
13+
14+
# You may pass JVM startup parameters to Java here. If unset, the default
15+
# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
16+
#
17+
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
18+
# response time). If you use that option and you run Tomcat on a machine with
19+
# exactly one CPU chip that contains one or two cores, you should also add
20+
# the "-XX:+CMSIncrementalMode" option.
21+
JAVA_OPTS="-Djava.awt.headless=true -XX:+UseConcMarkSweepGC"
22+
23+
# To enable remote debugging uncomment the following line.
24+
# You will then be able to use a java debugger on port 8000.
25+
#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
26+
27+
# Java compiler to use for translating JavaServer Pages (JSPs). You can use all
28+
# compilers that are accepted by Ant's build.compiler property.
29+
#JSP_COMPILER=javac
30+
31+
# Use the Java security manager? (yes/no, default: no)
32+
#TOMCAT7_SECURITY=no
33+
34+
# Number of days to keep logfiles in /var/log/tomcat7. Default is 14 days.
35+
#LOGFILE_DAYS=14
36+
# Whether to compress logfiles older than today's
37+
#LOGFILE_COMPRESS=1
38+
39+
# Location of the JVM temporary directory
40+
# WARNING: This directory will be destroyed and recreated at every startup !
41+
#JVM_TMP=/tmp/tomcat7-temp
42+
43+
# If you run Tomcat on port numbers that are all higher than 1023, then you
44+
# do not need authbind. It is used for binding Tomcat to lower port numbers.
45+
# NOTE: authbind works only with IPv4. Do not enable it when using IPv6.
46+
# (yes/no, default: no)
47+
#AUTHBIND=no

ansible/roles/postgres_postgis/tasks/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,5 @@
3232
role_attr_flags=LOGIN,CREATEDB,NOSUPERUSER
3333
# in case the user already exists
3434
ignore_errors: True
35-
sudo: yes
36-
sudo_user: postgres
3735
notify:
3836
- restart postgres_postgis

ansible/roles/postgres_postgis/templates/pg_hba.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local all postgres peer
1+
local all postgres trust
22
local all geonode trust
33
local all all trust
44
host all all 127.0.0.1/32 md5

dataqs/airnow/airnow.py

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
from __future__ import absolute_import
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
###############################################################################
5+
# Copyright Kitware Inc. and Epidemico Inc.
6+
#
7+
# Licensed under the Apache License, Version 2.0 ( the "License" );
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
###############################################################################
219

20+
from __future__ import absolute_import
321
from ftplib import FTP
422
import logging
523
import os
@@ -32,6 +50,31 @@ class AirNowGRIB2HourlyProcessor(GeoDataMosaicProcessor):
3250
"airnow_aqi_combined"]
3351
img_patterns = ["", "_pm25", "_combined"]
3452
layer_titles = ["Ozone", "PM25", "Combined Ozone & PM25"]
53+
description = """
54+
U.S. Environmental Protection Agency’s (EPA) nationwide, voluntary program,
55+
AirNow(www.airnow.gov), provides real-time air quality data and forecasts to
56+
protect public health across the United States, Canada, and parts of Mexico.
57+
AirNowreceives real-time ozone and PM2.5data from over 2,000 monitors and
58+
collects air quality forecasts for more than 300 cities.
59+
60+
As part of the Global Earth Observation System of Systems (GEOSS)
61+
(www.epa.gov/geoss) program, the AirNow API system broadens access to AirNowdata
62+
and data products. AirNow API produces data products in several standard data
63+
formats and makes them available via FTP and web services. This document
64+
describes the GRIB2 file formats.
65+
66+
All data provided by AirNow API are made possible by the efforts of more than
67+
120 local, state, tribal, provincial, and federal government agencies
68+
(www.airnow.gov/index.cfm?action=airnow.partnerslist). These data are not fully
69+
verified or validated and should be considered preliminary and subject to
70+
change. Data and information reported to AirNow from federal, state, local, and
71+
tribal agencies are for the express purpose of reporting and forecasting the
72+
Air Quality Index (AQI). As such, they should not be used to formulate or
73+
support regulation, trends, guidance, or any other government or public
74+
decision making. Official regulatory air quality data must be obtained from
75+
EPA’s Air Quality System (AQS) (www.epa.gov/ttn/airs/airsaqs). See the AirNow
76+
Data Exchange Guidelines at http://airnowapi.org/docs/DataUseGuidelines.pdf.
77+
"""
3578

3679
def download(self, auth_account=AIRNOW_ACCOUNT, days=1):
3780
"""
@@ -118,7 +161,8 @@ def run(self, days=1):
118161
with open(os.path.join(
119162
script_dir, 'resources/airnow.sld')) as sld:
120163
self.set_default_style(layer_name, layer_name, sld.read())
121-
self.update_geonode(layer_name, title=layer_title, store=layer_name)
164+
self.update_geonode(layer_name, title=layer_title,
165+
description=self.description, store=layer_name)
122166
self.truncate_gs_cache(layer_name)
123167
self.cleanup()
124168

dataqs/airnow/tasks.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
###############################################################################
5+
# Copyright Kitware Inc. and Epidemico Inc.
6+
#
7+
# Licensed under the Apache License, Version 2.0 ( the "License" );
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
###############################################################################
19+
120
from __future__ import absolute_import
221

322
from celery import shared_task

0 commit comments

Comments
 (0)