Modify

Opened 15 months ago

Closed 13 months ago

Last modified 12 months ago

#23157 closed defect (fixed)

[patch] Fix jrenderpgsql build errors

Reported by: oobayly Owned by: malcolmh
Priority: normal Milestone:
Component: Plugin seachart Version:
Keywords: Cc:

Description (last modified by oobayly)

A previous commit - https://github.com/JOSM/josm-plugins/commit/edd4b35b37f324f49f2a39a15cb1f5a3aff441e7 - changed the signature of S57osm.OSMmap to only accept a File object. This has made it pretty inflexible as we now have to pass a physical file.

The jrenderpgsql package generates OSM XML from a Postgres Query in-memory, and therefore is no longer able use pass the data to the OSMmap method.

I suggest overloading the S57osm.OSMmap method to make it more flexible by allowing it to accept InputStream and Document objects as well.

The reason for the Document overload is that at the moment jrenderpgsql generates hand written XML, which isn't ideal. It would be better that it instead creates an Document directly and pass it to S57osm.OSMmap without the overhead of it having to be parsed. The extra overload prepares the method for that future change which I'd also like to implement.

I've attached a diff of my changes and would welcome any comments.

Attachments (1)

seachart.diff (3.3 KB ) - added by oobayly 15 months ago.

Download all attachments as: .zip

Change History (6)

by oobayly, 15 months ago

Attachment: seachart.diff added

comment:1 by oobayly, 15 months ago

Description: modified (diff)

comment:2 by gaben, 15 months ago

Summary: Fix jrenderpgsql build errors[patch] Fix jrenderpgsql build errors

comment:3 by oobayly, 15 months ago

A few more things to note. I've forked and created a branch where I've modified the seachart plugin, making the following changes:

  • Removed explicit version for the postgis-jdbc.jar class
  • Fixed the build errors, as per the diff attached in my initial post
  • This is the major change, refactored the code to generate the OSM using org.w3c.dom.Document which has the following benefits:
    • No XML parse errors due to unescaped special characters in attribute values or unclosed elements
    • Quicker - I saw rendering go from .5s to .35s (YMMV), which I was pleasantly surprised by

I've been running this on a personal docker image in conjunction with tirex and it's running pretty smoothly out to Z=7

The repo is here - https://github.com/oobayly/josm-plugins/tree/seachart-jrender
And this is a comparison of my branch to master - https://github.com/JOSM/josm-plugins/compare/master...oobayly:josm-plugins:seachart-jrender

comment:4 by taylor.smock, 13 months ago

Resolution: fixed
Status: newclosed

In 36169/osm:

Fix #23157: Change S57osm.OSMmap to accept either a file or inputstream (patch by oobayly)

comment:5 by taylor.smock, 12 months ago

@oobayly: I'm working on converting the JOSM Plugin SVN repo to git. Do you have a preferred name and email for that?

EDIT: I'm going to assume (for now) that what you used in your fork is "OK".

Last edited 12 months ago by taylor.smock (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain malcolmh.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.