Archive for the 'Locality and Space' Category

Printing Maps; Twin Mountain DRG

Posted in Locality and Space on June 28th, 2008 at 09:11:27

So, I’m going camping this week. While camping, I plan to be hiking the White Mountains relatively extensively, from my home base at Lafayette Campground in Franconia Notch.

One of the best part of planning hiking trips is maps. I love maps. I love looking at them, finding things, exploring things. I love having them handy to reference, I love browsing around them.

However, when you’re on a trail, looking at maps on a computer doesn’t work particularly well. As a result, I’m trying to print maps, and finding that it’s a somewhat difficult proposition.

I have DRGs from the libremaps project: These are great. I’m looking at o44071b5, o44071b6, and o44071a6, all downloaded from the Libre Map Project. Unfortunately, I then went to go open c6, only to find that… it’s not available. Argh! I know that it exists: I can check the features that should be on it in the Terraserver DRG WMS, but no Twin Mountain quad.

Oh well. Not a huge deal, just annoying; I’ve got other maps that cover the area. Now the problem is that I can’t figure out how to take a tiff like these and print them over multiple pages on a home printer. Anyone got any tips or tricks on that? Printing on one page is somewhat useful, but not nearly as much as I’d like; I also don’t want to spend all day cropping and fighting with tools. If I have to do that, I’ll just survive with what I’ve got.

I’m going to go out to the local map store and see if they have a nice Atlas for the Whites; if so, I’ll take it. It’s worth it to have a little bit of extra knowledge about a place — and who can’t use more maps?

GeoJSON 1.0 Release

Posted in Locality and Space on June 16th, 2008 at 13:01:30

From the GeoJSON mailing list:

The GeoJSON Authors are proud to announce the finalization of the GeoJSON 1.0 Specification.

Representing more than a year’s worth of community discussion and development, the GeoJSON specification describes an easy to use, extensible format for transferring geographic data over the web. With support in more than 20 different applications, GeoJSON is already quickly becoming a de facto standard for transferring geographic data in a JSON format. The finalization of the spec represents the final step in formalizing the GeoJSON format for encoding this data.

More information on GeoJSON can be found at http://geojson.org/ , or from the GeoJSON mailing list at http://lists.geojson.org/listinfo.cgi/geojson-geojson.org .

Geographic Queries on Google App Engine

Posted in Locality and Space, Python on May 28th, 2008 at 12:05:13

I made a post over on the MetaCarta Labs blog about doing geographic queries on App Engine:

???????? ????? ????????In this way, I was able to put together a geographic bounding box query, on top of Google App Engine, using a Geohash-like algorithm as a storage format, and use that query to power a FeatureServer Demo App Engine application, doing geographic queries of non-point features on top of App Engine/BigTable. Simply create a Geoindex object of the bounding box of your feature, and then use lower-left/upper-right points as bounds for your Geohash when querying.

Geographic Queries on Google App Engine

Probably of interest to some of the people who read this.

Wherecamp2008: Ideal Conference-Going Experience

Posted in Locality and Space on May 20th, 2008 at 22:27:16

Wherecamp is the closest thing to a perfect conference going experience I have had in my history of going to conferences. The organizers — Ryan and Anselm — did a great job of pulling everything together, but I think that the single entity most responsible for making this happen was Google, and their representatives on the ground, Nate and Dusty.

Key things to good unconferences:

  • Constant stream of food. Geeks like to eat, and eating keeps us happy, healthy, and wise. Snacks are great, both healthy and unhealthy, and drinks and so on are also good. I think this, more than anything else, is the kind of thing that a well-funded social event should try to have. The meals at Google were also great, and having the space we did for serving was super useful for avoiding frustration at lines. In general, for the number of people who were present, Google’s facilties were significantly better prepared for serving people than my experience at Where 2.0 and FOSS4G events.
  • Big open space for organization, small cozy meeting spaces for sessions. One thing that repeatedly came up was that the conference spaces we were in for sessions were full — and, believe it or not, I find sitting on a makeshift chair in the back of the room *great*. The participation in the sessions was better than at any other unconference I’ve been too, because of the close-knit situation. Occasionally things were a bit too small — the Processing talk was one example — but in general, it was a good thing to be in close quarters.
  • Great wireless. Coverage of the entire space was perfect, including outside, and given that there were 300 people sitting around banging on it, that was far more impressive. I’ve seen networks fall apart under significantly less load, even at Barcamp Boston 2, at MIT.
  • Open Space: The central auditorium and outdoor areas were great places to chill out and enjoy your time. Not having to be stuck in a hallway, or running back and forth between sessions, was a wonderful end result, and the tables/chairs/etc. setup was just great.

