Uncaught exceptions from geoPHP libraries

Created on 18 March 2024, 3 months ago
Updated 5 April 2024, 3 months ago

Problem/Motivation

In some situations, we've seen the same error described in #3099605: Multi-value WKT fields fail β†’ on data imported successfully via feeds.

Exception: Cannot construct Point. x and y should be numeric in Point->__construct() (line 31 of /app/vendor/phayes/geophp/lib/geometry/Point.class.php).

This seems to happen for WKT data that includes extra whitespace.

Steps to reproduce

1. Create a content type with a Geolocation Geometry - Geometry Collection field
2. Create a view where the WKT is displayed by views_geojson
3. Create a node with additional whitespace in the WKT - e.g. GEOMETRYCOLLECTION(point( -0.10541484476951268 51.81177293566151),MULTILINESTRING((-0.235605249869247 51.9235864606639, -0.20252967751423 51.8980710191329), (-0.177959252336217 51.8753906266609, -0.141103614569198 51.8404250215998), (-0.117478205744186 51.8186896454808, -0.08723768244817 51.7941192203028), (-0.02864666856214 51.7402532881818, -0.06739233903516 51.7761639095958, -0.041876897504147 51.7525385007708), (-0.015416439620134 51.7241880101808, 0.015769100028882 51.6977275522968)))
4. Visit the view

If the whitespace is removed, the problem no longer occurs.

e.g. if you edit the WKT and change point( -0 to POINT(-0, it is displayed as expected.

I think that this is an instance of https://github.com/phayes/geoPHP/issues/181

Proposed resolution

Catch and log any exceptions

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom malcomio

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024