FDO and Python

Jason and Mateusz have each posted about Python bindings for FDO this morning, and so I took a look into it. I've been intrigued by FDO ever since I heard of it in October of 2005. Python is my bread and butter, and I'm sad to say that the FDO Python bindings are disappointing.

This, in particular:

oProperties.Release()

almost made me cry like the man in the classic anti-littering PSA. Python has garbage collection. Don't abuse your users. They shouldn't have to explicitly free memory allocated for objects.

Thanks to SWIG, the Python bindings are a literal translation of the C++ API, excruciatingly verbose and explicit, and annoyingly un-Pythonic. The developers need to learn about Python patterns and protocols, and implement them. As I mentioned in Jason's blog, factory methods like:

>>> schema = FdoFeatureSchema.Create(sSchemaName, sSchemaName)

need to be changed to the familiar form:

>>> schema = FdoFeatureSchema(sSchemaName, sSchemaName)

That's how it's done in Python. Any other way is needlessly confusing. Implementing Python's mapping protocol would let users write:

>>> sewer_pipe = classes["SewerPipe"]

in the natural Python way instead of:

>>> oClass = oClasses.FindItem("SewerPipe")

Comments

Re: FDO and Python

Author: Matthew Giger

I took a quick look at this as well and am not overly impressed. Any project that still uses SWIG for a C++/Python binding has either never heard of boost::python or is in need of revision. I've looked quickly in the core C++ and they even make their own shared pointer class instead of using boost::shared_ptr. To add insult to injury, apparently the FDO SWIG bindings are not cross platform compatible either. Oh well.

Re: FDO and Python

Author: Jason Birch

I think that adding FDO support to PCL would be awesome Sean. However, I also think that it would be useful if your (both of your) expertise could be used to inform the FDO project. Any chance that you would consider interacting on the -internals mailing list? This feature addition was a bit of a black box (I was shocked by its annoucement) and I'm sorry that it was done fait-accomplis rather than through community consultation. If a poor choice has been made in the way that Python support is implemented, then the project really should be open enough to engage in discussion around it and work to resolve the issues. And if you have spare time on your hands, the project really needs more external involvement :) Jason

Re: FDO and Python

Author: Mateusz Loskot

Matthew, Yes, you are right I think. FDO uses its own set of types, and the whole concept of an object in FDO is directly based on COM object. That's how I understand it after a few months of learning FDO. However, FDO is not affraid of Boost and it uses it, mainly Boost.Threads. Generally, we have the whole tree of Boost in the FDO repo, so anyone is free to use it. For example, in the provider I work on - PostGIS provider for FDO - I use Boost features quite intensively, but this is my choice as I like Boost very much. Here is my pre-release repository, I use privately, not yet merged with the official FDO tree: http://svn.refractions.net/fdopostgis/ The decision about choosing SWIG over Boost.Python was made by the core FDO team and if you are interested why SWIG has been choosen, please visit the fdo-users or fdo-internals list. Anyway, that could be an interesting discussion :-)

Re: FDO and Python

Author: Mateusz Loskot

Sean, Thanks for this very helpful and informative analysis. I can only confirm the API and style of Python scripting for FDO is a direct port of what FDO offers for C++ programmers. I agree, that for Python, a scripting language, users demand for simpler solution than already available for C++ coders, but I'd like to point that it's a very early version of the wrapper. I *believe* (as I don't know it) if the FDO team get some feedback, they will make a use of it and improve the wrapper.

Re: FDO and Python

Author: Sean

Thanks for the comments. Its cumbersomeness aside, I'm finding the Python bindings (specifically the unit tests) useful for learning the capabilities of FDO. It's confirming some of the design decisions of PCL (which has something more like the ISO/GeoTools feature model), but also showing me a different, complete model.

Re: FDO and Python

Author: Jason Birch

Greg just posted something on the fdo-internal list that confirms Mat's beliefs. http://lists.osgeo.org/pipermail/fdo-internals/2007-March/000928.html Or (because the MailMan archive doesn't wrap the lines) http://www.nabble.com/RE%3A-FDO-Incubation-Progress-Reports-p9488349s18162.html As I've said at least once before, it would be cool to have someone active in our community who understands how to appropriately set up Python bindings for FDO.

Gort Owns Us

Seriously, The Day the Earth Stood Still is one of my favorite films. Let there similarly be peace between proprietary and open source GIS software, a peace maintained eternally by shiny, indestructible, planet-busting robots.

