<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mission Data Blog &#187; gis</title>
	<atom:link href="http://www.missiondata.com/blog/tag/gis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.missiondata.com/blog</link>
	<description>Louisville-based Web Development &#38; Software Engineering</description>
	<lastBuildDate>Tue, 24 Jan 2012 14:58:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>How to Create and Overlay KML on a Google Map Using Google&#8217;s My Maps</title>
		<link>http://www.missiondata.com/blog/systems-integration/72/how-to-overlay-kml-on-a-google-map/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/72/how-to-overlay-kml-on-a-google-map/#comments</comments>
		<pubDate>Fri, 06 Apr 2007 14:33:48 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[embedded maps]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[Google My Maps]]></category>

		<guid isPermaLink="false">http://www.missiondata.com/blog/gis/72/how-to-overlay-kml-on-a-google-map/</guid>
		<description><![CDATA[A few days ago Google made their &#8220;My Maps&#8221; announcment and since then there has been nothing but buzz buzz buzz about it. So I figured I would take a minute to show how someone can use this new tool from Google to create their own embedded maps for their site. The first step is [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago Google made their <a href="http://googleblog.blogspot.com/2007/04/map-making-so-easy-caveman-could-do-it.html">&#8220;My Maps&#8221; announcment</a> and since then there has been nothing but <a href="http://radar.oreilly.com/archives/2007/04/google_launches_mymaps.html">buzz</a> <a href="http://mashable.com/2007/04/05/google-mymaps/">buzz</a> <a href="http://www.gearthblog.com/blog/archives/2007/04/my_maps_new_google_m.html">buzz</a> about it. So I figured I would take a minute to show how someone can use this new tool from Google to create their own embedded maps for their site.</p>
<p><span id="more-72"></span></p>
<p>The first step is to create your new map. Go to <a href="http://maps.google.com/">Google Maps</a> and click on the new &#8220;My Maps&#8221; tab.</p>
<p><img src="http://www.missiondata.com/blog/wp-content/uploads/2007/04/ss6.jpg" alt="Web Hosting, Web Development, and Software Development in Louisville Ky" /></p>
<p>Now you create your map. You can create polygons, lines or just points and include whatever you want in the descriptions because it will all be included in the KML.</p>
<p>Once you have completed your map you want to go to click on the KML link at the top right to save the KML for this map to disk.</p>
<p><img src="http://www.missiondata.com/blog/wp-content/uploads/2007/04/ss5.jpg" alt="Web Hosting, Web Development, and Software Development in Louisville Ky" /></p>
<p>Just last month Google added <a href="http://googlemapsapi.blogspot.com/2007/03/kml-and-georss-support-added-to-google.html">support for KML overlays</a> to their map API. It isn&#8217;t very well documented on the <a href="http://www.google.com/apis/maps/documentation/reference.html#GGeoXml">GGeoXml documentation</a> page but there is only one real issue you have to know about. The main thing to understand is that the KML file must sit on a public webserver somewhere and when you reference it Google needs to be able to access it. For example if you are testing on your local box and you put something like &#8220;http://localhost/mykml.kml&#8221; in for the URL it will not work. After you get past that the path to using your saved KML file is easy. Here is a full example:</p>
<pre><code>
    &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAAcktFen-Z7CQCe0dxIKmxeRReUzuwBhfUVuhk2aRjVRv1avb-hhQdlkzQnQ1P5PComj1CZx2jeOOyIw" type="text/javascript"&gt;<!--mce:0-->&lt;/script&gt;
    &lt;script type="text/javascript"&gt;<!--mce:1-->&lt;/script&gt;
</code></pre>
<p>Notice that you have to zoom and center to somewhere since that isn&#8217;t controled by the KML file but other than that it makes creating embedded maps very simple.</p>
<p>And here are the results from the example:</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/72/how-to-overlay-kml-on-a-google-map/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Good Techcrunch review of mapping apis</title>
		<link>http://www.missiondata.com/blog/systems-integration/45/good-techcrunch-review-of-mapping-apis/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/45/good-techcrunch-review-of-mapping-apis/#comments</comments>
		<pubDate>Tue, 18 Apr 2006 14:06:21 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[gis]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=45</guid>
		<description><![CDATA[Techcrunch has a good review by Frank Gruber of the look and feel of mapping services. I think it is notable that ESRI&#8217;s service is not included in the review. I think it is at least as good as the mapquest service. I may have to find time to redo my review of the acuracy [...]]]></description>
			<content:encoded><![CDATA[<p>Techcrunch has a good <a href="http://www.techcrunch.com/2006/04/17/comparing-the-mapping-services/">review</a> by <a href="http://www.somewhatfrank.com/">Frank Gruber</a> of the look and feel of mapping services. I think it is notable that <a href="http://www.esri.com/software/arcgis/about/gis-webservices.html">ESRI&#8217;s service</a> is not included in the review. I think it is at least as good as the mapquest service. I may have to find time to redo my <a href="http://blogs.missiondata.com/?p=18">review</a> of the acuracy of each again and a more technical evaluation of each.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/45/good-techcrunch-review-of-mapping-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Approximating a circle with a polygon</title>
		<link>http://www.missiondata.com/blog/systems-integration/44/approximating-a-circle-with-a-polygon/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/44/approximating-a-circle-with-a-polygon/#comments</comments>
		<pubDate>Tue, 18 Apr 2006 02:36:18 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[gis]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=44</guid>
		<description><![CDATA[I recently had an opportunity to use ESRI&#8217;s ArcSDE again. It is a spatial database interface and in this instance I was using the java api. I wanted to change what used to be a query using a rectangle into a query using a circle. For some reason parts of the java api for ArcSDE [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had an opportunity to use ESRI&#8217;s <a href="http://www.esri.com/software/arcgis/arcsde/index.html">ArcSDE</a> again. It is a spatial database interface and in this instance I was using the java api. I wanted to change what used to be a query using a rectangle into a query using a circle. For some reason parts of the java api for ArcSDE require a C library or something. I gave up pretty quickly on trying to make their arc function work since the documentation wasn&#8217;t very clear on how it worked. Instead I decided to figure out how to approximate a circle with a polygon and use that instead. Here is the result of that research.</p>
<p><span id="more-44"></span></p>
<p>First it helps to have a little background. Most people are familiar with <a href="http://en.wikipedia.org/wiki/Latitude">latitude</a> and <a href="http://en.wikipedia.org/wiki/Longitude">longitude</a> but you may not be familiar with their exact definitions. I have included the links to the wikipedia pages for both so you can research them more if you want. The main things to know are: latitude runs north/south and each degree of latitude is about 111 km; longitude runs east/west and is 111 km times the cosine of the latitude. The next thing that is helpful to know is the <a href="http://en.wikipedia.org/wiki/Earth_radius">radius of the earth</a>: 6,378.135 km in this case I&#8217;ll just use the equatorial radius.</p>
<p>Now that we have the earth taken care of we need to go back to basics. We start by looking at the definition of a <a href="http://en.wikipedia.org/wiki/Circle">circle</a> and <a href="http://en.wikipedia.org/wiki/Unit_circle">the unit circle</a>. The mathematical definition of a circle is the important part here. The following equations will play an important part: x = a + r cos(t) and y = b + r sin(t) where a,b are the center of the circle, x,y are points of the unit circle, r is the radius of the circle, and t is the angle of a line from the origin to x,y in radians. It helps to think of the circle as broken up into triangles.</p>
<p>The last thing to keep in mind is that latitude and longitude are in degrees but when working with cos and sin you need to use radians and not degrees. The conversion between radians and degrees is easy: radians = degrees * (PI / 180) and degrees = radians * (180 / PI).</p>
<p>So now for the main formula in pseudocode:</p>
<pre>
<code> earths_radius = 3963 // number of miles in the radius of the earth
 longitude = 80          // longitude of the center of the circle
 latitude = 90            // latitude of the center of the circle
 points = 32              // number of points in the polygon
 circle_radius = 1       // miles of radius

 // find the raidus in lat/lon, units per latitude, units per longitude
 r_latitude = radius_to_degrees(circle_radius / earths_radius)
 r_longitude = r_latitude / cos(degrees_to_radius(latitude))

 // create a point for each edge, we need one extra point to connect the
 // end to the begining
 for point_count = 0 to points + 1
 {
    theta = PI * (point_count / (points / 2))    // find the angle for the current triangle
    circle_x = lng + (r_longitude * cos(theta))  // center a + radius x * cos(theta)
    circle_y = lat + (r_latitude * sin(theta))     // center b + radius y * sin(theta)

    // circle_x, circle_y represents a point on the circle
 }</code>
</pre>
<p>That is all there is to it. In this example I just picked 32 points for the circle but you may want more or less depending on how large your radius is and how closely you want to approximate the circle. One thing to note about this function is that it produces the points in a counter-clockwise direction.</p>
<p>Now for an example using google maps to display a circle around a point with a radius of one mile:</p>
<h3>Missiondata World HQ, Louisville, Ky</h3>
<p><iframe SRC="/blog/examples/googlemap_circle.html" width="500px" height="400px" scrolling="no" frameborder="0"></iframe></p>
<p>And here is the javascript source you need to do it:</p>
<pre>
<code>var d2r = Math.PI / 180;   // degrees to radians
var r2d = 180 / Math.PI;   // radians to degrees
var earthsradius = 3963; // 3963 is the radius of the earth in miles

var hqpoint = new GPoint(-85.578852, 38.215601);
var map = new GMap(document.getElementById("map"));

map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(hqpoint, 4);
map.addOverlay(new GMarker(hqpoint));

drawCircle(-85.578852, 38.215601, map);

function drawCircle(lng, lat, map)
{
   var points = 32;
   var radius = 1;             // radius in miles

   // find the raidus in lat/lon
   var rlat = (radius / earthsradius) * r2d;
   var rlng = rlat / Math.cos(lat * d2r);

   var extp = new Array();
   for (var i=0; i &lt; points+1; i++) // one extra here makes sure we connect the
   {
      var theta = Math.PI * (i / (points/2));
      ex = lng + (rlng * Math.cos(theta)); // center a + radius x * cos(theta)
      ey = lat + (rlat * Math.sin(theta)); // center b + radius y * sin(theta)
      extp.push(new GPoint(ex, ey));
   }

   map.addOverlay(new GPolyline(extp, "#000000", 2));
}</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/44/approximating-a-circle-with-a-polygon/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GIS Geocoding experiments</title>
		<link>http://www.missiondata.com/blog/systems-integration/18/gis-geocoding-experiments/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/18/gis-geocoding-experiments/#comments</comments>
		<pubDate>Thu, 09 Mar 2006 03:39:31 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[gis]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=18</guid>
		<description><![CDATA[I&#8217;ve been evaluating a couple different mapping software packages recently and the other day I noticed that the same addresses geocoded (for those who don&#8217;t know what geocoding is you can find out more about it here) to different locations. They are mostly the same but I figured it was interesting enough to do some [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been evaluating a couple different mapping software packages recently and the other day I noticed that the same addresses geocoded (for those who don&#8217;t know what geocoding is you can find out more about it <a title="here" href="http://en.wikipedia.org/wiki/Geocoding">here</a>) to different locations. They are mostly the same but I figured it was interesting enough to do some more digging and see how different mapping services compared.I looked at the following services. Some of them are commercial services with open apis (ESRI and mapquest) and some of them are non-commercial services with open apis (yahoo and google although google does not have a geocoding api).</p>
<ul>
<li><a title="http://www.esri.com/software/awspublicservices/index.html" href="http://www.esri.com/software/awspublicservices/index.html">http://www.esri.com/software/awspublicservices/index.html</a></li>
<li><a title="http://developer.yahoo.com/maps/index.html" href="http://developer.yahoo.com/maps/index.html"> http://developer.yahoo.com/maps/index.html</a></li>
<li><a title="http://www.mapquest.com/openapi" href="http://www.mapquest.com/openapi"> http://www.mapquest.com/openapi</a></li>
<li><a title="http://maps.google.com" href="http://maps.google.com"> http://maps.google.com</a></li>
</ul>
<p>For google I viewed the resulting values for latitude and longitude that were generated from a search for the address. For yahoo and ESRI I used their REST geocoding apis and for mapquest I used their java api to their commercial service since their openapi service is only in beta currently.I took 5 addresses located at different points in the US and one in Canada and mapped the returned latitude and longitude from each service. Here are the results:<br />
<span id="more-18"></span></p>
<p>Missiondata, 2300 Hurstbourne Village Drive, Suite 1100, Louisville, KY, 40299<br />
mapquest: 38.215303, -85.578698<br />
google: 38.215601, -85.578852<br />
yahoo: 38.215496, -85.578669<br />
esri: 38.216273, -85.579028</p>
<p><img id="image19" alt="Missiondata Results" src="http://blogs.missiondata.com/wp-content/uploads/2006/03/md.gis.jpg" /></p>
<p>Googleplex, 1600 Amphitheatre Parkway, Mountain View, CA, 94043<br />
mapquest: 37.4238,   -122.0901<br />
google: 37.422845, -122.085035<br />
yahoo: 37.42386,  -122.090332<br />
esri: 37.42386,  -122.090332</p>
<p><img id="image20" alt="Googleplex Results" src="http://blogs.missiondata.com/wp-content/uploads/2006/03/google.gis.jpg" /></p>
<p>IBM New York, 590 Madison Ave, New York, NY, 10022<br />
mapquest: 40.7623,   -73.972399<br />
google: 40.762267, -73.972535<br />
yahoo: 40.762245, -73.972644<br />
esri: 40.762245, -73.972644</p>
<p><img id="image21" alt="IBM NY Results" src="http://blogs.missiondata.com/wp-content/uploads/2006/03/ibm.gis.jpg" /></p>
<p>Lockheed Martin, 6304 Spine Rd, Boulder, CO, 80301<br />
mapquest: 40.0672,   -105.206711<br />
google: 40.067084, -105.206555<br />
yahoo: 40.067063, -105.20654<br />
esri: 40.067063, -105.20654</p>
<p><img id="image22" alt="Lockheed Martin Results" src="http://blogs.missiondata.com/wp-content/uploads/2006/03/lm.gis.jpg" /></p>
<p>Red Hat Canada, 2323 Yonge Street, Suite #300, Toronto, Ontario M4P 2C9, Canada<br />
yahoo: none<br />
mapquest: 43.708137, -79.3985<br />
google: 37.062500, -95.677068<br />
esri: 79.398592, -43.7081</p>
<p><img id="image24" alt="Redhat Canada Mapquest Results" src="http://blogs.missiondata.com/wp-content/uploads/2006/03/canada.mapquest.jpg" /><br />
<img id="image23" alt="Redhat Canada Google Results" src="http://blogs.missiondata.com/wp-content/uploads/2006/03/canada.google.jpg" /></p>
<p>For the most part all of the services provide very similar results for geocoding in the US. From the limited number of locations I tested it seems that the larger cities have a more reliable set of outputs. In NY for example they almost completely stack on top of each other. I find it interesting too that in 4 out of 6 cases yahoo came back with the exact same results as ESRI provided.</p>
<p>The last thing to notice of course is that the results for Canada are not as good. First off I couldn&#8217;t get yahoo&#8217;s service to work with a Canadian address for some reason. Also notice that the ESRI latitude and longitude results are swapped. And viewing the results from google for latitude and longitude gave me some wildly incorrect values but the map was actually correct (thus the two maps). The only completely reliable service for Canada was mapquest and google (although google doesn&#8217;t do geocoding) with ESRI coming in next just because the results were swapped. All in all I think all 3 did a good job.</p>
<p>I&#8217;m not sure why google hasn&#8217;t produced something in the way of geocoding yet. I think they have the mapping nailed down but their lack of geocoding will put them at somewhat of a disadvantage at some point since the other 3 services are in the open now and both ESRI and mapquest already have commercial versions of their services that people use widely.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/18/gis-geocoding-experiments/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

