Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Archive for the ‘TileStache’ Category

Plugin-free QGIS TMS tiles via GDAL

Posted by smathermather on July 31, 2014

Want to load your favorite tiles into QGIS? How about a plugin-free QGIS TMS tiles via GDAL:

http://www.3liz.com/blog/rldhont/index.php?post/2012/07/17/OpenStreetMap-Tiles-in-QGIS

Really awesome… .

Needs but one change: epsg:900913 should be epsg:3857 or QGIS (GDAL?) throws an error. Presumably you could also define epsg:900913 in some config file, but barring that create an XML file as follows, and load as a raster in QGIS:

<GDAL_WMS>
    <Service name="TMS">
        <ServerUrl>http://maps1.clemetparks.com/tilestache/tilestache.cgi/basemap/${z}/${x}/${y}.jpg</ServerUrl>
    </Service>
    <DataWindow>
        <UpperLeftX>-20037508.34</UpperLeftX>
        <UpperLeftY>20037508.34</UpperLeftY>
        <LowerRightX>20037508.34</LowerRightX>
        <LowerRightY>-20037508.34</LowerRightY>
        <TileLevel>18</TileLevel>
        <TileCountX>1</TileCountX>
        <TileCountY>1</TileCountY>
        <YOrigin>top</YOrigin>
    </DataWindow>
    <Projection>EPSG:3857</Projection>
    <BlockSizeX>256</BlockSizeX>
    <BlockSizeY>256</BlockSizeY>
    <BandsCount>3</BandsCount>
    <Cache />
</GDAL_WMS>

Now I can use my pretty tilestache maps _everywhere!_:
Image of coyote points overlayed on tilestache rendered hillshade map

Screenshot of map from postgis

edit: forgot the hattip for the lead on this, Thomas gratier: @ThomasG77

Posted in Analysis, Database, PostGIS, PostgreSQL, QGIS, SQL, TileStache | Tagged: , , , , | 1 Comment »

Parks Data Cake, part deux

Posted by smathermather on April 2, 2014

Following up on my previous post, I have started to detail the how of our parks map rendering works, including a GitHub repository with all the code and data to build your own in TileStache. One of these days, we’ll port this to TileMill, but in the mean time, it works and works wonderfully.

Screenshot of trailsforthepeople-styles github readme.md

 

— Addendum —

Truth in advertising– the contours data were not included in the repository as they are 1.3 GB all by themselves

— End Addendum —

 

Posted in Cartography, Recreation, TileStache, Trail Curation, Trails | Tagged: , | Leave a Comment »

Parks Data Cake

Posted by smathermather on March 24, 2014

Stamen has a great blog entry on mapping for parks on their blog. It’s a teaser for a deeper dive in mapping parks, and I’m staying tuned, as their write-ups tend to be detailed, thoughtful, and complete.

I thought I’d offer my own teaser– a bit of work done collaboratively with GreenInfo Network.  It started with their basemap– something they spent a few person-years refining from OSM data.

Example of GIN basemap

Example of GIN custom basemap

Custom basemap

We took it a little further by creating custom placed labels where the labels gave us some extra bang for the buck.

Custom text placement example

Custom text placement

And then we started to really play with the zoomed in versions, using nicely detailed streams, contours, and canopy boundaries (derived from LiDAR) to enrich the map, labeling natural features and major facilities with custom labels as well:

Image showing labeling, contours, vegetation, etc.

Detailed view of map

A couple of tricks we used here– first, the custom labels have shadows (convex hull) masks which match the background, ala this write up:

Example of masked text

Also, compositing is used heavily– the hillshade background is flattened significantly, and then overlayed with multiplied composites of park green, canopy green on top, contours, with all other layers being simple overlays. This results in a brightness and clarity to the information that allows for complexity without either muddling the map, or overwhelming the map reader.

Finally, since many of the parks are urban, major buildings are highlighted for context. In future revisions, we’ll add more (but still subdued) detail to the areas outside the parks, but this was a good start:

Example of major buildings showing on map near a park

In case you are wondering about technology, this is all done in TileStache (edit: and GeoServer).  In the future, this may well be replicated in Tilemill. More to come… .

Posted in Cartography, Recreation, TileStache, Trail Curation, Trails | Tagged: , | 4 Comments »

QGIS Compositing, more comparisons

Posted by smathermather on April 10, 2013

QGIS Compositing, more comparisons… .  You guess which is QGIS and which is TileStache… .

more_compositing_comparisons

Posted in Cartography, QGIS, TileStache | Tagged: , , | Leave a Comment »

QGIS Compositing, more gushing yet…

Posted by smathermather on April 9, 2013

Ever had a workflow on the web that resulted in stuff so nice, you wanted to replicate on the desktop?  Ya, me neither until recently.  I love the cartography a particular website, know all the bits and pieces of color and effects that go into, but had no desktop application that could do the same.   Until now.  On the left, QGIS, on the right, TileStache (i.e. mapnik).  There were a few practical differences in application which result in most of the differences you do see, but now we can wrap great cartography into all our products, printed or web.  And no, print is not dead yet, whatever the declaration.

blending_compositing_qgis

Posted in Cartography, QGIS, TileStache | Tagged: , , | Leave a Comment »