Tripping the Bits
t @

FOSS4G 2011

Updated:

Here are some raw notes from my FOSS4G workshops & sessions so far. Enjoy!

Mapnik & TileMill workshop

  • Presented by Development Seed
  • You should learn Python & node.js
  • TileMill used in today's example
  • TileStream used to serve tiles
  • TileStream hosted is $50/mo for only five 1GB .mbtiles files
  • On IRC, visit #mapnik
  • TileMill Windows client planned in 2 months
  • Python sample
    • - import mapnik2
    • - m = mapnik2.Map(256, 256)
    • -- Python error
    • - type a module name to list from where it was imported
    • we attempted to install mapnik2 from source but it didn't work, on to TileMill
  • TileMill is a website, control room
    • - add data/layer
    • - can view data attributes
    • - geojson/spatiallite via OGR
    • - how does OGR do lat/lng vs x/y?
    • - drag drop layer order
    • - save to update map w/ new CSS
    • - carto is LESS CSS-like language, .mss files, link for reference
    • - has variables
  • new project
    • - change Map background-color, save
    • - new layer
    • - postgis, connection string
    • - postgres command line
    • -- psql -l (list databases)
    • -- psql database-name
    • -- \d to list tables
    • - error mapbox is undefined
    • -- auth error, check username and password
    • - if no rule, nothing renders for layer
    • - #data { marker-width: 2; }
    • - [highway='traffic_signals'][zoom>=10]
    • - assumes spherical Mercator
    • - wrench=>view mapnik XML link
    • - subquery as data source: (select name from roads where ST_Length(way) > 8000) as longroads
    • - that ending as is required
    • - line::case is border, line::fill is fill? these rules were confusing
    • - carto has a command line, export as mml
  • MBTile
    • - embeds every feature id in tile as JSON in tile itself
    • - replace .png with .grid.json to see all feature data
    • - follow TMS standard
  • Modest maps, web mer JavaScript api
  • Export
    • - preview is only for MB tiles
    • - download MB tile
    • - cp to ~/proj/tilemill/files/export/
    • - browse TileMill (:8888)/#!/ for list
    • - you do have access to the .grid.json file
  • TileStash renders mapnik to amazon
  • Fast maps
  • - ab tool to profile requests / sec
  • - Proj 4.8 doesn't lock as much
  • - OGR has trailing spaces in proj4 string, can cause mapnik to reproject on fly to same projection, be careful

node.js & Polymaps workshop

  • Github proj, chelm/FOSS4G-Node.js...
    • - network issues preventing start by 1 hour
  • npm - node package manager
    • - search packages on website
    • - geonode - GEOS wrapper on node.js
    • - express & socket io to be talked about today
  • node
    • - evented framework = callbacks
    • - callbacks don't block the thread
    • - commonjs modules
    • -- hello.js: exports.myvar = function () ...
    • -- require ('./hello')
    • - only one thread, don't block it yourself
  • express
    • - req.query is an object
    • - template engine called jade
    • -- response.render( 'template.jade', args)
    • -- look in views dir by default
  • EventEmitter
    • - emit(eventname, args)
  • Ticker.prototype = new EventEmitter adds emit & addListener to Ticker function object
    • - prototypical inheritance
  • Twitter
    • - npm install twitter-node
  • Polymaps
    • - all svg
    • - styled with CSS
    • - can embed canvas in svg element for dynamic color changes
    • - tiles & geojson
    • - vector tiles?!
    • - but only TtileStash creates vector tiles so far
    • - clusters on load, not on the fly
    • - 38k minified
    • - lots of .add(po.functionality()) chained
    • - .on("load", function ( data ) { data.features[0].element } )
    • - CloudMade has hosted tiles once you register
    • - colorbrewer - gis color ramps in JavaScript
    • - protovis - data analysis, Scale.quantile, etc.
    • - geocommons, datasets available via .json extension
    • - using jQuery for events
    • - map.coordinateLocation function
    • - socket io using web sockets to bind client handlers to server events

