Discussion:
[Community] ANN pygeoif (was ANN fastkml)
Christian Ledermann
2012-07-25 10:41:24 UTC
Permalink
Have you looked at my Python geospatial data protocol doc?
https://gist.github.com/2217756
This would be a more general and less Shapely-dependent way to
represent geometries, if you like.
Especially considered that the library is otherwise pure Python, I
would second Sean's suggestion.
or it's rather better to implement to protocol from scratch.
I have nothing against Shapely of course, but its dependency on GEOS
makes it more complicated to install with modern Python packaging
tools like pip.
It turned out that I was using more of shapelys functionality than geojson
could provide so I had to implement the protocol from scratch

For your convenience i factored it out into a package of its own so
if you have to scratch a similar itch you do not have to start all
over again: https://github.com/cleder/pygeoif

(pygeoif for a want of a better name)

You may think of pygeoif as a 'shapely ultralight' which lets you
construct geometries and perform _very_ basic operations like
reading and writing geometries to WKT, constructing line strings
out of points, polygons from linear rings, multi polygons from
polygons, etc. It was inspired by shapely and implements the
geometries in a way that when you are familiar with shapely
you feel right at home with pygeoif (actually most of the
docstrings were copied from shapely and just adjusted to
reflect the differences, also the __geo_interface__ is basically
a verbatim copy of shapelys implementation)



The tests https://github.com/cleder/pygeoif/blob/master/pygeoif/tests.py
give you an overview what can be done with this package.

It is unfinished and early alpha but already usable (fastkml works
fine with it), release often, release early ;)

It is GPL licensed but i am open for suggestions, so if you need another
license (or think this infringes with code i copied from shapely) drop me a line

So far I only tested with python 2 but it _should_ work with python 3, the code
is pretty straight forward and written with simplicity and readability in mind
(so no magic adapters or version specific stuff, wysiwyg)
--
Best Regards,

Christian Ledermann

Nairobi - Kenya
Mobile : +254 702978914

<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don?t drive species to extinction

2) Don?t destroy a habitat that species rely on.

3) Don?t change the climate in ways that will result in the above.

}<(((*>
Oliver Tonnhofer
2012-07-25 11:11:56 UTC
Permalink
Post by Christian Ledermann
It is GPL licensed but i am open for suggestions, so if you need another
license (or think this infringes with code i copied from shapely) drop me a line
Why don't you just use the license of Shapely if your code is based on it?

Personally, I try to avoid using any software components that uses the GPL, because it restricts me how I can use my software. That might be your goal: you may not want me to use your piece of software in a closed software project, like a project build for a customer. That's totally fine, but that also means that you won't get any patches or contributions from me, or from people that share my opinion. And that is especially true for libraries.

Regardless whether you want to change the license or not, you need to add the proper copyright/license notice of the original code if you use substantial code from another project.

Regards,
Oliver

Loading...