US Church List and Database


DOWNLOAD IMMEDIATELY AFTER PURCHASE!
US Churches List and Database
Single-site license
$39.95


The US Churches List and Database download is a very useful tool for Genealogy research, Religious Research, Webmasters, SEO consultants, and Pay Per Click marketers.

Our US Churches List and Database contains 227,725 precise data records for US churches, each with 11 columns of useful data. A church is meant here as any building used for religious worship (chapel, mosque, synagogue, tabernacle, temple). The list also includes 3,247 US county names. Last updated on August 1, 2011. The data is formatted as a CSV file and thus can be easily imported into MySQL (see MySQL instructions below), Microsoft SQL Server, Oracle, PostgreSQL, and any other database. This product is a great time saver and you may use it as an information source, a web site development resource, a religious research project, or for a genealogy development project. In short our product allows you to create applications which target church locations geographically across the country. We understand you are looking for information and you need it right now! No need to wait any longer - our churches database becomes available for immediate download upon purchase.

Fields in the US Churches List and Database


Name Type Description
id Number Unique church record identifier.
church_name Character Official church name as defined in INCITS 446-2008, Identifying Attributes for Named Physical and Cultural Geographic Features (Except Roads and Highways) of the United States, Its Territories, Outlying Areas, and Freely Associated Areas, and the Waters of the Same to the Limit of the Twelve-Mile Statutory Zone.
state_abbrev Character The unique two letter alphabetic code and the unique two number code for a US State as specified in INCITS 38:200x, (Formerly FIPS 5-2) Codes for the Identification of the States, the District of Columbia, Puerto Rico, and the Insular Areas of the United States.
state_code Character
county_name Character The name and unique three number code for a county or county equivalent as specified in INCITS 31:200x, (Formerly FIPS 6-4) Codes for the Identification of Counties and Equivalent Entities of the United States, its Possessions, and Insular Areas.
county_code Character
lat_dms Character The official church location as defined in INCITS 446-2008, Identifying Attributes for Named Physical and Cultural Geographic Features (Except Roads and Highways) of the United States, Its Territories, Outlying Areas, and Freely Associated Areas, and the Waters of the Same to the Limit of the Twelve-Mile Statutory Zone.

NAD 83
DMS-degrees/minutes/seconds
DEC-decimal degrees.

Note: Records showing "Unknown" and zeros for the latitude and longitude DMS and decimal fields, respectively, indicate that the coordinates of the feature are unknown. They are recorded in the database as zeros to satisfy the format requirements of a numerical data type. They are not errors and do not reference the actual geographic coordinates at 0 latitude, 0 longitude.
long_dms Character
lat_dec Number
long_dec Number
elev_in_m  Number Elevation in meters above (-below) sea level of the surface at the primary coordinates from National Elevation Dataset
elev_in_ft  Number Elevation in feet above (-below) sea level of the surface at the primary coordinates from National Elevation Dataset

US Churches List and Database sample data

You may want to download and evaluate our US Churches List and Database sample data to make sure you understand what you are going to get before you make the purchase decision. Our sample data includes about 214 records and will allow you to familiarize yourself with our data format, practice the import procedure, run SQL queries etc.

Download US Churches List and Database sample data


How to import the US Churches list and database to MySQL

First create a table for the data using a MySQL CREATE TABLE statement like this:

CREATE TABLE `us_churches` (
  `id` int(6) NOT NULL,
  `church_name` varchar(100) NOT NULL,
  `state_abbrev` varchar(2) NOT NULL,
  `state_code` varchar(2) NOT NULL,
  `county_name` varchar(26) NOT NULL,
  `county_code` varchar(3) NOT NULL,
  `lat_dms` varchar(7) NOT NULL,
  `long_dms` varchar(8) NOT NULL,
  `lat_dec` decimal(9,7) NOT NULL,
  `long_dec` decimal(10,7) NOT NULL,
  `elev_in_m` varchar(5) NOT NULL,
  `elev_in_ft` varchar(5) NOT NULL,
  PRIMARY KEY (`id`)
) CHARSET=utf8;

Of course you may decide to use another table name, but then you will need to modify our code samples. The next and final step is to run the 'load data' command to place the data in the table created in the first step.

load data infile 'your_path_here/us_churches.csv' 
into table us_churches
fields terminated by ',' 
optionally enclosed by '"' 
lines terminated by '\r\n';

What if the target database is on a remote computer, as in the case of web hosting? In that case you first need to connect your MySQL Command Line Client to the remote server. You can use syntax like this

mysql --host=www.yourdomainname.com -Dyourdatabasename --password=yourpassword --user=yourusername

Then use the 'load data' command but this time with the 'local' option (because your data file is on a computer local to you)