State of PostGIS

  • paul ramsey
  • database is types, indexes & functions
  • spatial database just adds spatial to to those three
  • mysql is STILL not a spatial database
  • arcsde was never a spatial database, it's middleware. also, it's going away
  • history of postgis versions
  • native support by esri in arcgis server
  • "not as cool as new kids" CouchDB, etc.
  • we're "yesql"!
  • postgis has prepared geometry
    • point in polygon is O(n), but indexing edges brings it to O(log(n))
  • supports curves
  • 2.0 out in six month-ish

Oceans using OGC services

  • scientists & tech guys working together
  • data comes from scientists in all formats
  • filter by time & depth, the ocean is "4D"
  • Flex thin client, many filters
  • ncwms? wms that serves up nc? data
  • scientists willing to take a cut in performance in order to see the data
  • LarvaMap, find where larva are floating, they can't swim after they hatch
  • NetCDF, open source server over HTTP for large data sets
  • OGC-Search, find WMS services
    • Metadata isn't updated, a problem for search
    • version 2, bbox search
  • Environmental Data Connector pulls open source data into ArcGIS
  • github/asascience

Geomagas

  • Native
    • - pro: all device sensors
    • - con: app stores
  • mobile web
    • - caniuse html5, html5 isn't everywhere yet
    • - JavaScript is slow
  • Current geomajas
    • - Java is both dev & test environment
  • Gwt
    • - works w/ mobile
    • - only sends code you use
    • - one html file is everything
  • Future
    • - all Java, split common api out for android & blackberry
    • - combine layer tiles on server
  • Demo
    • - android native browser missing svg, using Firefox for mobile demo

Opticks

  • comet created for USAF
  • open sourced in 2007, bringing internal code over in parts
  • why open source?
    • hard to get other gov agencies to use it otherwise: "not invented here" syndrome
    • Ball Aerospace is a service company, will never sell software
  • problems?
    • contracted CollabNet to resolve open source confusion: doesn't mean just anyone can make code changes
  • "geospatial infrastructure" first part open sourced
  • lgpl, sourceforge
  • multiple gov projects using opticks as foundation
  • applied for OSGeo incubation
  • no governace board but governace board required for OSGeo incubation
  • all core contributors are or were Ball employees
  • still slow from outside contributions; mostly bug reports and docs

Social Networks on OpenLayers

  • started with valencia tourism geoportal
  • OpenLayers 2.11 has a special jsonp protocol handler, fly..something?
  • twitter & gowalla from POIProxy framework, pretty nice OpenLayers plugin
    • access to different POI services

Google Fusion Tables for flood mapping

  • Had to be done in 90 days
  • Fema nfhl can map flood planes but little control
    •  also not friendly
  • Mashup w/ Google, points & poly
  • No code change but suddenly 45 deg oblique imagery one morning
  • Popup has links & data from fusion table
  • Built Google table by hand
  • Schema create statement generated via postgres select
  • Postgres select to generate Google select
  • Secret: load data with insert but send 500 inserts per request w/ semicolons between
  • FT drops points over 500 per line
    • - they chopped the geometry by tiling scheme
    • - no geometry had more than 500 points
    • - better now on Google's side
  • Cartography done via table, fill
  • Very accurate
  • Not enough carto options, they want cross hatching
    • - request sent, waiting for google
  • Summary: worked very well
  • Automated create / insert PHP scripts available vcfloodinfo.net
  • Using free Google maps
  • FT, only five layers allowed
  • Can filter data on the map
  • Very active group
  • Can't use internal only due to Google license
  • Shows ads

GXP

  • For quickly editing sites
  • GeoExplorer uses this library
  • {ptype: gxp_legend, outputTarget: id}
  • gxp_featuremanager, layer: { local, name: 'USA:streets' }
  • From OpenGeo
  • Like esri build an app, full website
  • Feature editing with snapping to other layers
    • - gxp_featureeditor, snappingAgent:
    • - snapping agent references another layer
  • github/opengeo/gxp
  • Can use Google: map, street view, search
  • Using openlayers behind the scenes?
  • bartvde@opengeo
  • No undo yet
  • GeoServer-based authentication
  • Can make plugins
  • Other note: GeoGit new project adds versioning to geoserver from OpenGeo?

