Conversation
|
In the present state, that PR should'nt be merged until we state on #303 : it uses a recent geopandas functionality which is not available in the latest py3.9-compatible geopandas release. |
|
OK, this is good for review. I dumped most of the tree decision managing department's retrieval as it was not easy to maintain and could somehow be quite slow. It's been simplified to 3 cases:
During my manual tests, I've mostly seen awkward results for "collectivités territoriales" (Saint-Martin, Saint-Barthélémy) or some other exotic cases : for instance arrondissements municipaux datasets, cantons, where there are holes in french territory or when you choose to zoom in on Paris' inner suburbs and your current dataset has geometries maching Paris's external suburbs. I don't think that was ever perfectly rendered in pynsee... |
| # (This shouldn't be necessary with modern ADMINEXPRESS datasets and | ||
| # is here as a backup safe) | ||
| dep["insee_dep_geometry"] = dep.simplify_coverage(1) | ||
| dep["insee_dep_geometry"] = dep["insee_dep_geometry"].buffer(-1) |
There was a problem hiding this comment.
shouldn't this occur only in the if? (otherwise there is no overlap so I don't see why we should change the correct polygons
There was a problem hiding this comment.
No : if a geometry fully covers a city department, it will sjoin on a city and it's neighbours. The buffer of -1meter is gonna fix this in the overwhelming majority of cases.
EDIT : I meant a department and not a city, obviously... 😳
There was a problem hiding this comment.
sorry, I'm not getting this, could you maybe draw it on a piece of paper and take a photo? (or we can schedule a meeting to discuss it in real time if it's easier, in which case you can just email me)
To prepare for that discussion, even though I don't get the issue, I'm wondering why you chose not to test for small fractions of the original areas instead of modifying the original geometries.
There was a problem hiding this comment.
There was a problem hiding this comment.
Is this clearer?
EDIT
The negative buffer helps avoiding case 1A. Problems might occur on case 2B, but that seems too exotic a case to be handled by pynsee (I think this will concern only points in a 2meters-large bandwidth around DROM territories).
There was a problem hiding this comment.
I'm wondering why you chose not to test for small fractions of the original areas instead of modifying the original geometries.
I'm not sure I understood what you meant either. Let's discuss this in our matrix chanel?
| # buffer on deps should be safe to be used without any duplication | ||
| # of gdf, except when there is a valid overlapping (ie regions | ||
| # covering multiple deps, interdep epcis...). |
There was a problem hiding this comment.
I don't think the buffer part is relevant here anymore, is it?
There was a problem hiding this comment.
This is still useful for case 1A (see above).
| # Retrieve simplified geometries for deps. Note that it used a negative | ||
| # buffer (10 meters) which should not alter geographic transformations | ||
| # given it's range |
There was a problem hiding this comment.
adapt to "may" if you indeed moved the buffer into the if
There was a problem hiding this comment.
I fxed the comment (not a 10 meter range, but 1 meter)
|
Note for memory's sake: we also could detect multipoint datasets and link it to parent datasets. For instance
|

#299 and #296