load data local infile 'your_path_here/us_churches.csv' 
into table us_churches
fields terminated by ',' 
optionally enclosed by '"' 
lines terminated by '\r\n';

How to get the list of churches in a specific county?

For example you want the list of churches in Fulton County, Georgia. Use a SQL query like this:

SELECT * from us_churches
WHERE state_abbrev='GA' AND county_name='Fulton' 
ORDER BY church_name

How to make use of the latitude and longtitude paramaters?

They can be used for example to show location of a church using Google Maps API. You will use 'lat_dec' and 'long_dec' for this purpose. The code to map Saint George Eastern Orthodox Church in Wichita, KS will look something like this:

var map;
function initialize() {
    var myOptions = {
        zoom: 8,
        center: new google.maps.LatLng(37.6819585, -97.3517117),
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
    var marker = new google.maps.Marker({position: myOptions.center, 
        map: map, 
        title:"Saint George Eastern Orthodox Church"});   
}
google.maps.event.addDomListener(window, 'load', initialize);

This code uses Google Maps JavaScript API v3. Please feel free to view the html source code of this article to see all of the details of displaying the map. The final result is visible below.

How to find all churches near given city?

This is the kind of question that many mapping and genealogy research applications must be able to solve. Our solution assumes you also have US City and County List and Database for web developers installed. First we have to create two indexes on the us_churches table:

ALTER TABLE `us_churches` 
ADD INDEX `lat_dec_idx` (`lat_dec` ASC), 
ADD INDEX `long_dec_idx` (`long_dec` ASC);

The indexes are not required but will speed up your searches dramatically. The next step is to add a spatial search stored procedure to perform all of the hard work for us. (For those interested in how this stored procedure works - please Google up the Haversine Formula)

DELIMITER $$
CREATE PROCEDURE churches_near_city(IN populated_place_id int, IN dist int)
BEGIN
declare long1 double; 
declare long2 double;
declare lat1 double; 
declare lat2 double;
declare mylat double;
declare mylon double;
SELECT long_dec, lat_dec INTO mylon, mylat 
FROM cities_and_counties 
WHERE id = populated_place_id LIMIT 1;
set lat1 = mylat-(dist/69); 
set long1 = mylon-dist/abs(cos(radians(mylat))*69);
set lat2 = mylat+(dist/69);
set long2 = mylon+dist/abs(cos(radians(mylat))*69);
SELECT id,church_name,county_name,lat_dec,long_dec, 
3956 * 2 * ASIN(SQRT(POWER(SIN((mylat - lat_dec) * 
pi()/180 / 2), 2) + COS(mylat * pi()/180) *
COS(lat_dec * pi()/180) * POWER(SIN((mylon - long_dec) * 
pi()/180 / 2), 2) )) AS distance 
FROM us_churches 
WHERE long_dec between long1 AND long2
AND lat_dec BETWEEN lat1 AND lat2
HAVING distance < dist ORDER BY distance;
END $$ 
DELIMITER ;

Now, assume you want to find all churches within 10 miles from Susank, KS. You need to lookup Susank, KS in the cities_and_counties table. This will reveal the record id of this city, which is 426700. We are ready to call the stored procedure declared above and pass the id and distance in miles:

mysql> call churches_near_city(426700, 10);
+--------+------------------------+-------------+------------+-------------+------------------+
| id     | church_name            | county_name | lat_dec    | long_dec    | distance         |
+--------+------------------------+-------------+------------+-------------+------------------+
| 426705 | Shannon Friends Church | Russell     | 38.7255668 | -98.7639696 | 5.87444154641221 |
| 426689 | Immanuel Church        | Russell     | 38.7080674 | -98.9120321 | 8.77080769743027 |
| 426693 | American Church        | Russell     | 38.7150117 | -98.9128654 | 9.07044344043628 |
| 426591 | Trinity Church         | Russell     | 38.7541782 | -98.8756411 | 9.55241588688808 |
+--------+------------------------+-------------+------------+-------------+------------------+
4 rows in set (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

A PHP/MySQL solution would in most cases create indexes and the stored procedure from the phpMyAdmin and call the stored procedure from the PHP code.


NOTE: This list can be used in conjunction with US State List for web developers., US City and County List and Database for web developers, and US Cemetery List and Database for web developers

Share this article!    Bookmark US Church List and Database at Delicious Digg US Church List and Database Share US Church List and Database with your Twitter followers Share US Church List and Database at StumbleUpon Add US Church List and Database to your Technorati favorites Share US Church List and Database on Facebook Share US Church List and Database on Blinklist Share US Church List and Database on Diigo Share US Church List and Database on Reddit Share US Church List and Database on Linked In Seed the vine with US Church List and Database Share US Church List and Database on Mixx Share US Church List and Database on DZone