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

Annotation makes hangup mapfishprint #7780

Closed
1 task done
MaelREBOUX opened this issue Jan 26, 2022 · 15 comments
Closed
1 task done

Annotation makes hangup mapfishprint #7780

MaelREBOUX opened this issue Jan 26, 2022 · 15 comments

Comments

@MaelREBOUX
Copy link
Contributor

Description

When trying to print an annotation, we get a Java error from (we guess) Mapfisprint.

Error on printing: Error while generating PDF: java.lang.IllegalArgumentException: Points of LinearRing do not form a closed linestring at
 org.locationtech.jts.geom.LinearRing.validateConstruction(LinearRing.java:90) at
 org.locationtech.jts.geom.LinearRing.<init>(LinearRing.java:85) at
 org.locationtech.jts.geom.GeometryFactory.createLinearRing(GeometryFactory.java:356) at
 org.locationtech.jts.geom.GeometryFactory.createLinearRing(GeometryFactory.java:343) at
 org.mapfish.geo.MfGeoJSONReader.decodePolygon(MfGeoJSONReader.java:151) at
 org.mapfish.geo.MfGeoJSONReader.decodeJtsGeometry(MfGeoJSONReader.java:117) at
 org.mapfish.geo.MfGeoJSONReader.decodeGeometry(MfGeoJSONReader.java:88) at
 org.mapfish.geo.MfGeoJSONReader.decodeFeature(MfGeoJSONReader.java:84) at
 org.mapfish.geo.MfGeoJSONReader.decodeFeatureCollection(MfGeoJSONReader.java:75) at
 org.mapfish.geo.MfGeoJSONReader.decode(MfGeoJSONReader.java:63) at
 org.mapfish.print.map.readers.VectorMapReader.<init>(VectorMapReader.java:75) at
 org.mapfish.print.map.readers.VectorMapReader$Factory.create(VectorMapReader.java:57) at
 org.mapfish.print.map.readers.MapReaderFactoryFinder.create(MapReaderFactoryFinder.java:39) at
 org.mapfish.print.map.MapChunkDrawer.renderMap(MapChunkDrawer.java:142) at
 org.mapfish.print.map.MapChunkDrawer.renderImpl(MapChunkDrawer.java:87) at
 org.mapfish.print.ChunkDrawer.render(ChunkDrawer.java:55) at
 org.mapfish.print.config.layout.MapBlock$1.render(MapBlock.java:68) at
 org.mapfish.print.PDFCustomBlocks.addAbsoluteDrawer(PDFCustomBlocks.java:183) at
 org.mapfish.print.config.layout.MapBlock.render(MapBlock.java:64) at
 org.mapfish.print.config.layout.Page.render(Page.java:80) at
 org.mapfish.print.config.layout.Layout.render(Layout.java:67) at
 org.mapfish.print.output.AbstractOutputFormat.doPrint(AbstractOutputFormat.java:30) at
 org.mapfish.print.output.PdfOutputFactory.print(PdfOutputFactory.java:62) at
 org.mapfish.print.MapPrinter.print(MapPrinter.java:184) at
 org.mapfish.print.servlet.MapPrinterServlet.doCreatePDFFile(MapPrinterServlet.java:409) at
 org.mapfish.print.servlet.MapPrinterServlet.createPDF(MapPrinterServlet.java:190) at
 org.mapfish.print.servlet.MapPrinterServlet.doPost(MapPrinterServlet.java:107) at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494) at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137) at
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at
 org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2512) at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at
 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at
 java.lang.Thread.run(Thread.java:748) 

How to reproduce

  • Load this annotation.
  • Zoom on it
  • print the map

Annotations.zip

Expected Result

a PDF with the annotation

Current Result

Error while printing

Other useful information

  • Not browser related

  • MapStore geOrchestra 1.2.x

  • MapStore 2021.02.xx (c87f5fa)

image

@MaelREBOUX MaelREBOUX added the bug label Jan 26, 2022
@MaelREBOUX
Copy link
Contributor Author

MaelREBOUX commented Jan 31, 2022

I précise that the geometry is good (from FME full Geometry Validator test suite).