Using PostGIS with QGIS

  • first use case for QGIS was only a postgis viewer
  • now it's a gis platform
  • version 2 coming, raster support & routing
  • filter source table while loading as layer
  • updatable view: a PostGIS view that can be edited in QGIS
  • uses postgresql for authentication
  • wfs-t support
    • http level rights (web auth)
  • offline editing
  • python plugins: pgVersion, subversion for postgresql
  • fast SQL layer, dynamic queries (like ArcMap's Query Layer?)
  • raster support
  • DB Manager is the future?

OSM Plenary

  • England combined vehicle time tracking to a map
  • State of the Map, an OSM convention
  • OSM Foundation
    • legal entity
    • maintains servers
  • Sweet visual at itoworld.com
  • OSM is about zoo mapping! ( also other things :)
  • Wheel chair routing
  • Address Hunter
    • address scavenger hunt game, multiplayer, find & take photo

FCC Plenary

  • Communications is 7% of national GDP
  • Time to market is #1 most important issue
  • Obama issued Open Data Initiative
  • Congress required data to be searchable
  • FCC built REST services for block level data
  • Pew Internet Research
  • Intern threw together a mobile geolocation internet provider search on github quickly

MapServer status

  • map server is old (project in mid-90s)
  • 6.0 release with 6.0.1 security fix (upgrade!)
    • rendering plugin API
      • original was GD (8-bit gif)
      • 4 graphic backends shipping in 6 including OpenGL
    • expression parser rewrite
    • auto clustering, e.g., [6] graphic is six features, zoom in to see
    • built-in OpenLayers previewer
    • lots of WCS improvements, 2.0 support
    • multiple label styles per layer/shape, e.g., highway names and shields
  • 25 source commiters, 13 PSC members (project steering committee)
  • OSGeo project
  • next
    • wfs-t support to postgis
    • built-in caching (MapCache) based on mod-geocache
    • svg symbol definitions (there's an RFC, but which one?)
    • auto-projection (also has an rfc, but which one?)
    • by "RFC" he means OSGeo-specific RFC proecess?

State of GeoTools

  • actively committed project
  • keeping up with bug reports
  • dropped the 2. from version number 2.8 => GeoTools 8
  • lots of doc updates
    • live code examples
    • 100,000 words
  • referencing subsystem updated
    • more projections
  • new vector data support: csv, directory of shapefiles
  • new raster support: GeoTIFF, JP2, GRASS
  • improved database driver
    • prepared statements
  • new DirectLayer to write your own paint function
  • StyleBuilder to help create SLD
  • plugin will render custom SDL xml using your own Java code
  • new transformation process for rendering or geometry processing
  • process engine about to graduate to core functionality
  • can now hook into Terradata data store
  • temporal support
  • query improvements
    • supporting joins in WFS queries

MapServer coverage support

  • no one here is regularly using the coverage service
  • wcs 2.0 standard is only a few months old
  • three requests: GetCaps, DescribeCoverage, GetCoverage
  • prereq: proj4, gdal, libxml2
  • same format as layer in mapfile
  • mapserver reads many coverage metadata attributes but none are required

Tile generation with Mapnik & Node.js

  • open source version of fusion table
  • CartoDB = tiler + Carto CSS + spatial SQL api + OAuth + UI
  • view/edit data in UI via grid
  • view/edit data on map via mouse & hover & drag
  • live SQL query filter on map interface
  • PostGIS on the back end for demo
  • add columns on the table UI
  • helps move some mapping back to server, mix with vector on the client
  • Oops, "we wrote a map server"
  • Amazon's main site is made from 300+ calls to 100+ HTTP APIs
  • Tired of large map servers
  • cute evented system example of boiling water for tea and going to the door to get a package
  • no problems with the Mapnik stack
  • github/Vizzuality

Mapnik2GeoTools

  • mapnik definition
  • mapquest's map design has 20 pages of styles, class breaks, etc.
  • wrote a parser to export OGC filter XML
  • put shapefiles & tiffs in data directory for geoserver
  • process
    • run tool
    • open Mapnik file
    • click Convert!
    • look at output SLD file
  • vendor mapnik option support varies
  • misc
    • css has a different rendering model in geoserver, harder to convert from Mapnik
    • see also: mapnik distiller
  • github/dwins/mapnik2geotools

Comments

blog comments powered by Disqus