<br><br><div><span class="gmail_quote">On 10/16/07, <b class="gmail_sendername">Mark Leslie</b> &lt;<a href="mailto:mark.leslie@lisasoft.com">mark.leslie@lisasoft.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Don Drake wrote:<br>&gt; On 10/16/07, Mark Leslie &lt;<a href="mailto:mark.leslie@lisasoft.com">mark.leslie@lisasoft.com</a>&gt; wrote:<br>&gt;&gt; Don Drake wrote:<br>&gt;&gt;&gt; Here&#39;s my scenario, I have shapefiles containing polygons of
<br>&gt;&gt; zipcodes.&nbsp;&nbsp;I<br>&gt;&gt;&gt; have a table in Postgres that has a zip code with data that I would like<br>&gt;&gt; to<br>&gt;&gt;&gt; thematically map.&nbsp;&nbsp;I am not interested in loading the zipcodes into<br>&gt;&gt; PostGIS
<br>&gt;&gt;&gt; if I don&#39;t have to.&nbsp;&nbsp;I am using PHP/Mapscript, and I was wondering if<br>&gt;&gt; there<br>&gt;&gt;&gt; is a way to merge the Postgres data with the shapefile layer on a map?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Thanks.
<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; -Don<br>&gt;&gt;&gt;<br>&gt;&gt; That depends what you mean by &#39;merge&#39;.&nbsp;&nbsp;If you want to display both in<br>&gt;&gt; the same layer, you can come close by defining two layers in the same
<br>&gt;&gt; group (see the GROUP item at<br>&gt;&gt; <a href="http://mapserver.gis.umn.edu/docs/reference/mapfile/layer">http://mapserver.gis.umn.edu/docs/reference/mapfile/layer</a>).&nbsp;&nbsp;If you want<br>&gt;&gt; to join the two sources together, Jeff has a nice example in the
<br>&gt;&gt; reference docs<br>&gt;&gt; (<br>&gt;&gt; <a href="http://mapserver.gis.umn.edu/docs/reference/mapfile/join#example-2-join-from-shp-file-to-postgresql-table">http://mapserver.gis.umn.edu/docs/reference/mapfile/join#example-2-join-from-shp-file-to-postgresql-table
</a><br>&gt;&gt; ).<br>&gt;&gt; If I&#39;ve missed the point entirely, then I&#39;ll need some more details<br>&gt;&gt; about what you&#39;re trying to end up with.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt; Very interesting.&nbsp;&nbsp;It looks like the second link is close to what I need,
<br>&gt; the first is not what I need.<br>&gt;<br>&gt; The thing is that the postgres table the data is coming out of does not have<br>&gt; a geometry column, the key is the zipcode.&nbsp;&nbsp;Furthermore, it will probably<br>&gt; come from a query, or a view.&nbsp;&nbsp;I tried using a view with no geometry and
<br>&gt; could not get it to work.&nbsp;&nbsp;The geometry will come from a shapefile.<br>&gt;<br>&gt; If this would work, could I color code using an expression?&nbsp;&nbsp;Is there a<br>&gt; Mapscript alternative?<br>&gt;<br>&gt; Thanks.<br>
&gt;<br>&gt; -Don<br>&gt;<br><br>If there&#39;s no geometry in the table, then the join is your only option<br>AFAIK.&nbsp;&nbsp;The downside is that joins are only intended for use in queries,<br>not in styling.&nbsp;&nbsp;I expect that since you&#39;re using MapScript, you could
<br>execute a query to determine membership and dynamically setup the<br>styling, but that&#39;s a reasonably horrible solution.&nbsp;&nbsp;You&#39;d be better of<br>using php to connect directly to postgres (<a href="http://au2.php.net/pgsql">
http://au2.php.net/pgsql</a>) to<br>find a zipcodes and set up your classes from that.&nbsp;&nbsp;Can I ask why you<br>don&#39;t want to load the zipcodes into PostGIS, or extract the table to<br>shapefile for that matter?&nbsp;&nbsp;Does the zipcode table change frequently?
<br><br>--<br>Mark Leslie<br>Software Architect<br>LISAsoft Pty Ltd<br><a href="http://www.lisasoft.com">www.lisasoft.com</a><br></blockquote></div><br>Loading the zipcodes into PostGIS is just a pain quite honestly.&nbsp; They&#39;re sitting in the filesystem for the entire country, I wish I could easily change the polygon color based on another attribute from a query from Postgres.&nbsp; 
<br><br>I tried doing that using expressions, but it&#39;s not working, debugging mapscript is very frustrating.<br><br>I&#39;ll be loading these into postGIS, thanks for your help.<br><br>-Don<br>