Stop Using Mapscript: Almost There

MapServer revision 6064 (my first contribution in quite a while) has an example of loading a mapfile from a string: fragments.txt. We're getting very close to the point where we can practically stop using mapscript. Users, feel free to add comments to this feature's story.

Comments

Re: Stop Using Mapscript: Almost There

Author: Al

I am just getting into MapServer and have found your posts to be very enlightening. I have only gotten to the point that I can see how I would use MapScript to overlay a map with icons positioned via data in a MySQL DB. Is it possible to duplicate that sort of functionality with map files? Any pointers on where I could see examples of that? Thanks, Al

Re: Stop Using Mapscript: Almost There

Author: Sean

Al, you can use the mapfile language to define an OGR wrapper for your MySQL table. Google for "mapserver ogr virtual mysql" and you'll find examples.

Made it

I just finished one the most challenging and rewarding 8 days of my life as the single parent of an 18 month-old. Whew. Single moms and dads of the world, I salute you!

Comments

Re: Made it

Author: Yves Moisan

Indeed. Investing into 1) oneself (keep runnin' and climbin' pal) and 2) one's family/couple [investment mode TBD by yourself :-)] pays off in ensuring you'll never become a single parent ;-)

Only one?

Author: Gari

Well, we recently discovered that two teams one kid-one parent is much more performing than two parents-two kids. But congratulations, anyway! :-)

Our Friend, the Atom

I too think so. Dear geospatial community, please do not propose yet another special protocol until you can demonstrate that Atom won't work.

Comments

Re: Our Friend, the Atom

Author: Allan

OK. I'm excited. But I can't shake the feeling of square peg and round hole. APP is brilliant at what it does, but like any decent 21st century spec, it only does a very little bit. APP is a great pattern for dealing with feed-like data. I.e. "here's a feed of the ancient coin discoveries" or "here's a feed of real-time earthquakes". But it's not a great pattern for dealing with "get me the paved roads in california." For that we're going to need another pattern.

Re: Our Friend, the Atom

Author: Allan

One quirk baked into APP is that you MUST return things ordered by time (APP 10.1) if you're returning partial collection lists. Another quirk is the notion of categories. These are the *only* metadata elements treated specially in APP. Again, I think APP is good for what it is. Maybe the best thing for the GIS community is to take a long, hard look at Section 5 of the APP draft and come to grips with what REST is. And, to be slightly pedantic - Atom is a format. Atom Publishing Protocol is a protocol.

Re: Our Friend, the Atom

Author: Sean

Allan, why isn't APP -- or something from the same abstract super group of protocols -- a good pattern for getting representations of entities in a spatial context? I don't accept "spatial is different because it is" anymore.

Re: Our Friend, the Atom

Author: Allan

Note that I didn't say APP is not "a good pattern for getting representations of entities in a spatial context". I said it was not a great pattern for a certain class of queries. Mostly what I'm trying to say is that as a pattern, it might have its limits. I'm not against trying to bump into the limits. It's a gut feel. I'm also not saying that spatial is different. I would have the same reservations about using APP to find all the sentences in all the books at Amazon that have the words "if" in them where the preceding sentence had the word "the" in it. To do that you'd (a) have to define a query protocol that APP does not give you, and you can imagine that the result set could be quite huge. Most importantly, the things that APP makes "first class" - time and categories, are irrelevant to the problem of searching a text corpus. Again, I'm not saying APP is not a good protocol. I'm saying I get the sense that it should properly be viewed as a component, not as the salvific balm to all of geospatial's prior sins.

Re: Our Friend, the Atom

Author: Allan

I'm actually quite enthusiastic about the winds of change that are blowing through the geo hacker community. The current debate/investigation of REST, things like tilecache, featureserver, geojson, rtree, etc. will, in combination, blow away layers of crud.

Re: Our Friend, the Atom

Author: Sean

Well, there's never a silver bullet, but switching to protocols that are of the web is a big step in the right direction.

Restful Versioning

In a discussion of restful features the other day, a good question came up: where's the back button? POST and PUT are easy to understand, but how about rolling back or undoing changes? I have a simple solution which is going to look pretty familiar to Subversion users.

Let's beginning by modifying a feature:

PUT /features/1
{ ... }

The curly braces and ellipsis stand in for a JSON object, the details of which aren't important now. From a versioning feature resource, I'd want to get a response like:

200 OK
feature: http://example.org/features/1
revision: http://example.org/features/1/revisions/1

Representations of the feature and its most recent revision are identical. Want to rollback this change? First, let's get the previous revision:

