def valid_detail(flags = 0)
      detail = FFI::MemoryPointer.new(:pointer)
      location = FFI::MemoryPointer.new(:pointer)
      valid = bool_result(
        FFIGeos.GEOSisValidDetail_r(Geos.current_handle_pointer, ptr, flags, detail, location)
      )

      return if valid

      {
        detail: detail.read_pointer.read_string,
        location: cast_geometry_ptr(location.read_pointer, srid_copy: srid)
      }
    end
def valid_detail(flags = 0)
      detail = FFI::MemoryPointer.new(:pointer)
      location = FFI::MemoryPointer.new(:pointer)
      valid = bool_result(
        FFIGeos.GEOSisValidDetail_r(Geos.current_handle_pointer, ptr, flags, detail, location)
      )

      return if valid

      {
        detail: detail.read_pointer.read_string,
        location: cast_geometry_ptr(location.read_pointer, srid_copy: srid)
      }
    end
Returns a Hash containing the following structure on invalid geometries:

   {
     detail: "String explaining the problem",
     location: Geos::Point # centered on the problem
   }

 If the Geometry is valid, returns nil.