1

I am using ST_AsGeoBuf function in a query like that one:

SELECT ST_AsGeoBuf(t.*, 'geom') 
FROM table t

After decoding the geobuf to a legible JSON the boolean types show up as strings with values "f" or "t".

I also tested encoding and decoding GeoJSONs with Boolean attributes and it worked properly, so now I know that the issue lies within PostGIS and not the decoder or the format. I need to get a geobuf with proper Boolean types. Any workarounds for this?

PostGIS v3.0

2
  • Cast the column to TEXT (or INT) on-the-fly before passing the record to the function.
    – geozelot
    Commented Mar 1, 2021 at 14:24
  • I want to have a Boolean value in the geobuf without any conversions. At the moment the function works, but true/false values are automatically converted to strings 't' and 'f'. I know I can cast it to int or text but it causes an inconsistency in app logic, so I'd rather avoid that Commented Mar 1, 2021 at 14:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.