| 01:53 | * | uploaded an image: (53KiB) < libera.ems.host/_matrix/media/r0/downloa > |
| 01:54 | paul121[m] | xc skiing amongst and under center pivots today 😁 |
| 01:56 | paul121[m] | Have a seasonal ski trail throughout your field.. special geometry edge case? |
| 02:23 | symbioquine[m] | <symbioquine[m]> "Alright, no worries. I'll see..." <- Interestingly, geoPHP is failing to detect the format of the WKB data and returning `FALSE`... (Hitting [this case](github.com/phayes/geoPHP/blob/685562416e)) |
| 02:24 | symbioquine[m] | Haven't figured out why yet. |
| 10:10 | mstenta[m] | > Oh yes they should! |
| 10:10 | mstenta[m] | symbioquine fyi i fixed these docs |
| 10:10 | mstenta[m] | <paul121[m]> "xc skiing amongst and under..." <- wow! how deep is that snow?? |
| 10:14 | mstenta[m] | <symbioquine[m]> "Interestingly, geoPHP is failing..." <- huh. weird. what is the first character of your WKB? based on that function it looks like it's expecting a `1`... |
| 10:14 | * | sent a code block: libera.ems.host/_matrix/media/r0/downloa |
| 14:46 | * | farmBOT has joined |
| 16:18 | symbioquine[m] | <mstenta[m]> "huh. weird. what is the first..." <- Interestingly, the first 11 bytes of the WKB I'm looking at right now are; `00 00 00 00 03 00 00 00 01 00 00` - which, based on the [WKT(B) wiki page](en.wikipedia.org/wiki/Well-known_text_re), means it's in big endian format... |
| 16:23 | mstenta[m] | Oh huh... I just ran a query on my local v1 db and they all seems to start with `01` |
| 16:23 | * | uploaded an image: (15KiB) < libera.ems.host/_matrix/media/r0/downloa > |
| 16:25 | symbioquine[m] | Care to share that query? 😄 |
| 16:25 | mstenta[m] | `SELECT * FROM field_data_field_farm_geofield;` |
| 16:26 | mstenta[m] | or `SELECT field_farm_geofield_geom FROM field_data_field_farm_geofield;` if you just want the geom column |
| 16:27 | mstenta[m] | (that screenshot was taken from PHPStorm's query console UI) |
| 16:27 | symbioquine[m] | Ah, must be PHPStorm doing the nice printing :( |
| 16:28 | symbioquine[m] | `SELECT HEX(field_farm_geofield_geom) FROM field_data_field_farm_geofield;` seems to work... |
| 16:28 | mstenta[m] | yep |
| 16:28 | mstenta[m] | ah there ya go |
| 16:29 | mstenta[m] | wonder if GeoPHP just doesn't support big endian? i did this search... maybe some clues? github.com/phayes/geoPHP/search?q=endian |
| 16:38 | symbioquine[m] | Yeah, it looks like I only have 11 geometries in my DB with little endian WKB :( |
| 16:38 | mstenta[m] | Aw weird |
| 16:38 | mstenta[m] | And the big endian geometries show properly in v1 UI? |
| 16:39 | symbioquine[m] | And 958 with big endian |
| 16:39 | mstenta[m] | Bizarre. I don't know what would cause that. Could it be some lower level database configuration? |
| 16:40 | symbioquine[m] | Yeah, or even maybe some custom tooling of mine... I'm just surprised that so much of the data is that way. |
| 16:40 | symbioquine[m] | I would have expected more of a mix. |
| 16:41 | mstenta[m] | I've never dealt with this before. Is it possible to run an update query to convert them? |
| 16:42 | mstenta[m] | Oh could it be related to WFS operations from QGIS? |
| 16:44 | symbioquine[m] | Maybe, but it seems unlikely. As I recall, most of my geometries I mapped via my earlier WFS proxy which used the farmOS API |
| 16:45 | symbioquine[m] | In case it's helpful to other folks, the query I'm using to see the big endian geometries in my 1.x (MariaDB) DB is `SELECT entity_type, entity_id, SUBSTR(HEX(field_farm_geofield_geom), 1, 20) FROM `field_data_field_farm_geofield` WHERE SUBSTR(HEX(field_farm_geofield_geom), 1, 2) = '01'; ` |
| 16:49 | symbioquine[m] | symbioquine[m]: or rather that one shows the little endian ones :) it's `= '00'` at the end to show the big endian ones |
| 16:49 | symbioquine[m] | <mstenta[m]> "I've never dealt with this..." <- I'd imagine :) |
| 16:50 | symbioquine[m] | I guess I'll have to figure that out |
| 17:20 | symbioquine[m] | <mstenta[m]> "And the big endian geometries..." <- I think so |
| 17:23 | symbioquine[m] | Yeah, they all seem to show up correctly in 1.x |
| 17:24 | mstenta[m] | interesting - well maybe the geofield code doesn't care either way |
| 17:24 | symbioquine[m] | I'm guessing it's delegating to the geos library which maybe does support both endian-nesses |
| 17:24 | mstenta[m] | but geophp does |
| 17:24 | mstenta[m] | oh maybe geos plays a role too yea |
| 17:24 | mstenta[m] | lots of layers :-) |
| 17:24 | symbioquine[m] | yeah |
| 17:25 | mstenta[m] | geos / geophp / geofield |
| 17:32 | symbioquine[m] | I think in 1.x it may be loading via git.drupalcode.org/project/geofield/-/bl but I don't see the equivalent code path (to delegate to geos) in the 8.x-1.x version of geofield. |
| 17:34 | symbioquine[m] | Which I think could mean that data encoded/written on a big endian system via geos, (even with the vanilla farmOS docker container) might not migrate/display correctly in 2.x. |
| 17:36 | symbioquine[m] | That said, I think that should be a pretty rare scenario. |
| 17:37 | mstenta[m] | Ok yea I'm curious what might have caused big-endian usage in your db |
| 17:38 | mstenta[m] | <symbioquine[m]> "Maybe, but it seems unlikely. As..." <- was the WFS proxy writing binary data directly to that db column? |
| 17:38 | symbioquine[m] | I think I must have written a lot of the data via the python package `geomet` which seems to be writing the data as big-endian. |
| 17:38 | mstenta[m] | ahh ok |
| 17:38 | symbioquine[m] | mstenta[m]: The proxy used the farmOS APIs |
| 17:38 | mstenta[m] | oh ok |
| 17:39 | symbioquine[m] | The more recent WFS contrib module of mine uses the php entity API so that should be okay too. |
| 21:09 | symbioquine[m] | FYI: farmos.discourse.group/t/rewriting-farmo |