Repository navigation
Conversation
make_input_data_kmls indexed topofiles/dtopofiles as [type, path] lists and failed with a TypeError on Topography or DTopography objects. It now normalizes entries as TopographyData/DTopoData do, and the topo box shows the region used: crop_extent if set, else the file extent moved by x/y_shift. Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
kmltools.make_input_data_kmlsreadtopofilesanddtopofilesonly in the legacy list form, taking the path fromf[-1]and the type fromf[0]. Asetrun.pythat appendsTopographyorDTopographyobjects, which is the current style, failed withThat happened outside the
try, so no kml files were written at all. For a cropped topofile, the box also showed the whole file rather than the region GeoClaw uses. That matters for the multi-tile setups in #760, where only part of each tile is used.Claude Analysis
Changes
make_input_data_kmlsconverts entries with the sameTopographyData._normalize_topofiles()/DTopoData._normalize_dtopofiles()thatmake datauses. Legacy[type, path]lists still work. Their deprecation warning is left tomake datainstead of being repeated here._topo_region_used():crop_extent, if one is set;topo_entries()descriptor entry, itscrop_boundsmoved by itslon_wrap_offset;x_shift/y_shift(the plain file extent when there is no shift, as before).topo2kmltakes an optionalextent=to draw a box other than the file's own extent. Existing calls are unchanged.Tests
tests/test_kmltools_inputs.pyrunsmake_input_data_kmlsand reads the box back from the kml it writes:Topographywith no crop: the file extent;Topographywithcrop_extent: the crop;Topographywithx_shift/y_shift: the shifted extent;DTopographyobject: its extent;[3, path]list: still works, with no secondDeprecationWarning.The four object cases fail on
master(0ba4db7b) with theTypeErrorand pass here. Fulltests/: 635 passed, 5 skipped, 1 xfailed.Related
#760. Once the crop-coverage rule is in, every
crop_extentis guaranteed to lie within its file, so the box drawn here is exactly the region used. A tile-selection helper (also #760) would then leave only the tiles that contribute intopofiles, which gives the kml output Randy described.