<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Orient Lodge</title>
  <subtitle>An Eclectic Blog at the Intersection of Technology and our Social Lives</subtitle>
  <link rel="alternate" type="text/html" href="http://www.orient-lodge.com/node/76"/>
  <link rel="self" type="application/atom+xml" href="http://www.orient-lodge.com/node/76/atom/feed"/>
  <id>http://www.orient-lodge.com/node/76/atom/feed</id>
  <updated>2004-11-22T19:56:54-05:00</updated>
  <entry>
    <title>Creating Political Maps, Part 2</title>
    <link rel="alternate" type="text/html" href="http://www.orient-lodge.com/node/76" />
    <id>http://www.orient-lodge.com/node/76</id>
    <published>2004-09-30T11:53:54-04:00</published>
    <updated>2004-11-22T19:56:54-05:00</updated>
    <author>
      <name>Aldon Hynes</name>
    </author>
    <category term="Blog Entries" />
    <category term="Politics" />
    <category term="Technology" />
    <summary type="html"><![CDATA[<p>
Over the past several months, I have been running a website, <a href=http://localpols.fordean.net>http://localpols.fordean.net</a> which lists various progressive candidates.   As the list has grown, I’ve been looking for ways to improve the navigation of the site.  I set up a simple clickable map so you could click on a state to find specific candidates.  I have expanded this to be able to click on the district level, for example, <a href=http://localpols.fordean.net/CTStateSenate> http://localpols.fordean.net/CTStateSenate</a></p>
<p>
I wrote about my initial attempts at this <a href=node/view/14>here.</a>  As I mentioned then, people had suggested that I check out <a href=http://mapserver.gis.umn.edu/>Mapserver</a>.  In theory, it is supposed to work with IIS.  However, when I tried using it with IIS on my server, no matter what I did, I kept getting, “CGI Error<br />
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:”</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>
Over the past several months, I have been running a website, <a href=http://localpols.fordean.net>http://localpols.fordean.net</a> which lists various progressive candidates.   As the list has grown, I’ve been looking for ways to improve the navigation of the site.  I set up a simple clickable map so you could click on a state to find specific candidates.  I have expanded this to be able to click on the district level, for example, <a href=http://localpols.fordean.net/CTStateSenate> http://localpols.fordean.net/CTStateSenate</a></p>
<p>
I wrote about my initial attempts at this <a href=node/view/14>here.</a>  As I mentioned then, people had suggested that I check out <a href=http://mapserver.gis.umn.edu/>Mapserver</a>.  In theory, it is supposed to work with IIS.  However, when I tried using it with IIS on my server, no matter what I did, I kept getting, “CGI Error<br />
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:”<br />
&lt;!--break--></p>
<p>
This is an error message that has often been reported for various systems, but I have yet to find a way to get around this error.</p>
<p>
I am not all that proficient at configuring my Apache servers, so I may not have set up MapServer as optimally as possible, but my test Mapserver is now up at <a href=http://ahynes1.homeip.net:7778/cgi-bin/mapserv> http://ahynes1.homeip.net:7778/cgi-bin/mapserv</a>.</p>
<p>
My first pass was to try and take some of the shapefiles that I’ve gathered and put them up on the MapServer.  The first problem I ran into in doing this was trying to find the appropriate ‘extent’.  In the end, I used ArcGIS to check the properties of the themes and that has worked pretty well.  <I>Does anyone know how to find the proper extent of a shapefile using open tools?</i></p>
<p>
I gathered redistricting shapefiles for several states and have put them all up on my Mapserver.  A second problem that I’ve run into is that different shapefiles use different formats for the extents.  Some of them are simple lat/long.  Others seem to be lat/long times 10,000, still others on some other scale.  Given this, I don’t think I can easily mix and match state shapefiles.  <I>Does anyone know how to change the scale that is being used, so, for example, they could all be simple lat/long?</i></p>
<p>
My next step was to start playing with <a href=http://mapserver.gis.umn.edu/mum/consess2/hartmann/main.html>MapClient</a>.  The simple MapClient stuff seemed to work pretty well.  I cut and pasted parts from their examples and set up my first little version, <a href=http://ahynes1.homeip.net:7778/mapclient/examples/test1.html>http://ahynes1.homeip.net:7778/mapclient/examples/test1.html</a>  This displays the different maps for the states that I’ve retrieved data.</p>
<p>
When I set this up, I used server frames.  I didn’t want a separate floating window created by Javascript.  Unfortunately, when I tried porting that code into Drupal, I started getting errors.  So, I’m on hold with the Drupal porting for a little while.</p>
<p>
I then tried some other software.  <a href=http://www.maptools.org/php_mapscript/>PHP MapScript</a> looks really promising.  I downloaded a binary version for Windows.  Unfortunately, the MapScript windows binary comes with a lot of junk, which I didn’t want.  It would be nice if they had a stripped down version.  I’ve installed it, but when I try to run it, I get <I>Unknown(): Unable to load dynamic library C:\PHP\extensions\php_mapscript_42.dll – Access is denied</i>  Anyone have any ideas about how to get around that one?</p>
<p>
So, I’ve gone back to working with the MapServer MAP definitions.  I’m sure that I could write much better map files.  Mostly, I’ve cut and pasted from other map files, and slowly been learning how to get them to be a little nicer.  My latest version gives me the ability to select different voting districts.  For example, take a look at <a href=http://ahynes1.homeip.net:7778/cgi-bin/mapserv.exe?map=c:\mapserver\maps\wahoused.map&amp;district=18,20,28,38,39,44>http://ahynes1.homeip.net:7778/cgi-bin/mapserv.exe?map=c:\mapserver\maps\wahoused.map&amp;district=18,20,28,38,39,44</a>.  It highlights districts 18, 20, 28, 38, 39, and 44.  I’ve also gotten my zooming working with <a href=http://ahynes1.homeip.net:7778/cgi-bin/mapserv.exe?map=c:\mapserver\maps\vasenated.map&amp;district=12&amp;mapext=-77.979604+37.376572+-77.224005+37.933055>http://ahynes1.homeip.net:7778/cgi-bin/mapserv.exe?map=c:\mapserver\maps\vasenated.map&amp;district=12&amp;mapext=-77.979604+37.376572+-77.224005+37.933055</a></p>
<p>
I’ve used a few maps like this, particularly for Virginia and Washington, to enhance <a href=http://localpols.fordean.net>Local Pols</a></p>
<p>
So, with this, I am getting closer.  I still have a bunch of questions.  They boil down to:</p>
<ul>
<li>How do I get MapServer to work with IIS?
</li><li>How do I get MapScript working with IIS?
</li><li>How do I incorporate this into Drupal (e.g. getting MapClient or MapScript to work)
</li><li>How do I find extents automatically without using ArcView?
</li><li>Is there a nice way to change the scaling?
</li><li>How do you make a section clickable? (I’m currently creating PNGs that I add to Drupal as a client side clickable map)
</li><li>How do you set up a floating tag?  (So, when the mouse hovers over a location, it says what the location is.  I can do this with clickable maps, and have at Local Pols)
</li><li>How do you make different sections different colors based on specific needs?  (I’m doing it with a kludged up map file.  I’m sure there must be a better way
</li><li>How do I add a symbol, or many symbols, programmatically?
</li></ul>
<p>
Any comments are greatly appreciated..</p>
    ]]></content>
  </entry>
</feed>