{
    "features": [{
            "type": "FeatureCollection",
            "properties": {
                "id": "1ebe3fa0-721f-11ec-beea-375c22d96e8a",
                "title": "Let's hang up mapfishprint",
                "visibility": true
            },
            "features": [{
                    "type": "Feature",
                    "geometry": {
                        "type": "Polygon",
                        "coordinates": [[[-1.6892571818815272, 48.106278017539005], [-1.6892063645978586, 48.10630953910334], [-1.6892019925372947, 48.10643901002401], [-1.6894509465367127, 48.10644108324848], [-1.6895030310843133, 48.10629506880371], [-1.689439667887719, 48.10628364488008]]]
                    },
                    "properties": {
                        "id": "1fd7ed00-721f-11ec-beea-375c22d96e8a",
                        "isValidFeature": true,
                        "canEdit": false
                    },
                    "style": [{
                            "color": "#d0021b",
                            "opacity": 1,
                            "weight": 4,
                            "fillColor": "#ffffff",
                            "fillOpacity": 0,
                            "editing": {
                                "fill": 1
                            },
                            "highlight": false,
                            "id": "1fd44380-721f-11ec-beea-375c22d96e8a"
                        }
                    ]
                }
            ],
            "style": {}
        }
    ],
    "type": "ms2-annotations"
}

@tdipisa tdipisa self-assigned this Jan 31, 2022
@MaelREBOUX
Copy link
Contributor Author

Hello @tdipisa

Here another annotations print problem.

Annotations.zip

@MaelREBOUX
Copy link
Contributor Author

MaelREBOUX commented May 23, 2022

I can reproduced on the up-to-date https://georchestra.geo-solutions.it/

For me it is clearly GeoTools that dislike theses geometries made with the annotations plugins.

We have many of users that are in that case.

@landryb
Copy link
Collaborator

landryb commented May 23, 2022

at first, drawing simple polygons i couldn't reproduce the issue on https://georchestra.geo-solutions.it/mapstore/#/, but importing the annotations.json export from @MaelREBOUX 's comment yes it also fails to validate here with the same error message.

To me the traceback shows that geotools fails to validate the geometry (that was created directly in ms2 annotation tools, from my understanding)

@landryb
Copy link
Collaborator

landryb commented May 23, 2022

@tdipisa : live-debugging with @MaelREBOUX we've found how to make it generate a geometry that fails to print:

  • draw a polygon
  • double-click at the end to 'finish' the polygon -> that generates a duplicate edge at the same coordinates
  • in the list of edges, remove the last duplicate edge, save the annotation
  • this geometry will fail to validate & print

@landryb
Copy link
Collaborator

landryb commented May 23, 2022

Peek 23-05-2022 11-03

@MaelREBOUX
Copy link
Contributor Author

I don't know how / why but after removing the 5th vertex : the red point that indicates the end of the polygon / construction is now affected to the the 3rd vertex :

image

But I do not know if it is the source of the problem.

@MaelREBOUX
Copy link
Contributor Author

Well. I think we have an issue. As you modify a previous polygon (which was printable) : you ever get a print error.

ms2_print_annotation_bug

@MaelREBOUX
Copy link
Contributor Author

It does not affect the lines. Only polygons.

ms2_print_annotation_bug_line

MapStore2-geOrchestra | :2022.01.xx(9c08c926)
MapStore2 | :2022.01.xx(e9b4af7)

on https://georchestra.geo-solutions.it/mapstore/#/

@MaelREBOUX
Copy link
Contributor Author

OK précision : it happens only if you delete a vertex o_O Nothing happens if you move a vertex.

@MaelREBOUX
Copy link
Contributor Author

Hello @tdipisa no investiguation yet ?

@tdipisa
Copy link
Member

tdipisa commented Nov 21, 2022

Hi @MaelREBOUX we haven't had a chance to investigate it yet.

@MaelREBOUX
Copy link
Contributor Author

Problem is still present on these versions :

  • MapStore2-geOrchestra : 2022.02.00-geOrchestra (f3ce6b9e)
  • MapStore2 : 2022.02.xx (15c0793)

@tdipisa
Copy link
Member

tdipisa commented Jan 31, 2023

This has been reproduced on both MS DEV and QA

annotations_bug

@dsuren1
Copy link
Contributor

dsuren1 commented Aug 2, 2023

Closing this issue in favour of #9319

@dsuren1 dsuren1 closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants