Geospatial Jython

I've fooled around with Jython, but this, via @erilem, is the first I've seen of it in real live GIS software:

>>> from geoserver import Catalog
>>> cat = Catalog('topp')
>>> print cat.stores()
[]
>>> st = cat['states_shapefile']
>>> print st.layers()
[]
>>> l = st['states']
>>> print l.count()
49
print l.bounds()
...

A little bit of its Java-ness leaks through, but at least one is spared the getters and setters. Cool, but then what's this smell at the end?

The following is the wish list based on feedback from teh community:

  • add a new output format
  • add a transaction listener
  • add a dispatcher callback
  • add a WPS process
  • add a datastore
  • a restful endpoint

Restful endpoint? Oh, for crying out loud. Head. Desk.

Comments

Re: Geospatial Jython

Author: Silas Toms

Congrats on your 1000th post. Here's to many more in the future.

Re: Geospatial Jython

Author: Sean

It'll take me a while yet to get to 2**10, but thank you :)

Re: Geospatial Jython

Author: Steven Citron-Pousty

So maybe my suggestion on stack overflow wasn't

totally

off base

Re: Geospatial Jython

Author: Justin Deoliveira

I am interested to hear thoughts on how to make the api less java like and more pythonic... but being a java hack old habits die hard. I guess I could start by reading over some of your older posts. I am not sure if http://geoscript.org/py has come across your radar but it is an attempt to wrap up geotools in python.

Re: Geospatial Jython

Author: Sean

Geoscript looks like it has a lot in common with Shapely and Geojson, which is good :)

But this "rest endpoint" thinking: what is up with that?

Re: Geospatial Jython

Author: Jachym

PyWPS works in Jython as well. We are running it as java-servlet.

Re: Geospatial Jython

Author: Sean

Steve0: Something like ogr2ogr could be a nice example app for geoscript.

Justin: read-only properties instead of methods would be nice, but maybe that's just me. The geoscript geometry constructors all looked just right.

Author: Justin Deoliveira

Sean: Thanks for the feedback. And yes much design inspiration was driven from Shapely so thanks for that. About the "rest endpoint" thing I would not read much into it. It was something mentioned in email and blindly copied into that wiki page. I fully agree the statement is meaningless in the context of that page. Python bindings for GeoServer/GeoTools are completely orthogonal to anything "REST" imo. But a blatant misuse of terminology on our part nonetheless. Thanks for the call out :)

Re: Geospatial Jython

Author: Sean

Orthogonal is right. Knee-jerk reaction on my part, which just distracts from how cool it is to see some geo-Jython action.

Re: Geospatial Jython

Author: Tim Schaub

And keep an eye out for GeoScript JS (http://geoscript.org/js/). End-to-end JavaScript mapping apps with GeoJSON as transport, that's my idea of slick :).