Filed in JIRA as JENA-2202 [1]

As always pull requests are welcome

Regards,

Rob

[1] https://issues.apache.org/jira/browse/JENA-2202

On 01/12/2021, 08:59, "Jean-Marc Vanel" <jeanmarc.va...@gmail.com> wrote:

    In the special case when latitude is present but not longitude, a null
    pointer exception is raised, which kills the Spatial initialization.

    In
    
jena-geosparql/src/main/java/org/apache/jena/geosparql/spatial/SpatialIndex.java
    in method getGeoPredicateIndexItems() line 453 (latest git code),
    it's enough to add a continue instruction, to allow the loop on RDF
    statements to finish:

                GeometryWrapper geometryWrapper = null;
                try {
                    Literal lon =
    feature.getRequiredProperty(SpatialExtension.GEO_LON_PROP).getLiteral();
                    Literal latLonPoint =
    ConvertLatLon.toLiteral(lat.getFloat(), lon.getFloat());
                    geometryWrapper = GeometryWrapper.extract(latLonPoint);
                } catch (org.apache.jena.shared.PropertyNotFoundException ex) {
                    LOGGER.warn("Geo predicates: Lat found but not Lon. " +
    feature);
    *                continue;*
               }

    Jean-Marc Vanel
    
<http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
    +33 (0)6 89 16 29 52
    Twitter: @jmvanel , @jmvanel_fr ;
     Chroniques jardin
    
<http://semantic-forms.cc:1952/history?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle>




Reply via email to