GET /features/1/revisions/0
{ ... // revision 0 }

and then put it back:

PUT /features/1
{ ... // revision 0 }

With the response:

200 OK
feature: http://example.org/features/1
revision: http://example.org/features/1/revisions/2

That's the restful equivalent of:

$ svn merge -r 1:0 http://example.org/features
$ svn commit

OSM, by the way, has node history, but no URIs for node revisions.

Comments

Re: Restful Versioning

Author: Christopher Schmidt

Actually, there's a strong reason that I don't like this: this is less like: svn merge -r 1:0 http://example.org/features and more like: svn merge -r 1:0 http://example.org/features/1 How do I roll back an entire feature storage by a single revision? Is the version for the feature per item, or for the whole repository of features? I think OSM's model here is lacking: what they really want is the ability to do multiple edits in a single transaction, and to roll them back just as easily -- but maybe this doesn't apply in other arenas.

Re: Restful Versioning

Author: Bill Thorp

"I have a simple solution which is going to look pretty familiar to Subversion users" Seeing that WebDav is shall-we-say "RESTful", and Subversion relies on the Delta-V extension to WebDav, perhaps... oh forget it.

Re: Restful Versioning

Author: Sean

I'm a believer in repository-wide revision numbering. Maybe /features/tags/foo/1 is a better URL than /features/1/revisions/42. But you can't roll back changes to many features at once in a single go without using yet another protocol to bundle the changes. Personally, I'm sick and tired of new procotols. What was that, Bill? Put all our features in Subversion (as JSON or GML) with auxiliary spatial and text indexes? Maybe we will :)

Re: Restful Versioning

Author: Bill Thorp

Proxy Subversion with a spatial transformation engine and I'm sold. "layer/1/feature/1/asGML" or "layer/1/features/1/asWKT" Heck, you write the transformation engine and I'll write the proxy for you!

Feature Paging

I've just been hand-waving, but Chris Holmes is getting ready to blaze a trail for GeoServer from WFS to restful features. He, more than anyone, has clued me into the significance of paging links for GIS applications, and his post has a good introduction to the concept.

Feature paging should let us reduce the latency in some web GIS applications. Break a huge query response -- and I've seen the GeoServer bloggers mention gigabytes of GML -- into chunks of N (hundreds? thousands?) features, and you can render or analyze chunk i while chunk i+1 is coming through the intertubes.

Paging helps on the server end as well. An intriguing MapServer development proposal to allow XSL transformation of outgoing features was just ditched because WFS doesn't accomodate chunked responses, and it seemed too expensive and slow to build and transform an entire, potentially huge XML document before even beginning to send it. XSLT of reasonably-sized chunks, each with a link to the next, is rather more feasible.

The only thing in Chris's post that I'll dispute is his exaggeration of my credentials. I'm just an HTTP enthusiast, but I do see a huge potential for REST in the geospatial community and I'd like to help realize it.

Novelty of REST and GIS

Christopher Schmidt is exactly right:

(Note that I did this before I even saw posts about it -- I think this is just more evidence that all the things we're talking about here are well understood and not novel, though it is interesting that we're all implementing them at the same time.)

Being the first geospatial project to jump on an already filling bandwagon, 6-7 years after the publication of RFC 2616, is really no big deal. The interesting question is why it took us (the industry and community) so long. Personally, I didn't get what REST was about until I started reading about atompub and Rails.

WBW 33: Languedoc-Roussillon Values

body_html_template

Comments

Re: WBW 33: Languedoc-Roussillon Values

Author: Guillaume

Pic Saint-Loup is great. My favorite is Chateau de Lancyre : http://www.chateaudelancyre.com/vins/gdecuveerouge.htm Enjoy and feel Restful !

Re: WBW 33: Languedoc-Roussillon Values

Author: Marcus

Hey glad to hear it! (Ch de Lancyre was one of my more recent Languedoc tastings I uncorked from the region's awesome 2001 vintage.) Hope you all find a good bottle and contribute it.

Re: WBW 33: Languedoc-Roussillon Values

Author: Sean

Thanks for the recommendations. I'm also going to ask my wife to find something unique that we can't get here in Colorado, like a Mourvèdre varietal.

Re: WBW 33: Languedoc-Roussillon Values

Author: Sean

Well, no pure Mourvèdre came home with my wife, but she did bring back a couple bottles of good blog fodder. Also a Hortus Grand Cuvée Pic Saint-Loup and a Château Puech-Haut Tête de Bélier Rouge that are a bit outside the bargain price range.

WFS Simple

Raj Singh is working hard on WFS Simple, but I think it is still going to miss the "mass market" boat by a few steps.

Goodwill towards XSD is almost gone, for good reasons, and probably won't be coming back. XML Schemas will hinder adoption of WFS Simple.

We're only just beginning to see RPC-style services fall out of favor. Web architects and developers are more and more interested in RESTful APIs like the Atom Publishing Protocol than they are in SOAP lite. The OSM API, the OSGeo Tile Map Service, and MetaCarta's FeatureServer are only some of the first functional examples of the RESTful, web-friendly, geo services of the future. This is where we're headed. Eventually, WxS will be used almost solely for interoperation with legacy GIS applications.

By the way, I also still think the "mass market" term smacks too much of GIS elitism and exceptionalism. The geospatial industry and communities have a lot to learn from the Web and IT.

Comments

Re: WFS Simple

Author: Stefan

I agree with your thoughts about GIS elitism (or ignorance to mainstream IT?). But I don't see why WMS and WFS (simple) should be RPC-style? They are quite as RESTful as many examples you mention, aren't they? Regarding XML Schema: I've never been in favor of XML Schema but I don't think that it will go soon in face of so many existing tools and scholars. And if yes: What - better, non-XML(?) - alternative to take?

Re: WFS Simple

Author: Sean

No, Stefan, WMS and WFS Simple are not restful. There's more to it than just returning imagery or plain ole XML. From Fielding (6.5.2):
What makes HTTP significantly different from RPC is that the requests are directed to resources using a generic interface with standard semantics that can be interpreted by intermediaries almost as well as by the machines that originate services.
Only very specialized clients and servers know what to make of WxS semantics, and this makes it much more challenging (for example) to use caching or proxying layers.