Archive

Posts Tagged ‘geo’

Cartograhpic Principles

October 25, 2012 Leave a comment

I’ve recently read an article which has given me a huge insight into some cartographic principles. Principles which I had been using were given the rigour they deserved.

What I gain most from it was that one kind of map among many is the physical map. The physical map is designed to portray the feeling of the environment. One way to do this is to use a suitable base landcover palatte as suggested in the article, combined with relief shading and textures to represent the environment to the fullest extent.

The use of hypsometric tints is debated. Personally I think that every map feature is fit for a purpose and hypsometric tint are no different. It is deciding what you want your map to show, and how you are going to combine these features into a single map to make it multi-purpose.

Hypsometric tints are useful for showing elevation levels (no surprise there). So for showing points above a certain altitude where the air may be getting thinner, or comparing which of these two mountains is higher, or by gauging if this is just a small hill or Mount Everest.

Contours are good for showing steepness (how close the lines are together) and identifying the gradient of a paths by if the path runs parallel or orthogonal to the contour line.

Shaded relief is great for getting a general sense of where the hills are and their form.

Physical coloured landcover combined with textures or representative bump maps give you a feel for the environment.

The next task is building up a physical map which gets applied to OSM data (possible in tandum with other free sources) which uses natural colours, shaded relief, textures and bump maps. The only question is whether to build something like the Stamen watercolour maps but with natural colours and textures, or instead work towards a natural style for osm2world (or any other osm to 3D world program).

Advertisements
Categories: Uncategorized Tags:

A free and open source SRTM shaded relief and contour map

October 9, 2012 Leave a comment

I’ve recently pushed out a new srtm3-stylesheets repository which contains shell scripts for working with NASA SRTM DEM data, gdaldem based stylesheets for shaded relief maps, Mapnik stylesheets for contours and a TileStache configuration for sandwich those styles together into a single map.

This was spurred on by the fact that I simply needed a map which showed hills. I’ve used Andy Allan’s OpenCycleMap in the past which has color relief and contours. Unfortunately it is closed source.

So I put my head down and hacked together repeatable scripts to get the source data up and running and some basic stylesheets to produce a usable and pleasant looking map. All released as free and open source software under the CC0 license.

Contour Map

I want to avoid adding things like streets etc, such maps could be built as separated layers based upon this style and sandwiched together, for example, with the TileStache sandwich provider.

I hope to build upon the lessons learnt here to produce a map like the Stamen Terrain map, except with the source code released under a free and open source license. Perhaps just with hill and slope shading applied to landuse with other map features placed on top.

Contour Map

Contour Map

I’ve rendered NSW (only server resource prevent worldwide!) as a slippy map here.

Categories: Uncategorized Tags: , ,

Making a Shaded Relief Map from the Geoscience Australia Australian Bathymetry and Topography Grid

September 30, 2012 Leave a comment

I’ve just released some scripts and stylesheets for the Geoscience Australia Australian Bathymetry and Topography Grid data.

Here are some samples of the final outputs. (also available as a layer on my demo slippy map)

ga-ausbath-shaded-relief-extent

 

ga-ausbath-shaded-relief-gbr

ga-ausbath-shaded-relief-tas-landmass

ga-ausbath-shaded-relief-islands

These images based on data © Commonwealth of Australia (Geoscience Australia) 2009, which was released under the Creative Commons Attribution 2.5 Australia Licence, http://creativecommons.org/licenses/by/2.5/au/.

The code I used to produce these images is CC0, so as far as I am concerned you are free to recreate them under whichever license is compatible with the upstream data. If you just wish to use these images, I license the ones you see here (so only if you grab them from here, rather than re-rendering them) under the Creative Commons Attribution 3.0 Australia license, http://creativecommons.org/licenses/by/3.0/au/.

 

 

Categories: Uncategorized Tags: ,

Loading the ASGS into PostgreSQL in preparation for the ABS 2011 census data release

April 15, 2012 Leave a comment

Over the extended Easter period I found myself with some extra free time, the result is https://github.com/andrewharvey/asgs2pgsql – A bunch of scripts for loading the ASGS into PostgreSQL/PostGIS, and a database dump of the final product.

The ASGS is the geospatial fabric for the ABS 2011 Census data. My idea was to put in place a stable PostgreSQL schema for the ASGS and put together a well defined process for loading data into that schema.

As a small example of using the data I wrote some carto/qgis stylesheets for the various ASGS structures. Source code is at https://github.com/andrewharvey/asgs-stylesheets with a live example at https://tianjara.net/leaflet.html#map=asgs-2011-mb which shows the ASGS Mesh Blocks coloured by the landuse assigned to that mesh block.

With this building block now in place, when the actual census data starts to be released in June 2012 I will hopefully be able to load it into a relational data model with references to ASGS geometries all in PostgreSQL (and PostGIS).

I’m not sure if I’ll need to choose between wasting time scraping data from the ABS website or I should go straight to the DVD

If the $100 is really just for the cost of the DVD+admin surely the ABS can put the entire DVD contents on its webserver, all under the Creative Commons Attribution license. If I do purchase the DVD I sure as hell would want to ensure it notes that its contents are CC-BY licensed.

I also am interested if the census data will also be available as datacubes.

Categories: Uncategorized Tags: ,

Development Update (Static OSM Tiles, git rebase, Map Labelling)

December 11, 2011 Leave a comment

Map Labelling Suburbs and Cities

Yesterday I pushed a bunch of changes to my OSM/Aerial Imagery Hybrid Style, see the (demo). I spent a bit of time on suburb and city labels as they are a really important feature of a map aimed at non-experts.

I’m finding making a non-trivial style like this has defiantly made me realise the difficulties of such a task.

