Skip to content

Update extent and fix column management when joining - #208

Open
f-necas wants to merge 3 commits into
mainfrom
misc-fixes
Open

f-necas wants to merge 3 commits into
mainfrom
misc-fixes

Conversation

@f-necas

@f-necas f-necas commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes 2 bugs when joining a table

  • First commit fixes an error when a dropped column on the left got the same name as a right one
Screenshot From 2026-10-22 16-37-58 - Second is about dropping a column with the same name as right didn't allow to click on next button Screenshot From 2026-10-22 16-47-15

@f-necas
f-necas requested review from cmangeat, fredj and tonio October 22, 2026 14:57

@cmangeat cmangeat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je n'ai pas regardé le front !

return extent


def _to_wgs84(conn: Connection, bbox: dict[str, float], epsg: int) -> dict[str, float]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ST_Transform on the envelope only reprojects its 4 corners. In conic projections like Lambert 93 the edges curve, so the WGS84 bbox comes out a bit too small. ST_Transform(ST_Segmentize(envelope, …), 4326) would fix it, or ST_Extent(ST_Transform(geom, 4326)) for an exact result.

"""Set the geographic bounding box of the resource to *bbox* (EPSG:4326)."""
return self

def _set_geographic_bbox(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add tests in tests/services/metadata_service_internals/ like the other methods have? One for creating the extent and one for overwriting an existing bbox, for both 19115-3 and 19139. The existing samples should be enough.

.add_online_resources_from_layer_urls_19115_3(layer_urls)
)
if wgs84_bbox is not None:
schema.update_geographic_extent(wgs84_bbox)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: this rewrites the bbox on every dag_success, scheduled runs included, so a bbox edited by hand in GeoNetwork gets overwritten. Is that intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense if rewrite on scheduled, because, as the dataset evolves and grows, so does the bbox. But it should indeed, well documented (or customizable ? @LHBruneton-C2C )

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm almost certain this writing the bbox in the metadata is currently dead code kept from Datafeeder V1 but not used by MEL in Datafeeder V2 (switched off by the default template and/or the xml transformation).
We faced several question about the extent, same as what @tonio mentionned.
I thought we were only updating the GeoServer extent ?

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

Successfully merging this pull request may close these issues.

4 participants