<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Feb 20, 2007, at 6:46 AM, Obe, Regina wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV dir="ltr" align="left"><P><FONT size="2">Hi Kirk,</FONT></P><P><FONT size="2">I meant substitute all references to ref_solar_station_id with ref_weather_station_id. </FONT></P><P><FONT size="2"><SPAN class="157253912-20022007">The idea is </SPAN> <SPAN class="157253912-20022007">to update </SPAN><SPAN class="157253912-20022007">the</SPAN> ref_weather_station_id of those that don't have a<SPAN class="157253912-20022007">ny</SPAN> weather <SPAN class="157253912-20022007">for that year </SPAN>with those that do.<SPAN class="157253912-20022007">  Basically the first step sets  the ref_weather_station_id to the station_id if the station has weather data for that year and null if it does not and similarly ref_sol with station_id if the station has solar data for that year.  So by the time you get to step 5 those that have nulls in ref_weather_station_id have no weather for that year. Those that have weather for that year (assuming I wrote the query right - the ref_weather_station_id should be the same as the station_id) .  Hope my explanation isn't even more confusing.</SPAN></FONT></P></DIV></BLOCKQUOTE><DIV>Not at all Regina. Thanks for all your assistance. I actually took a guess that you meant exactly that. I got your new table and the final query working and then had to give my attention to other projects. I will pick back up this week. I think one issue I have to playing with the 30 km boundary you set. I tired changing that to 50 km, and 100 km, and 200 km just to see how many stations get picked up with the more flexible rule. Now that I have the filled after a 200 km INSERT, I think I need to delete all rows and start again with a more rigid rule (say 20 - 30 km). </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Also, I think I'll add a 'longname' field for both the ref_weather_station_id and the ref_solar_station_id, so that a human can more immediately understand which stations are being lumped together. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks again,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Kirk </DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><BLOCKQUOTE type="cite"><DIV dir="ltr" align="left"><P><FONT size="2"><SPAN class="157253912-20022007">Thanks,</SPAN></FONT></P><P><FONT size="2"><SPAN class="157253912-20022007">Regina</SPAN></FONT></P></DIV><BR> <DIV class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left"> <HR tabindex="-1"> <FONT face="Tahoma" size="2"><B>From:</B> postgis-users-bounces@postgis.refractions.net [<A href="mailto:postgis-users-bounces@postgis.refractions.net">mailto:postgis-users-bounces@postgis.refractions.net</A>] <B>On Behalf Of </B>Kirk Wythers<BR><B>Sent:</B> Friday, February 16, 2007 4:53 PM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> Re: [postgis-users] joining "nearest" data<BR></FONT><BR></DIV> <DIV></DIV><BR> <DIV> <DIV>On Feb 15, 2007, at 7:35 AM, Obe, Regina wrote:</DIV><BR class="Apple-interchange-newline"> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT style="FONT: 12px Helvetica" face="Helvetica" size="3">Step 5 - Do the same as Step 4 except for   ref_weather_station_id</FONT></DIV></BLOCKQUOTE></DIV><BR> <DIV>Do you mean substitute ref_weather_station_id for ref_solar_station_id in line one only. Bottom line, are you saying that you want to fill in in ref_weather_station_id with those that have no solar data for that year, or with those that have no weather data for that year? </DIV><DIV><BR class="khtml-block-placeholder"></DIV><HR size="1"><DIV><BR class="khtml-block-placeholder"></DIV><BR><P><STRONG><BR> The substance of this message, including any attachments, may be<BR> confidential, legally privileged and/or exempt from disclosure<BR> pursuant to Massachusetts law. It is intended solely for the<BR> addressee. If you received this in error, please contact the sender<BR> and delete the material from any computer.<BR> </STRONG></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">postgis-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>