There are a lot of improvements that can be made (either by modifying or making new components) to the OSM Mapping conventions, osm2pgsql/imposm, mapnik library, carto language stack. That said, the current form is still great and you can still make great maps. But,

I would like to be able to but this needs
have labels for large bays at lower zooms than small bays need bays mapped as closed ways covering their area, rather than a point in the centre
define a linear function for the size of icons. i.e. at z10 the icon is 10px, at z20 the icon is 20px, now linearly interpolate all sizes for zooms in between either build this functionality into the carto language, or make another higher level macro like language which you can code this in which is then compiled into carto
render spread text inside a riverbank needs functionality in the mapnik rendering engine

Static OSM Tiles

I’m still yet to find a tile server which is fast and works well with lighttpd (nginx would probably suffice too). As an experiment I decided to pre-render a bunch of tiles for my hybrid style sheet. This tile layer doesn’t need to be minutely updated, anyone who needs that can use the normal mapnik layer. Also static tiles server straight from the webserver should be pretty fast (maybe on memcached tiles would be faster) and I wanted my tiles to be fast.

Next up how can I generate these static tiles? There is the popular generate_tiles.py, but that won’t render meta tiles, seems like such a waste to render every tile with a buffer of 128px when I would render a 5 by 5 meta tile of the same buffer for only 36% of the total pixels rendered. The larger the meta tiles the larger the latency, but if I’m pre-rendering them all than latency doesn’t matter any more.

So I wrote a C++ program as my replacement for generate_tiles.py. I also programmed it to render from a list of meta tiles rather than a bbox. This means for my demo I can only render high zooms where there is nearmap coverage. This is where https://github.com/andrewharvey/OSMTileListFromGeometry/ came in, which pulls nearmap coverage areas from an osm2pgsql database, and generates a list of meta tiles.

Using this method I rendered up to and including zoom 17, composed of 22444 5 by 5 meta tiles or 561100 regular tiles in a time of,

real    198m17.021s
user    103m49.985s
sys     37m36.117s

with disk usage,

<1M   0-8
2.0M  9
6.8M  10
26M   11
98M   12
13M   13
36M   14
114M  15
411M  16
1.5G  17
========
2.2G  total

(Updated with results when using “png” rather than “png256”)

real    228m17.082s
user    160m24.725s
sys     31m42.653s

with disk usage,

<1M   0-8
3.1M  9
8.6M  10
28M   11
121M  12
34M   13
83M   14
218M  15
663M  16
2.0G  17
========
3.1G total

I think that time could still be sped up with,

  • tuning of the mapnik stylesheet queries
  • tuning of the postgres database
  • spanning more rendering threads
  • using larger meta tiles
  • using a machine with more that 512MB of RAM
  • not running minutely updates in the background

Git Rebase

As I use git more and more I’m slowing learning more of the features it has to offer (and thanks to the free hosting by github). One such feature which I think is awesome is git rebase. As an example the other day I did git commit -ammend instead of git commit --amend (I knew there was a duplicate character somewhere but because I seem to have a tint of dyslexia I confused the duplicate — with mm).

Of course this resulted in committing all files which had changed with a message of “mend” as a new commit. I did this twice, and only noticed after I had already made a bunch of correct commits afterwards. With git rebase I could pop some commits of the commit stack, remove the two “mend” commits fix the commit which I should have been amended to and pop my other commits back on top of the stack.

Thanks to http://stackoverflow.com/a/180085.

Next Up

  • build a daily OSM planet extract by pushing minute-replicate files into the osmosis psql simple schema, then dumping to an OSM file
  • use this OSM file as a basis for monav and an OSRM service for fosm data
  • run a name finder service for fosm data
  • more updates to the hybrid map style
  • render the hybrid style tiles as oblique images for nearmap multiview
Categories: Uncategorized Tags: , ,

OSMT

October 9, 2011 Leave a comment

I feel the map style I’ve been working on recently is in good enough shape to announce. It is written in carto and designed to be used with OpenStreetMap data. It is an overlay layer for aerial imagery, though in my example I use NearMap imagery.

Take a look at http://tianjara.net/osmt.html.

The source is at https://github.com/andrewharvey/osm-hybrid-carto/, licensed CC-BY-SA.

There is still lots of work to do on it though.

I also have a lightweight cycle-overlay too (view example at http://tianjara.net/leaflet.html and tick on the cycle overlay or view the code at https://gist.github.com/1216315)

Categories: Uncategorized Tags: ,

3D NearMap Prototype From 4 Oblique + 1 Ortho

September 4, 2011 Leave a comment

I was on a flight the other day and I enjoyed looking down and seeing the land from a different perspective. It reminded me of a project I was working on which was essentially a 3D map viewer like Google Earth, but not in perspective and just implemented in the web browser. The main incentive was NearMap doesn’t just offer orthophotos, but 4 oblique views too. So leveraging on Polymaps I got a prototype working: http://tianjara.net/3d-nearmap.html It allows you to move the camera with the WASD keys, when your view angle gets smaller (less straight overhead) it switches to the oblique views. (It would be nicer if you could use the mouse to rotate though… patches welcome)

Just viewing the obliques with NearMap’s front end at nearmap.com, you will often find all the buildings are slanted on an angle, with my viewer however you can correct this to make them straight and looking nice again by tweaking the camera rotation. If nothing else came out of this experiment I think that just the mere ability to easily correct this artefact to produce nicer looking obliques made it a worthwhile endeavour.

You could push the concept further and add perspective (like Google Earth, rather than my simple parallel projection) and have each tile pick the optimal {Vert|N|S|E|W} layer, although with LIDAR progressing we can now capture true 3D so we don’t need to fake it with 2D images any more…

Categories: Uncategorized Tags: ,