Comments

Re: Gort Owns Us

Author: Matthew Giger

I for one welcome our new clunky overlords.

Re: Gort Owns Us

Author: Andy

OH look our new overlords appear to be wearing AutoDesk logos.

Taking GeoRSS Too Far

What is an RSS feed? It's a web resource that summarizes, in a document, changes to other web resources. What is GeoRSS? It's a specification of how to add simple geographic metadata to RSS feeds to complement standard metadata such as titles, descriptions, publication dates, and modification dates. The geographic metadata is there so that we can filter feeds on spatial, as well as textual or temporal, criteria.

GeoRSS metadata also paves the way for a new class of feed aggregator. Instead of displaying feed items as a list ordered by date we can display feed items on a map -- and this is where people begin to take GeoRSS too far. GeoRSS is being confused with a GIS data format, and people are coming to it as a serialization for shapefile-y (meaning no associated web resources) data like GPS tracks and airplane flight paths, with little if any, consideration of what RSS is about.

The GeoRSS community needs to hold the line on simplicity, continue to hew to the Web, and show people who are looking for an XML serialization of GIS data the way to GML.

Comments

Re: Taking GeoRSS Too Far

Author: Tom Kralidis

I think GeoRSS is so easy to use (for the layperson), that it's easier to go this way as opposed to a full on exercise in encoding a GIS format. GML has been around way longer than GeoRSS, yet GeoRSS has such popularity. I think GML would benefit from any effort to make it easier to use (i.e. the simple features profile, tutorials, whatever). At any rate, another example of mainstream IM/IT and "geo" convergences.

My FOSS4G 2007 Abstract is in the Intertubes

Cool! I have submission number 007:

Thank you for submitting a presentation abstract for FOSS4G.
You will be notified after the submission closing date regarding
the status of your presentation.  Please direct any correspondence
regarding your submission to xxxxxxxxxxxxx@xxxxxxxxxx.xxx and quote
your submission number in the subject line of your email.

Submission #: 7

Presenter: Sean Gillies
           xxxxxxxx@xxxxx.xxx.xxx
           Ancient World Mapping Center,
           University of North Carolina at Chapel Hill

-- Title --

Pleiades: Building a RESTful, Open Source GIS for the Humanities

You may know me as a gadfly in the blogosphere, but I have a history of delivering serious, sober, nuts-and-bolts presentations and workshops at the predecessors to FOSS4G 2007 -- all the way back to the first in 2003. Should the powers that be accept submission 007, attendees will learn about data modeling (with open source software), development infrastructure (with open source software), and RESTful Web GIS development (with open source software). I'll explain why you should have URLs for everything, how to leverage HTTP caching, and demonstrate Pleiades's open source tools for working with GeoRSS, GML, and KML. And all without whining or rolling my eyes about W*S or OSGeo.

The full abstract is in the Pleiades wiki, here.

Comments

Re: My FOSS4G 2007 Abstract is in the Intertubes

Author: Jason Birch

Gadfly, Horsefly, same difference ;) http://en.wikipedia.org/wiki/Horse-fly (apparently an important pollinator) I'll be coming to your session if I can. I think that REST is an incredibly important concept, and hope that that starts to trickle down. You sure you want your email posted in cleartext?

Re: My FOSS4G 2007 Abstract is in the Intertubes

Author: Sean

I'm not sure I could possibly get more spam at that address, but better to be prudent. Thanks for the catch! Is it possible you can score me a slot opposite GeoDRM?

Re: My FOSS4G 2007 Abstract is in the Intertubes

Author: Jason Birch

Not to worry, every second presentation will be about GeoDRM, so your chances are high. The other slots will be filled with proprietary software presentations. I'm surprised though. I would have thought that you'd prefer to be available to attend the GeoDRM session...

Re: My FOSS4G 2007 Abstract is in the Intertubes

Author: Jason Birch

Uh. Rereading that comment... maybe it sounded nasty. I meant it to sound teasing.

Re: My FOSS4G 2007 Abstract is in the Intertubes

Author: Sean

You don't have to apologize for heckling in here :)

Ancient Wonders Keep on Going

While reviewing Pleiades placemarks, I stumbled onto some interesting Panoramio content in the neighborhood of Hephaistion [KML]. The Barrington Atlas indicates a feature named CHIMAERA M. at the site of Hephaistion, a hill about one mile east of the Lycian coastal road.

