Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KML -> Records (GeoJSON) #5

Open
rufuspollock opened this issue Aug 7, 2012 · 7 comments
Open

KML -> Records (GeoJSON) #5

rufuspollock opened this issue Aug 7, 2012 · 7 comments
Assignees
Milestone

Comments

@rufuspollock
Copy link
Contributor

Suggest we just have a kml_parse method that yields iterator over geojson style python dicts.

Implementation

Various options here.

Note this is not supported by Fiona bindings for gdal (atm)

Other libraries:

@gka
Copy link

gka commented Aug 7, 2012

QGIS can do that.

@napo
Copy link

napo commented Aug 7, 2012

QGIS uses GDAL/OGR for this reason is very easy use the python interfaces to OGR/GDAL
This is the command line

ogr2ogr -f "GeoJSON" file.geojson file.kml

@nigelbabu
Copy link
Contributor

I've written some code for the KML bits in a branch. Can someone give me a reality check on whether I'm headed in the right direction? I intend to add a Python Geo Interface if this is indeed the right direction.

@rufuspollock
Copy link
Contributor Author

Not sure why you need the Python Geo Interface - could you not just return geojson style python record objects (doing the python geo interface will require you creating proper "Record" objects which then implement that interface).

Regarding the code, as I'm not a KML expert, it is hard to tell whether this is right - could you add an example test (even a failing one) - that would at least tell me which kml file to look at it and an idea of what you expect output to be.

@nigelbabu
Copy link
Contributor

Implementing the Python Geo Interface has the advantage that if I do geojson.dumps(), it will convert the object to geojson.

Well, I think the problem is, I'm not sure what the output should be. I already do have a test with prints out the current output. You can see if you run nosetests -d

@rufuspollock
Copy link
Contributor Author

@nigelbabu have you pushed all the code you have here or do you still have stuff on disk?

@nigelbabu
Copy link
Contributor

@rgrp I have nothing on-disk. I'm hoping to talk to Adria and get some help to kick this code off my plate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants