2007 (old posts, page 15)

Yo!

Ed, you forgot an event. Down here, in the grassroots.

Update: of course you can't get any more grassroots than OSM.

Comments

Re: Yo!

Author: Ed Parsons

Sorry can't make Colorado.. but good luck with it and say hi to peter batty for me

Alternative to ogr.py

If you've found PCL's feature model and API too fancy, you may want to look at the GeoDjango gdal code. It's not developed as an independent Python package, but it seems like it could be done. It would make a nice addition to the GIS packages already in the Python Cheeseshop.

GeoSummit Agenda

Update: More from Peter Batty, John Spinney, and Chris Haller.

While some topics are being hashed out on our Google page, the actual schedule remains to be decided Saturday on-the-fly. My ultimate goal is to help merge all the cool agendas people bring, but I have a few of my own.

Bank on me to mount my RESTful GIS hobby horse and start tuning up my arguments for the FOSS4G conference. I'd also like to help lead discussion about non-traditional data models and storage in the context of my Pleiades site. I know that I'm not the only one with data that doesn't fit in a single feature table. Maybe this could potentially lead into a data management or stewardship (a hot topic recently) session.

I'm looking forward to reducing my ignorance about mobile GIS and location-based services. I missed the Churchill navigation system demo at a recent Front Range Pythoneers meeting, and hope to get one at the GeoSummit. I hear they're making great use of Google Earth at the NSIDC, and I expect that will be a part of at least one big virtual globe session.

I'll see you there. Saturday, 16 June.

Rome Reborn as a Flash Movie

Mike Shaver's post about rich internet applications, with the great quote

If someone tells you that their platform is the web, only better, there is a very easy test that you can use:
http://sgillies.net/images/is-this-the-web.png

rippled around last month, and I was reminded of it again when I viewed the Rome Reborn 1.0 flash movie (via The Stoa Consortium). It's slick, no doubt, but you can't really call it a web site. This manifestation is practically unusable. Flash movies should complement -- never replace -- addressable, linkable, bookmarkable, and programmable web sites.

See also Daniel Cohen and Roy Rosenzweig in their book Digital History.

Comments

Re: Rome Reborn as a Flash Movie

Author: Bill Thorp

Is this really about Flash, or even web sites? Couldn't I render obtuse SVG in a browser? PDFs? AJAX? Applets? Would you really deep-link their content if you could? Should they want you to? (There are ways: http://www.unfocus.com/projects/)

Re: Rome Reborn as a Flash Movie

Author: Allan

Trouble is, Flash is considered the "easy" way towards cross-platform rich content delivery. There's only one Flash engine that gets ported by one company. Browser engines present a messier landscape to provide content for. Furthermore, Flash apps are probably being built by media design people who don't have a deep appreciation for the implications of non-URL-addressable content that gets buried in the process. I think the solution is not so much to rail against the people who do this but rather to provide examples of what you/we consider better practices. These people are earnestly doing their jobs and when they look around for "how do we build an interactive web site to showcase our stuff" they will have a greater likelihood of finding decent patterns.

Re: Rome Reborn as a Flash Movie

Author: Sean

Ross Scaife (from The Stoa Consortium) found himself unable to link to his favorite image on the Rome Reborn "site", something that we take for granted on the dull, plain old HTML web. I have no problem with Flash, the tool. A site implemented entirely in javascript with no links (no non-human UI) would be almost as bad. It might as well be a glossy paper brochure. Best practices are clearly laid out in Cohen and Rosenzweig's book. The authors were not as concerned about the programmable web as I am, but their advice about URIs and multimedia is as relevant to machine users as human users.

Re: Rome Reborn as a Flash Movie

Author: Bill Thorp

"Flash with Named Anchors" is an HTML publishing template in Flash. This is an awareness issue. The authors of Rome... don't know how to use it, and Mr. Scaife must be totally unaware of HTTP packet sniffing. http://www.romereborn.virginia.edu/imageG8.jpg

Re: Rome Reborn as a Flash Movie

Author: Sean

Good fodder for this weekend, yes?

Python Pain Points

So, there's this meme that you have to be able to enumerate your domain's pain points. For Python and GIS/neogeography these include:

  • the standard library's xml.sax and xml.dom. ElementTree and lxml are the way to go.

  • unittest. I wrote a pile of unittest modules for MapServer's SWIG bindings, aka mapscript. So many that it'll be a while before I slide out of the top 5 all-time MapServer LOC. The tests never really caught on with other developers. The generic xUnit style didn't help seasoned developers cross over, and doesn't help explain usage to new users. These days, I'm much happier using doctest. It's been hard for new Python programmers to find good advice on the right testing framework, and the consequence for open source Python GIS is that people don't write tests.

  • distutils and setuptools. Python's packaging and distribution story is too arcane. Yes, this is intricate stuff, but it needs to be easier. People developing open source GIS for Python rarely bother to figure out the old distutils setup, let alone eggs.

  • str and unicode. Python's unicode story is not bad, and will be even better when unicode is always on.

  • function names. This is a small itch (caused by exposure to Ruby), but I'd love to be able to use self-descriptive Python APIs like:

    >>> if polygon.simple?      # instead of isSimple()
    >>> polygon.rotate!(angle)  # rotate self, not a copy
    
  • mapscript.py and gdal.py. Many users come to Python via MapServer and GDAL, which is unfortunate because those applications have terrible, un-Pythonic APIs (that ripple through the open source GIS community) and have created the impression that Python is just a binding for C/C++ code.

Comments

Re: Python Pain Points

Author: hobu

