I spend some time today investigating a few tests \ compilations failures:

First comment, the current API breaks backward compatibility by requiring that a measure should always be provided when building a coordinate sequence, IMHO it should have a fallback method that assumes zero measures if none if provided ... otherwise changes in jaitools will also be required.

When investigating a failing test I step on a visibility change [1] that doesn't allow us to change LiteCoordinateSequence coordinates\dimension in place anymore. Long story short, we cannot set again the dimension anymore when changing the coordinates array [2], hence we cannot also change geometries in place anymore ...
Is there any good reason for the visibility change ? could it be reverted ?

Another issues, the following test [3] is failing when invoking the normalize function [4] on polygon:

Caused by: java.lang.IllegalArgumentException: Invalid ordinate index: 2
    at org.locationtech.jts.geom.CoordinateXY.getOrdinate(CoordinateXY.java:77)
    at org.locationtech.jts.geom.impl.CoordinateArraySequence.getOrdinate(CoordinateArraySequence.java:260)     at org.locationtech.jts.geom.CoordinateSequences.swap(CoordinateSequences.java:47)     at org.locationtech.jts.geom.CoordinateSequences.reverse(CoordinateSequences.java:32)
    at org.locationtech.jts.geom.Polygon.normalize(Polygon.java:429)
    at org.locationtech.jts.geom.Polygon.normalized(Polygon.java:416)
    at org.locationtech.jts.geom.Polygon.normalize(Polygon.java:374)
    at it.geosolutions.jaiext.vectorbin.ROIGeometry.<init>(ROIGeometry.java:269)
    at it.geosolutions.jaiext.vectorbin.ROIGeometry.<init>(ROIGeometry.java:195)
    at it.geosolutions.jaiext.vectorbin.ROIGeometry.<init>(ROIGeometry.java:150)
    at org.geotools.coverage.grid.io.footprint.MultiLevelROIGeometry$FastClipROIGeometry.<init>(MultiLevelROIGeometry.java:162)     at org.geotools.coverage.grid.io.footprint.MultiLevelROIGeometry.getTransformedROI(MultiLevelROIGeometry.java:128)     at org.geotools.coverage.grid.io.footprint.MultiLevelROIGeometry.getTransformedROI(MultiLevelROIGeometry.java:45)     at org.geotools.gce.imagemosaic.GranuleDescriptor.loadRaster(GranuleDescriptor.java:1348)
    at org.geotools.gce.imagemosaic.GranuleLoader.call(GranuleLoader.java:108)
    ... 44 more

I'm not familiar with JTS code, so I'm clueless in find out what may be causing this :(

Last finding, the previous coordinate object, even if only a dimension of 2 was provided, was always allowing to access or set a Z value, this is not the case anymore in the new API [5]. I agree that the behavior of the new API is the correct behavior, but unfortunately it breaks existing expectations. The issue here is that again this will prevent us to change geometries in place, which means that some not so trivial re-factor will need to be done in a few places.

This are the issues I found when using the new JTS API, all of the found issues (at exception the polygon normalize) are the consequence of the new JTS API breaking backward compatibility.

[1] https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/geom/impl/PackedCoordinateSequence.java#L48 [2] https://github.com/geotools/geotools/blob/master/modules/library/main/src/main/java/org/geotools/geometry/jts/LiteCoordinateSequence.java#L81-L88 [3] https://github.com/geotools/geotools/blob/master/modules/plugin/imagemosaic/src/test/java/org/geotools/gce/imagemosaic/ImageMosaicFootprintsTest.java#L1053-L1080 [4] https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/geom/Polygon.java#L373-L379 [5] https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/geom/CoordinateXY.java#L80-L92

On 08/14/2018 03:27 AM, Nuno Oliveira wrote:
Hi Jody,
yes I saw the notes, thanks for the heads up :)

I have made two PRs one in GeoServer and another one GeoTools:

  * https://github.com/geoserver/geoserver/pull/3051
  * https://github.com/geotools/geotools/pull/2008

The GeoServer PR basically allow us to configure per feature type if coordinates measures should be encoded or not (is a check-box in the publishing tab under WFS section).

The GeoTools pull request makes:

  * PostGIS correctly read coordinates with measures
  * GML3 and GML32 correctly encode coordinates with measurements or not if it
    was configured that way (GS checkbox)

Looking forward to read you feedback on this.

Thanks,

Nuno Oliveira


On 08/09/2018 04:31 AM, Jody Garnett wrote:
Restarting this thread, although perhaps you saw the update in the meeting notes.

The XYZM support has been merged to jts master branch, so you should be in position to start your work (using 1.16.0-SNAPSHOT). Expect to issue a 1.16.0-RC when you are ready to merge your work.

James is starting the release cycle for JTS on gitter, takes about three weeks, putting us in position to make an official 1.16.0 release in September.
--
Jody Garnett


