Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coordinate information to print page #906

Closed
wants to merge 4 commits into from

Conversation

willberthos
Copy link

Printed map now shows ETRS-TM35FIN coordinates on corners

@@ -137,6 +147,9 @@ public class PDF {
private static final String MARKER_COORD_SEPARATOR= "_";

private static final FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);

private static final ResourceBundle rb = ResourceBundle.getBundle("messages");
Copy link
Member

Choose a reason for hiding this comment

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

We should rename "messages" to something else to avoid confusion when theres another localization file set called messages. Maybe just rename to "print-messages"?

stream.stroke();
}

private static int[] getCornerCoords(PrintRequest request) {
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't round to int for all projections. Maybe just keep as is without rounding for now?

float textY2 = textY - OFFSET_TEXT_Y;

String coords = rb.getString("coordinates.lower") + ": " + bottomLat + ", " + bottomLon;
String projection = "ETRS-TM35FIN" + " " + rb.getString("coordinates");
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't hard-code "ETRS-TM35FIN". Get it from the messages based on projection with fallback to the EPSG-code.

@@ -321,6 +336,79 @@ private static void drawTimeseriesTexts(PDPageContentStream stream,
x, OFFSET_TIME_IN_TIMESERIES_BOTTOM);
}

private static void drawCornerCoords(PDPageContentStream stream, PrintRequest request, float x, float y, float mapHeight, float mapWidth, PDRectangle pageSize)
Copy link
Member

Choose a reason for hiding this comment

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

Page size isn't used so we can remove it from params:

Suggested change
private static void drawCornerCoords(PDPageContentStream stream, PrintRequest request, float x, float y, float mapHeight, float mapWidth, PDRectangle pageSize)
private static void drawCornerCoords(PDPageContentStream stream, PrintRequest request, float x, float y, float mapHeight, float mapWidth)

@ZakarFin ZakarFin mentioned this pull request Mar 24, 2023
@ZakarFin
Copy link
Member

Included in #1035

@ZakarFin ZakarFin closed this Dec 15, 2023
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.

2 participants