import fionac = fiona.open('strati.shp')c.schema{'geometry': 'Point', 'properties': {u'DIRECTION': 'int', u'PENDAGE': 'int', u'TYPE': 'str:10'}}
With Pyshp
import shapefiledef schema(reader):properties = dict((d[0],d[1:]) for d in reader.fields[1:])return {'properties' : properties,'geometry' : reader.shapes()[1].__geo_interface__['type']}
shapefile.Reader.schema = property(lambda self: schema(self))
c.schemac = shapefile.Reader('strati.shp')
{'geometry': 'Point', 'properties': {'DIRECTION': ['N', 3, 0], 'PENDAGE': ['N', 2, 0], 'TYPE': ['C', 10, 0]}}
https://github.com/karimbahgat/pyshp-fork-speedup-and-geojson-write
What's the possibility to try to merge all these features into one extra feature full shapefile fork instead of many different ones?
I would be up for trying to collaborate over at github if you guys are interested. Ideal would would be to merge it into the main pyshp repo but can't find a way to contact Lawhead and maybe he just wants to keep the main version a bit more stable.
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Karin,I love all the work you're doing.
I'd like to migrate the main repository to Github from Google Code's subversion setup.
I have a Github account as user GeospatialPython. I don't see any reason why we can't incorporate your fork once that migration is done.Some other todo items I have are:- Make tests (in README.txt) self-contained so they are not dependent on external shapefiles. This request was made by some Linux distros and other package distributors.- incorporate the public domain dbfpy code base for much better Dbf support.
- Joel
On Monday, January 20, 2014, Karim Bahgat <karim.bah...@gmail.com> wrote:
Laloux, you mentioned you were working on adding support for writing to shapefiles. Not sure if it is what you meant but I wrote a fork for myself as well that allows to write individual geojson dict shapes with the shapefile writer so it can be saved. Thus it is possible to easily save the results from say a Shapely union. This might be interesting for you too Ledermann. You can find the fork at:
https://github.com/karimbahgat/pyshp-fork-speedup-and-geojson-write
What's the possibility to try to merge all these features into one extra feature full shapefile fork instead of many different ones?
I would be up for trying to collaborate over at github if you guys are interested. Ideal would would be to merge it into the main pyshp repo but can't find a way to contact Lawhead and maybe he just wants to keep the main version a bit more stable.
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Joel Lawhead, PMP
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
This is the Dbf library I mentioned:It could be backwards compatible with the current API but I think it handles the header information much better. And the license is compatible.
- Joel
- Joel
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpython+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Joel Lawhead, PMP
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpython+unsubscribe@googlegroups.com.
--
Best Regards,
Christian Ledermann
Nairobi -
--
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.
}<(((*>
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpython+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Great, and glad you like it! I'll just wait untill you (Joel) have migrated PyShp to GitHub, then fork your most recent version properly, redo my changes, and then try to send you my changes as "pushes" (if that's what they're called). Then we can possibly all talk about what to keep/change/rename.
About the dbf plans, what specifically did (Joel) you have in mind in regards to the benefits of switching to a different dbf basecode? Is it to get fewer bugs? I've personally never had any problems with PyShp's dbf reader.
And a curiosity question for Ledermann: Ever since your __geo_interface__ code was incorporated into the main PyShp, are there any remaining differences between the main code and your GitHub fork that you wish to merge later on, or is it currently just a copy?
Personally I think it's a shame that everyone's sort of "forced" to go with the flow and move to GitHub, Google Code is just so much more neater and aesthetically pleasing to the eye (I would have used it instead if they hadn't discontinued the code hosting/download section).
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
Joel, I forget where, but I think you mentioned somewhere that you wanted to create a pure Python geographic vector analysis library (sort of like a pure Python Shapely). I recently found a pure Python library called PyClipper and thought it might be an interesting place for you to start. It has many geometric methods like point in poly, intersect, union, etc. Only backdraw is it's a bit difficult to understand the documentation, and very few examples.
Here is the link: https://github.com/clothbot/clipper
As you can see there are many hooks for different languages, but in the "Python" folder you will find the "clipper.py" file which is pure Python and works on its own. I've also attached a basic example script that you can run to see some of the operations and code for how to do them (run the script, push Enter/Return to perform an intersect, and left-click your mouse to do a point in poly test).
Not sure about the licensing, but hopefully you can simply reuse some of the more advanced parts of the code while making the front-end functions more shapefile and user-friendly. Oh and btw, if and when you put up the geographic clipping project on GitHub as open to contributors I'll probably hop on that train because I love geographic algorithm stuff (doesnt mean I'm good at it, but I do love it :P ).
Karim
---------
- Joel
- Joel
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Joel Lawhead, PMP
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- Joel
- Joel
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpython+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpython+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Joel Lawhead, PMP
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
For more options, visit https://groups.google.com/d/optout.--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Joel Lawhead, PMP
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpython+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.