On Tue, Jan 11, 2011 at 3:37 AM, Dheeraj Chand <[email protected]>wrote:
> Hello, everyone, > > I have a bit of a pickle, but I think that it could be a fun problem to > solve. I am copying a friend of mine on this email because he and I have > talked about this in the past, and I think that he'd want to see the > response. If it's not an inconvenience, please do leave him on the reply > line. > > I have a PostGIS database with roughly 1,800 points that are to be > represented as markers. I have been asked to produce anywhere from 1 to 51 > maps in PNG format: one will be the entire country of the United States of > America , and the rest will be for each individual state in which there is > at least one marker. The request is to use a Google Maps Political map as a > base layer, or something else showing basic geopolitical data, like state > boundary lines, various cities, etc. > It is against the terms of use of Google Maps to use their tiles in anything other than a web browser with the Google Maps API loaded. There is also no way in GeoServer to have the WMS generate tiles using anything other than GeoServer layers. Perhaps the 'cultural' data from http://www.naturalearthdata.com/downloads/10m-cultural-vectors/ would be a better fit (if you load it in GeoServer you can render it along side other layers in GeoServer easily.) Otherwise, you'll probably need to use an image manipulation library in PHP to overlay the WMS results on top of whatever third-party tiles you are using. > What I would like to do is use either PHP or Python to (I'll assume PHP for > now, but can easily switch to Python if that's what people prefer.): > > > 1. Query the DB and find every state for which there is at least one > marker, and write each one of those states to an array called $states. > 2. Loop through $states, and for each one, use a WMS call to produce a > PNG of each state, with markers on it, centered on the centroid of the > state, with zoom set to the state level. > > If you're ok with being tied to a PostGIS backend, it should pretty easy to construct both of these requirements as SQL queries. Check out the docs for postgis: http://postgis.refractions.net/docs/ . You'll probably to achieve the first with a join using the Intersects function, and the second using the Envelope one. So, this means that for each state, I have to get the WMS output of both the > Google Maps layer AND the points layer, and combine into one PNG. > If you have your political boundaries in GeoServer, this is as easy as writing "layers=political,markers" in your WMS query. If you don't have your political boundaries in GeoServer, it will be somewhat tricky to make sure the tiles line up. > If anyone has done something like this before, and can help me think > through it, I would really appreciate it. I'm also willing to pay a bit if > someone hasn't done it, but is able to, and requires a consulting fee to > help. I'd prefer to get the assist gratis, as this is volunteer work for an > NGO, but I understand that talent and time cost money, and the fact that I > am volunteering doesn't mean that other people are. > You might also be interested in the Mapfish Print service, which is able to pull geospatial data and tiles from various sources and align them for PDF output. If this is intended to be a quick-n-dirty project however, modifying the Mapfish print code to output other formats will probably be more work than the above approach. > Thanks, > > Dheeraj > > > ------------------------------------------------------------------------------ > Gaining the trust of online customers is vital for the success of any > company > that requires sensitive data to be transmitted over the Web. Learn how to > best implement a security strategy that keeps consumers' information secure > and instills the confidence they need to proceed with transactions. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Geoserver-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users > >
------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
