I have a series of letters, each with a recipient and sender address stored with Addressfield, with spatial data added Geocoder into lat/long and stored in a Geofield. I'm using IPGV&M, Views, and Leaflet to render these points - 1 letter to each row, with 2 points (sender / recipient). This is working fine.

I'd now like to add a linestring between those two points, but am at a loss for how to do that. Can Geofield store linestrings? Can I automatically generate a linestring and store that in a Geofield field based on the geo POINT values of the sender / recipient Geofields?


I ended up using Rules to automatically populate a text field with the linestring data LINESTRING(lat lon, lat lon) after every new entity add or existing entity update, with the condition that both geofields (sender and receiver) were filled. Created another geofield to hold the LINESTRING, geocoded from the text linestring field as WKT. Ran VBO to update all existing nodes. Plots well in IPGV&M and should handle itself automatically from now on.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.