MapServer's unittests have slowly gained traction, but recently both myself and Umberto have made commits to them to help with watching the 5.0 release. I agree that doctest is much better and it would be nice to port MapServer's tests to it someday. Re: eggs. Both GDAL and MapServer will use setuptools first if it is available (although current trunk of GDAL will do --single-version-externally-managed by default if you use the 'make install' target). I fricking hate eggs though. In a web-enabled world, having eggs not extract themselves by default in someplace like /tmp that is writeable to processes like Apache causes much pain. Python eggs in their current incarnation seem like an obscene hack to me, with their behind the scenes path munging, unzipping, and other magic. That setuptools also busts compatibility with distutils also causes pain (ie, I can't do --prefix with setuptools but can with distutils). What did setuptools really solve that distutils didn't already again? Python may be fully unicode aware someday soon, but the C/C++ libs that we depend on in the Open Source GIS domain won't be. re unsightliness of gdal.py and mapscript.py... The first one out the gate gets shot in the back :) Do we change it now to make it pretty and break hundreds of thousands of lines of code and piss everyone off who's currently using it?

Re: Python Pain Points

Author: Sean

I like eggs. The development setup target is very handy, and I'm even planning to make more use of the dependency resolution before my projects hit 1.0. Those are my favorite features not found in distutils. I don't have a solution for my mapscript and ogr pain other than to improve Shapely, Rtree, and PCL, and get them to 1.0.

Shapely Geometries for Python

Shapely is to be an LGPL-licensed replacement for PCL's cartography.geometry package. Like its ancestor, it will provide familiar geometry classes with all the spatial operators of GEOS. When done, cartography.geometry can be rewritten as a lightweight layer over the new code. Additionally, Shapely will have a more Pythonic serialization story, and plug and play with other powerful Python packages using the Numpy array interface. Last, but not least, Shapely will be much easier to build, install and deploy.

Shapely serializes and deserializes using the familiar idiom from the pickle module. Here's a pickle stream example (an actual project doctest):

>>> from shapely.geometry import Point
>>> import pickle
>>> point = Point(0.0, 0.0)
>>> data = pickle.dumps(point)
>>> pp = pickle.loads(data)
>>> pp.equals(point)
True

Comments

Re: Shapely Geometries for Python

Author: Bill Thorp

Sean, apologies for this aside... Shapely isn't something you're authoring, is it? I've been meaning to write about my love/hate relationship with certain JSON serializations. '{"type": "Point", "coordinates": [0.0, 0.0]}' is a crazy-horrible waste of space, especially when you consider points are part of just about any geometry. I imagine that most JSON geometry serializers act like this. Mine does, with shorter attribute names. Tripling geometry bandwidth is bad, but using custom JSON (de)serializations just for geometry is also a questionable undertaking. I'm torn between thinking this is a case where KISS just does not apply, and questioning the point of optimizing JSON when large geometries are bunk in browsers anyway.

Re: Shapely Geometries for Python

Author: Sean

JSON is but a small facet of Shapely. Yes, the GeoJSON coming out of our working group is a bit verbose. I like my initial {"type": string, "value": array} better. Anyway, reducing bandwidth versus XML isn't my motivator. I want a non-XML data option, to exchange dicts.

Re: Shapely Geometries for Python

Author: Justin Bronn

You'd still need to hack with OGR since GEOS does not read geometries directly from geographic datasets (e.g., SHP files). That's one of the reasons I implemented GeoDjango's ctypes interface for GDAL/OGR (includes a "pythonic" API).

Re: Shapely Geometries for Python

Author: Sean

Yes, you need GDAL to access legacy data. Your GeoDjango package looks good (and I've definitely learned a lot from your ctypes examples), but it's too tied to Django to be useful to me. On closer examination, looks like one should be able to add contrib.gis to python path and import contrib.gis.gdal after all.

Re: Shapely Geometries for Python

Author: Justin Bronn

On closer examination, looks like one should be able to add contrib.gis to python path and import contrib.gis.gdal after all.
Sean, I've tried to ensure that GeoDjango's external interfaces to GDAL/OGR and GEOS were as loosely coupled as possible. As far as I know, both interfaces are completely independent of Django -- the only requirements are ctypes and a compiled C library of the interface.

Local Bloggers at GeoSummit

In spite of our scheduling conflict with the ESRI UC, the FRUGOS GeoSummit now has most of Colorado's geo-bloggers. Come see Bill "MapWrecker" Thorp tear a stack of road atlases in half with his bare hands! Or better yet, discuss rich internet mapping applications with him.

Bait and Switch

This isn't about Python after all.

Comments

Re: Bait and Switch

Author: Aaron Racicot

Since when is using PyQT and the Python bindings to QGis not considered using Python ?!?!? This is actually pretty cool stuff if you ask me...

Re: Bait and Switch

Author: Sean

The post was entirely about SIP bindings for C++ libs. Not a Python issue in sight. Cool, sure. Python, not really.

Re: Bait and Switch

Author: Gary Sherman

The renderer is written in Python. Using Python bindings. No SIP C++ bindings were created, changed, or harmed in making the renderer. I don't understand how you can write something in Python and it not be Python. Perhaps if your post was more than one sentence it would have been more revealing...

Re: Bait and Switch

Author: Sean

The comments in that thread, all about Qt details, make my point.

Koombaya

One of the fun side-effects of digging into RESTful GIS architecture is finding common ground with people like Keyur Shah. A hardcore Java programmer employed at ESRI and a open source Python hack should be diametrically opposed. Maybe we still are, just converging on some of the same design principles from different directions.

Comments

Re: Koombaya

Author: Keyur

I guess http connects more than just machines...