On Tue, 31 Jul 2018 at 05:09, Nuno Oliveira <[email protected] <mailto:[email protected]>> wrote:

    Hi all,

    I'm working on bringing support for M measurements in WFS. Some parallel
    work
    related with this is happening on JTS:

       * https://github.com/locationtech/jts/pull/293
       * https://github.com/locationtech/jts/pull/291

    If I understood the JTS situation correctly, currently is already
    possible to
    store the M measurements values in
    JTS geometries (XYZM or XYM), but is up to the client code to identify
    them and
    handle them. The main goal of the
    changes above is to create a cleaner \ explicit JTS API, i.e. make it
    easier for
    client code to understand what
    type of coordinates are available and make it easier to access the relevant
    ordinates.

    I'm not aware of JTS release schedule, but I guess these changes will
    land on
    the next major release ? Which means
    that they will not be available for us to use in GT\GS anytime soon. I would
    like to have the M support for WFS to
    land on master before the next GeoServe 2.14.x release, i.e. it need to
    land on
    master next week at most.

    Not using the new JTS API means that we will need to store the number of
    measures in the geometry user data.
    This would be aligned with the new JTS API approach, quoting Jody comment
    on one
    of the pull request above:

       I ended up having CoordianteSequence.getDimension() as described in the
    conversation above, and
       CoordianteSequence.getMeasures() being the number of measures (so if
    we have
    XYZM dimension is 4 and measures is 1.

    ... so when the new JTS API becomes available we just need to switch to
    get the
    measures value from the JTS API
    instead of the user data.

    That said, supporting M measurements in WFS will require:

       1. correctly read geometries with measurements from data sources
       2. correctly encode the measurements in the output formats
       3. correctly handling measurements when doing certain operations, e.g.
    re-projections

    The following issue in GeoServer as an interesting discussion about this:

    https://osgeo-org.atlassian.net/browse/GEOS-8858

    Using PostGIS and GML 3.2. as an example:

       1. we will need to take into account the possibility of a measurement
    value
    when decoding geometries from postgis:
    
https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/WKBReader.java#L194-L197

       2. the correct geometry type (LINESTRINGM, LINESTRINGZM, etc ...) can be
    obtained from the database metadata

       3. vouch for the M measurement when encoding coordinates, e.g. linestring
    encoding for GML 3.2
    
https://github.com/geotools/geotools/blob/master/modules/extension/xsd/xsd-gml2/src/main/java/org/geotools/gml2/simple/GMLWriter.java#L287-L301

    In point 1 or 2 we will store in the user data the measurements number
    and use
    it in point 3.

    Comments on this are welcome :)

    Cheers,

    Nuno Oliveira

-- Regards,
    Nuno Oliveira
    ==
    GeoServer Professional Services from the experts!
    Visit http://goo.gl/it488V for more information.
    ==

    Nuno Miguel Carvalho Oliveira
    @nmcoliveira
    Software Engineer

    GeoSolutions S.A.S.
    Via di Montramito 3/A
    55054  Massarosa (LU)
    Italy
    phone: +39 0584 962313
    fax:      +39 0584 1660272

    http://www.geo-solutions.it
    http://twitter.com/geosolutions_it

    -------------------------------------------------------

    Con riferimento alla normativa sul trattamento dei dati
    personali (Reg. UE 2016/679 - Regolamento generale sulla
    protezione dei dati “GDPR”), si precisa che ogni
    circostanza inerente alla presente email (il suo contenuto,
    gli eventuali allegati, etc.) è un dato la cui conoscenza
    è riservata al/i solo/i destinatario/i indicati dallo
    scrivente. Se il messaggio Le è giunto per errore, è
    tenuta/o a cancellarlo, ogni altra operazione è illecita.
    Le sarei comunque grato se potesse darmene notizia.

    This email is intended only for the person or entity to
    which it is addressed and may contain information that
    is privileged, confidential or otherwise protected from
    disclosure. We remind that - as provided by European
    Regulation 2016/679 “GDPR” - copying, dissemination or
    use of this e-mail or the information herein by anyone
    other than the intended recipient is prohibited. If you
    have received this email by mistake, please notify
    us immediately by telephone or e-mail.


    
------------------------------------------------------------------------------
    Check out the vibrant tech community on one of the world's most
    engaging tech sites, Slashdot.org! http://sdm.link/slashdot
    _______________________________________________
    Geoserver-devel mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/geoserver-devel


--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts!
Visithttp://goo.gl/it488V  for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.

--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati
personali (Reg. UE 2016/679 - Regolamento generale sulla
protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto,
gli eventuali allegati, etc.) è un dato la cui conoscenza
è riservata al/i solo/i destinatario/i indicati dallo
scrivente. Se il messaggio Le è giunto per errore, è
tenuta/o a cancellarlo, ogni altra operazione è illecita.
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to
which it is addressed and may contain information that
is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European
Regulation 2016/679 “GDPR” - copying, dissemination or
use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you
have received this email by mistake, please notify
us immediately by telephone or e-mail.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to