Closed manelclos closed 5 years ago
@manelclos thanks for this idea. It would be ideal to package geo formats as separate app, I would be glad to link to it from the documentation.
Hi @manelclos I have been doing exactly this but not that happy with my current implementation:
https://gist.github.com/1a15baf57528c8ab4ef9
If you have an alternative method, i would find it very useful!
James
Hi @jamescw
What are the problems with your current implementation?
In the meantime I tried importing geometries in WKT from an excel file and it works perfectly!
hey @manelclos
I'm trying to import geometries in WKT from a csv file but I get an 'InvalidDimensions error' since WKT contains commas and tablib takes comma as column separator. How did you perform your import? Thanks
Hi @jcsimonin!
I did the import from a xls file, with a custom Format. I think you'll be good if you quote your field content, as in:
1,foo,"POINT(1 0)"
Would be nice to know if it works for you.
hi @manelclos Thanks for your quick answer but i tried it already and tablib.Dataset() doesn't seem to care..
For now, I changed the tablib/format/csv.py and add the parameter delimiter
_csv = csv.writer(stream, delimiter=';')
It works find but i am not quite satisfied with it.
Hi @jcsimonin,
I think my example should work in tablib, will check. About the semicolon issue, I'm also affected. I subclassed Format and used Python's csv module. It would be good to have this in import-export, either as configuration or as a "CustomCSV" format. But that should be discussed in it own issue. CC me if you open or find a one related to the problem ;)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi,
would you like to see geo formats in django-import-export? I'll code some of these as I need to export geodjango datasets.
GeoJSON: easy, some support in Django itself and more coming in Django 1.8 Shape: generate the shape files, zip them, return the file contents
As there is no support in tablib for these formats, and I will probably use django to implement them, I understand I only need to subclass Format and implement the export_data method, right?