Frank,

Thank you for this. I had a suspicion feat1 had a purpose at some point. It'd probably be interesting to hear if you ever do remember what that might have been.

I've made a couple other changes to my version of this since contacting you last week. Precision of the LAT/LONG fields is now 7, as per S-52 Appendix B.2. But then, to add flexibility for the user of the KML file, I ditched my additional second argument to specify metres or feet in favor of creating and filling both a DEPTHM and a DEPTHF field. This gives the user the choice of switching between the two without generating a separate KML file.

Thanks again,

Dave

On July 29, 2017 at 10:00 PM Frank Warmerdam <warmer...@pobox.com> wrote:

Dave,

Thanks for the notice. I am not updating the upstream get_soundg.py
but I've taken the liberty of cc:ing this reply to the gdal-dev
mailing list so more potentially interested folks will be aware of
your changes, and your blog post:

http://micuisine.com/code-projects/?page_id=10

I was particularly amused by change entry "Changed feat2 to feat1 to
prevent searching for unused feat1.". Indeed looking back at the code
there must have been some history behind my use of feat2 that was lost
and now is just confusing.

Best regards,
Frank

On Sat, Jul 29, 2017 at 7:46 AM, Dave Liske <d...@micuisine.com> wrote:

Mr. Warmerdam,

In recently looking for a method to split the depth values from NOAA S-57
files for a personal art project, I came across your 2003 get_soundg.py file
for accomplishing the task via Python. In running your file with
us3fl28m.000 I found that it did, in fact, accomplish what I was trying to
do. But it also generated a number of errors, the reasons of which are not
clear as it likely didn't generate those same errors in 2003 when you
originally released the script.

Sir I know this is out-of-the-blue but I wanted you to know that, with some
changes to correct current errors, your 2003 code still does what you
intended. I then took it a few more steps to hopefully make it more useful
for some as well.

I've made the following changes, saving the new version as
s57_kml_extract_soundg.py:

  • Added error handling if SOUNDG layer or source S-57 file is not found.
  • Deleted second usage argument: Added code to create target file in same
    directory as source S-57 file.
  • Added new second usage argument: Select soundings as provided as 'metre',
    or calculate new sounding values as 'feet'
  • Target File Type: Changed to KML. Errors are subsequently handled
    correctly, i.e. the errors are suppressed while the FFPT_RIND and LNAM_REFS
    fields are also not included in the resulting KML file.
  • Added "_metre" or "_feet" to the new filename based on second usage
    argument
  • Added WGS84 CSR to the target KML file.
  • Changed created layer name from 'out' to 'KML_SOUNDG'. When imported into
    QGIS the resulting layer is displayed as <kmlfile>_KML_SOUNDG_Point in the
    Browser Panel.
  • Changed target field 'ELEV' to 'DEPTH', which is accurate for soundings.
  • Changed precision for 'DEPTH' field from 4 to 0 to reflect chart usage.
  • Added target fields 'LAT' and 'LONG' for xcoord and ycoord.
  • Changed feat2 to feat1 to prevent searching for unused feat1.
  • Added completion messages.

I've posted the new code at http://micuisine.com/code-projects/?page_id=10
along with further descriptions, as well as a link to a ZIP file containing
s57_kml_extract_soundg.py.

I hope this email finds you well, and that these updates are useful and not
offensive in some manner. Please feel free to contact me with any comments
or questions about this updated work.

Sincerely,
Dave Liske
Luna Pier, Michigan

--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows |
and watch the world go round - Rush | Geospatial Software Developer

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to