-
Notifications
You must be signed in to change notification settings - Fork 46
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
propagate translator exceptions (see for_pnorman branch) #21
Conversation
$ ogrinfo --version This is what ships in Ubuntu 12.04. BTW, I guessed that you were using a newer version of libgdal. I also get a slight difference in the srs output for the utf8 test:
There seems to be some activity in gdal post-1.7 that may account for this difference: Perhaps it also accounts for the utf8 failure. Ciao, |
While there is only one example of replacejwithi being called, it is clear that the arguments are meant to be type Geometry, not (Geometry, role) tuple. So when replacing j with i, preserve the existing role.
Hey Paul, I see that you merged my patch. I added another fix to this for_pnorman branch for replacing children of relations. I also eliminated the utf8 failure patch. Can you pull this new patch? Sorry if I'm veering from github protocol here. Ciao, |
|
Understood. Do you know of any translators or other code that are currently using the Relation object's replaceiwithj? I don't see one in the existing code. I figured the common case might be that two multipolygon relations have the same (untagged) Way. And this is the case that I was fixing when I discovered this issue. |
Thinking about it, I'm not sure if the relation A translation shouldn't be calling these, they're used deep in the OCG -> OSM data model conversion Do you have a testcase for where the relation The current version of that line came about in a086c32 but it was simply a mirror of the changes to the way |
Hey Paul, This Relation.replacejwithi issue came up while I was working to eliminate multiple multipolygons from a parcel shapefile. The code I'm using is in preOutputTransform function in https://github.com/ual/parceltools/blob/master/translations/sf.py. It is inspired from the code in ogr2osm that replaces duplicate points. The test file I was using is: https://github.com/ual/parceltools/blob/master/tests/multiparcel.shp and friends. There's a multiparcel-ref.osm file that is the target output. Perhaps a translator should not be invoking replacejwithi. But the translator should probably be invoked when tags on duplicated geometries need to be reconciled, and the detect/replace code should probably be in ogr2osm. This was my first approach. But a lot of questions came up about corner cases. Like what if you have two geometrically identical ways, one wrapped up in a Feature with attributes, and the other that is just a multipolygon Relation's child? My head started spinning on these, so I just focused on getting my specific case working in my specific translator code instead of solving the problem in general. I'm happy to work this up as a contribution to ogr2osm if you think this is worthy. Ciao, |
Hello Paul,
I've been working on a translator and found that exceptions from my translator functions were not appearing. I came up with a solution and would be grateful if you'd except it into the mainline. I also fixed a failing test. It seems that the sp_usinas test data attributes are in Latin-1 not UTF-8. But if the test passes on your machine, maybe I'm wrong about this.
Ciao,
Brian