The last thing that can make or break any conference is the people, and I couldn’t have asked for any better. I met and hung out with a bunch of Python Geo hackers — more so than I ever have in the past. We stayed up late, hacked all night (in my case, literally) and resolved a ton of issues. I got to hang out with some of the people that I really enjoy spending time around, and meet some new ones.

Thanks to all of you who made this weekend totally worth the trip. Special thanks to the organizers, and Google for being such a great host.

Next up is FOSS4G, I hope; I hope that I can take what I learned here and make an effort to turn FOSS4G into (at least partially) the event that Wherecamp was so successfully.

Cool Processing Stuff

Posted in Locality and Space on May 17th, 2008 at 14:19:23

Notes about Processing, from processing.org, and other related things.

“Drawing images is not about telling which pixels to turn on or off, it’s about telling to draw lines.”

In addition to processing being pretty, you can draw the entire map into any unit you want. Drew a bunch of lines out in state plane projected unit system, and then cropped image.

Drawing all of the streets in King County plus all of transit lines

4d expansion of transit data — time out of the map on photo

Processing is great at generating static images; looping over a dataset and drawing lines is what processing is for.

Demoing a bunch of demos of processing from Tom Carden; cabspotting, travel time tube map, etc. etc.

Processing.js: Processing in JS, by John Resig. Uses “Processing.js is like developing Processing on a 400mhz celeron”

Source code to London Tube Map is available; Processing makes source code available by default, Google for “powered by processing” for examples.

Stamen typically does Prototype in Processing, final client in Flash.

Processing is Java; it should be possible to pull in Java libraries; can import .jar files, can drag in data (images, etc.); loading data is a one liner.

NodeBox: “Processing in Python”

Obsessing.org: Processing.js GUI.

Same processing source code in browser and applet using Processing.js

Context Free Art: here

The default mode of processing is:
* Setup
* Draw function that’s called as much as possible

Going to publish cabspotting example to wherecamp wiki

Brandon demos OpenStreetMap data rendered on the fly with processing data.

NodeBox demo using a springgraph. Proxmiity fixes of local bluetooth data.

Processing is 4-5 years old now

Collaboration is typically “Copy an example, create your own, keep going”

Geohacking This Evening

Posted in Locality and Space on May 16th, 2008 at 11:40:45

Tonight, starting around 7:30, there is a plan to descend on The Dubliner, in Noe Valley, San Francisco, for beer and hackery. If the plan changes, I’ll update twitter. If you want to join us, please:

  • Comment here
  • Email me (crschmidt@crschmidt.net)
  • or Text or call me (603.264.2294)

Wherecamp, here I come!

Posted in Locality and Space, Wherecamp2008 on May 14th, 2008 at 08:39:13

I’m off to Wherecamp tomorrow. I’ll be in town and have no plans yet as of Friday, and I’ll be at wherecamp all weekend, planning to spend the night hacking at the Googleplex.

Who’s going to be there? Anyone interested in meeting up on Friday, or doing any hacking ahead of time or during?

Using TileCache with Google Maps, Virtual Earth

Posted in Google Maps, Locality and Space, TileCache, Virtual Earth on April 18th, 2008 at 06:15:00

In order to use TileCache to cache tiles for use in the Google Maps API, you need three things:

  • A WMS server which supports the spherical mercator projection
  • A properly configured TileCache pointing to it
  • A small snippet of code to add a custom TileLayerOverlay to your Google Map
  • A small snippet of code to add a custom TileSource to your Virtual Earth Map

WMS Server

My experience is with MapServer, so that’s what I’m going with here.

MapServer uses proj.4 for its reprojection support. In order to enable reprojection to Spherical Mercator in MapServer, you must add the definition for the projection to your proj.4 data directories.

On Linux systems, edit the /usr/share/proj/epsg file. At the bottom of that file, add the line:

<900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
               +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

After you do this, you must add the projection to your wms_srs metdadata in your map file:

map
  web
    metadata
      wms_srs "EPSG:4326 EPSG:900913"
    end
  end
  # Layers go here
end

This will allow you to request tiles from your MapServer WMS server in the Spherical Mercator projection.

Configuring TileCache

Your TileCache configuration will need to point to your WMS installation, using the parameters suggested for Spherical Mercator in the default tilecache.cfg.

[google-tiles]
type=WMS
url=http://labs.metacarta.com/wms/vmap0
layers=basic
extension=png
bbox=-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892
maxResolution=156543.0339
srs=EPSG:900913

Here, you can see that I’ve used the MetaCarta Labs vmap0 WMS. If you’re using a standard MapServer WMS, you might have a url more like:

url=http://example.com/cgi-bin/mapserv?map=/mapdata/mapfiles/vmap0.map

Setting up Google Maps

Finally, you must make a GTileLayerOverlay for your tiles.

    var myTileLayer = new GTileLayerOverlay(new GTileLayer(null,null,null,{
      tileUrlTemplate: 'http://example.com/tilecache/1.0.0/google-tiles/{Z}/{X}/{Y}.png?type=google',
      isPng:true}));
    var map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(0,0), 0);
    map.addControl(new GSmallMapControl());
    map.addOverlay(myTileLayer);

The ‘type=google’ flag on the end of the URL tells TileCache to use the “Google-style” 0,0 in the upper left corner.

Once you’ve done this, you should have a TileCache layer on top of your Google Maps base layer. You can see an example of this setup, just for proof that I’m not putting you on. :)

Virtual Earth Javascript

“But I don’t like Google!” you say. “I want VE!” Well then, why aren’t you using OpenLayers already? I mean, that’s what it’s for, right? :)

More seriously, VE isn’t much more difficult:

    vemap = new VEMap('myMap');
    vemap.LoadMap(new VELatLong(0, 0), 0 );
    //Add layer
    var tileSourceSpec = new VETileSourceSpecification("mclabs", null, 1,
       [new VELatLongRectangle(new VELatLong(-86,-180),new VELatLong(86,180))],
       1, 16, function (tileContext)
{
   if(tileContext != null && tileContext != "undefined")
   {
      var key = tileContext.ZoomLevel+ "/" + tileContext.XPos + "/" + tileContext.YPos + ".png?type=google";
      var path = "http://example.com/tiles/1.0.0/google-tiles/" + key;
      return path;
   }
}, 0.8, 100 );
     vemap.AddTileSource(tileSourceSpec);

     var tileLayer = new VELayerSpecification(VELayerType.VETileSource,"mclabs","mclabs");
     vemap.AddLayer(tileLayer);

And, for your viewing pleasure: an example of the same tileset in use.

Client Side Storage Engine and OpenLayers

Posted in Locality and Space, OpenLayers on April 15th, 2008 at 21:26:16

Using Client Side Storage for Mapping — a proof of concept which saves locally drawn features either via HTML5 Offline Storage or the same from Google Gears.

OpenLayers 2.6 Release

Posted in Locality and Space, OpenLayers on April 15th, 2008 at 20:12:06

After a long, long haul, r6945 tags OpenLayers 2.6 as a final release.

The OpenLayers Development Team is proud to announce release of OpenLayers 2.6. As of this final release, the OpenLayers 2.6 release closes 294 outstanding tickets. This is the largest of any OpenLayers release to date.

Client side reprojection! Smooth commercial layer panning! KML styling support and pretty, auto-sizing popups! Improved styling support! And lots more.

Six months in the making, this is the best OpenLayers release ever. (And only two RCs! A new record. Here’s hoping that’s not just because we had no testers… ;))

Use 2.6 today!