Colorado Interactive Maps and Demographic Data

Dynamic Maps
Information
Appendix Data
Links
- Data Sources

Drawing KML Maps

When I first started this site, it was actually quite difficult to make decent looking maps. Since Google now provides KML and XML processing of files, the ability is quite simple and easy for anyone to do. I feel like I do not need to put up full details on how to make a map anymore, so I have removed most of the information on how to assemble a map within a webpage. If you which to learn more about how to do it, I would suggest first looking at the The Google Map Blog. Also, the javascript used on this website to overlay a KML file is provided here in case anyone is interested.

My KML Format for each District

On each district webpage, there is an option to download the KML file of that district. Each KML has a standard format, and the boundary data is standardized. I would not suggest editing in any way. The portions before that are something that should be edited, with and example of the rows available below.

<Folder>
<name>State House District 14</name>
<description></description>
<visibility>1</visibility>
 
 
 <Placemark>
<name>State House District 14</name>
<description>
<![CDATA[Current State Representative: Kent D. Lambert (R)]]>
</description>
<visibility>1</visibility>
<Style>
<LineStyle><width>1</width><color>7f000000</color></LineStyle>
<PolyStyle><color>5f00007f</color><outline>1</outline></PolyStyle></blockquote>

The Folder data is only seen on Google Earth, or if loaded directly into Google Maps at maps.google.com. The Placemark data is more important, and a description of all of the options I added are listed below.

  • name Appears as the top line when clicked on in Google Maps. Will generally have a style of font-weight: bold; font-size: medium;
  • description Second line in the pop-up infobox. Will generally have a standard text format.
  • visibility Don't touch.
  • LineStyle Border Line properties of pixel width and the line color. The color is AABBGGRR, where AA is the transparency and ff000000 would be opaque black.
  • PolyStyle The inner shaded area can be changed to a different color in the same way as the border line. The outline tag either removes (0) or displays (1) the border line.

There are further options which were not added to these files, but these will do ninety percent of what people require for displaying a district map. KML is cached by Google, so changes do not instantly when you refresh the webpage. If you want instant feedback, Google Earth is the best option, or just renaming the file.


Polygon Searches

Polygon searches are covered in detail in a variety of other sites, but here is a brief explanation on how it is completed. If you want detailed specifics, see the links at the end of this section.

To find a whether or not a single district contains the data point we are looking for, you need to test districts in some manner. You can sequentially search all of the districts, or do an optimization protocol beforehand. Since we want to make the process fast, a point optimization is used to rank which district is likely the correct one.

A list of center points describing each district was prepared, and the distance between these center points and the requested position is calculated. The shortest distances are calculated first, and each district is sequentially searched until the correct one is found. Since there are huge districts outside of the Front Range Corridor, multiple "center points" were used to describe districts which bordered the Front Range. For those districts, only the shortest distance is counted when ranking.

After the first district is found, the next district set is processed until all three data sets have been ranked and the correct districts have been found. These are reported back to the javascript program running on the webpage, and the correct three districts are loaded to the web page.

Determining whether a point is inside of a polygon:
UC-Davis Page
UC-Irvine Page
University of Western Australia Page
alienryderflex.com Page

Additional Problems

Issues
These should no longer happen, but if it does, please let me know. The main issue is the fidelity of the data as compared to reality, and there are sometimes gaps between districts that shouldn't be there. Yet somehow, they are.

If for some reason you wish to view the old version, that is still available and located here.