http://sgillies.net/images/hephaistion-neighborhood.jpg

Unless these photos are a hoax, the ancient, natural vents are still leaking methane, and can be lit by tourists. A ruin, presumably the Hephaistion temple itself, is at the lower right of the second image, not far from the leaking rock outcrop.

http://sgillies.net/images/hephaistion-fire.jpg

The geography of southwestern Turkey is blowing my mind. While you've got Google Earth open, check out Hierapolis, Turkey's Yellowstone.

Yet Another Compass Rose

Just so you know: the AWMC logo, which you'll be seeing in our Google Earth bubbles, goes back to 2000, well before Panoramio or OSGeo.

http://sgillies.net/images/awmc-thong.jpg

(The image, of course, refers to this.)

Comments

Re: Yet Another Compass Rose

Author: Matthew Giger

What is that? Is that for sumo wrestlers?

Re: Yet Another Compass Rose

Author: Andy

I thought you were serious. I actually went to the OSGEO store looking for it. In addition to her regular job my GF does modeling and I was going to get a pair and take some pics of her in them and put them up on my blog. D@mn! I so thought that was a real item.

Backronyms for KML

I'm one of those who feels that KML needs an update if it's going to become a standard. Keyhole Markup Language has a legacy sound to it. Here are a few possibilities:

Kartography Markup Language. Think Krab. A nod to the old-timers who bemoan what passes for cartography these days, dagnabbit.

Kang and Kodos's Markup Language. I bet I'm not the only one who sometimes feels like an alien presence monitoring an oblivious Earth, ripe for the plucking.

A quick pass through my OED didn't turn up any real winners. Let me know if you have any ideas. Best one wins a free copy of OWSLib.

Update: the winner, from the GeoRSS list, is KML Markup Language.

Comments

Re: Backronyms for KML

Author: James Fee

I'd go with Krusty Markup Language The clown would be happy to lend his name.....

Re: Backronyms for KML

Author: Matthew Giger

KML does not have much to do with Cartography. How about: Krufty Markup Language Kool kidz Markup Language Killer Markup Language man... Kornhole Markup Language Since Google is just so darn important, why don't they just appropriate an existing acronym: Google Markup Language (.gml) or better yet: Universal Markup Language (.uml) Or just: Markup Language (.ml) Markup (.m) How about just .

Re: Backronyms for KML

Author: Sean

I'll buy anything with the Krusty seal of approval.

Deliberately Obtuse

I'm sorry, but this post is nonsense. There's almost nothing more annoying than deliberate obtuseness about open source and free software.

Comments

Re: Deliberately Obtuse

Author: Paul Ramsey

Deliberately obtuse, or just another clear demonstration that using the word "free" causes most people to draw the wrong conclusions about the most important aspect of the software. If the meaning is only clear to a small in-group, then it is not a useful word for wide communication, it's jargon, and we should stick to arguing the finer points over beers, and use some other word for general communication.

Re: Deliberately Obtuse

Author: Allan

I dare say that Jeff knows enough about the software industry to understand what is meant by "Free" when it's part of the "FOSS" acronym. And, no, there's nothing more or less pure about "freeness". It's pretty nearly binary. It's either Free or it's not. The free-o-meter is here.

Re: Deliberately Obtuse

Author: Sean

Indeed, Allan. Paul, I think Oracle (at the root of the discussion linked by Jeff Thurston) is also fully aware of the meaning of free in this context.

Re: Deliberately Obtuse

Author: Paul Ramsey

Some software that is free is not actually Free. And some software that is Free is not free. And some software is both free and Free at the same time. And finally lots of software is neither free nor Free. Yeah, that's crystal clear, there's no way the Oracle submitters made an honest mistake... *cough*

Re: Deliberately Obtuse

Author: Allan

If the Oracle submitters made a mistake, then is the best way to teach them to (a) let them in but don't say anything or (b) respond to them that they may have misunderstood and perhaps after doing some additional reading they may want to show how their workshop addresses the issue? Perhaps the FOSS4G2007 web site could include a bit more guidance on this... *cough*

Re: Deliberately Obtuse

Author: Paul Ramsey

I see, the problem is not that we are using obscure language, it is that we are not *explaining* our obscure language well enough. Anyways, obviously we will be explaining the issue to the Oracle submitters, but I feel bad about having baited them into the mistake in the first place with misleading language.